SCM

SCM Repository

[matrix] Diff of /pkg/R/Matrix.R
ViewVC logotype

Diff of /pkg/R/Matrix.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1389, Fri Aug 18 13:53:33 2006 UTC revision 1390, Fri Aug 18 15:41:36 2006 UTC
# Line 19  Line 19 
19  setMethod("as.array",  signature(x = "Matrix"), function(x) as(x, "matrix"))  setMethod("as.array",  signature(x = "Matrix"), function(x) as(x, "matrix"))
20    
21  ## head and tail apply to all Matrix objects for which subscripting is allowed:  ## head and tail apply to all Matrix objects for which subscripting is allowed:
22  if(paste(R.version$major, R.version$minor, sep=".") < "2.4") {  ## if(paste(R.version$major, R.version$minor, sep=".") < "2.4") {
23      setMethod("head", signature(x = "Matrix"), utils:::head.matrix)      setMethod("head", signature(x = "Matrix"), utils:::head.matrix)
24      setMethod("tail", signature(x = "Matrix"), utils:::tail.matrix)      setMethod("tail", signature(x = "Matrix"), utils:::tail.matrix)
25  } else { # R 2.4.0 and newer  ## } else { # R 2.4.0 and newer
26      setMethod("head", signature(x = "Matrix"), utils::head.matrix)  ##     setMethod("head", signature(x = "Matrix"), utils::head.matrix)
27      setMethod("tail", signature(x = "Matrix"), utils::tail.matrix)  ##     setMethod("tail", signature(x = "Matrix"), utils::tail.matrix)
28  }  ## }
29    
30  ## slow "fall back" method {subclasses should have faster ones}:  ## slow "fall back" method {subclasses should have faster ones}:
31  setMethod("as.vector", signature(x = "Matrix", mode = "missing"),  setMethod("as.vector", signature(x = "Matrix", mode = "missing"),
32            function(x) as.vector(as(x, "matrix")))            function(x) as.vector(as(x, "matrix")))

Legend:
Removed from v.1389  
changed lines
  Added in v.1390

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge