SCM

SCM Repository

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

Diff of /pkg/R/lMatrix.R

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

revision 2004, Tue Jul 17 22:12:30 2007 UTC revision 2005, Wed Jul 18 14:46:20 2007 UTC
# Line 36  Line 36 
36        function(from) {        function(from) {
37            r <- new(class2(class(from), "l"))# default => no validity            r <- new(class2(class(from), "l"))# default => no validity
38            r@x <- as.logical(from@x)            r@x <- as.logical(from@x)
39            for(nm in slotNames(r)) if(nm != "x")            sNams <- slotNames(r)
40              for(nm in sNams[sNams != "x"])
41                slot(r, nm) <- slot(from, nm)                slot(r, nm) <- slot(from, nm)
42            r            r
43        })        })
# Line 45  Line 46 
46        function(from) {        function(from) {
47            r <- new(sub("^l", "d", class(from)))            r <- new(sub("^l", "d", class(from)))
48            r@x <- as.double(from@x)            r@x <- as.double(from@x)
49            for(nm in slotNames(r)) if(nm != "x")            sNams <- slotNames(r)
50              for(nm in sNams[sNams != "x"])
51                slot(r, nm) <- slot(from, nm)                slot(r, nm) <- slot(from, nm)
52            r            r
53        })        })
# Line 54  Line 56 
56  setAs("lMatrix", "dgCMatrix",  setAs("lMatrix", "dgCMatrix",
57        function(from) as(as(from, "lgCMatrix"), "dgCMatrix"))        function(from) as(as(from, "lgCMatrix"), "dgCMatrix"))
58    
59  ## all() and any() methods ---> ldenseMatrix.R and lsparseMatrix.R  ## all() methods ---> ldenseMatrix.R and lsparseMatrix.R
60    
61    setMethod("any", signature(x = "lMatrix"),
62              function(x, ..., na.rm = FALSE)
63              ## logical unit-triangular has TRUE diagonal:
64              (prod(dim(x)) >= 1 && is(x, "triangularMatrix") && x@diag == "U") ||
65              any(x@x, ..., na.rm = na.rm))

Legend:
Removed from v.2004  
changed lines
  Added in v.2005

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