SCM

SCM Repository

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

Diff of /pkg/R/dsparseMatrix.R

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

revision 1225, Mon Mar 13 14:06:17 2006 UTC revision 1226, Mon Mar 13 14:07:58 2006 UTC
# Line 40  Line 40 
40  ## Group Methods, see ?Arith (e.g.)  ## Group Methods, see ?Arith (e.g.)
41  ## -----  ## -----
42    
43  ## NOT YET (first need 'dgCMatrix' method):  setMethod("Arith", ##  "+", "-", "*", "^", "%%", "%/%", "/"
44  ## setMethod("Arith", ##  "+", "-", "*", "^", "%%", "%/%", "/"            signature(e1 = "dsparseMatrix", e2 = "dsparseMatrix"),
45  ##           signature(e1 = "dsparseMatrix", e2 = "dsparseMatrix"),            function(e1, e2) callGeneric(as(e1, "dgCMatrix"),
46  ##           function(e1, e2) callGeneric(as(e1, "dgCMatrix"),                                         as(e2, "dgCMatrix")))
47  ##                                        as(e2, "dgCMatrix")))  setMethod("Arith",
48  ## setMethod("Arith",            signature(e1 = "dsparseMatrix", e2 = "numeric"),
49  ##           signature(e1 = "dsparseMatrix", e2 = "numeric"),            function(e1, e2) callGeneric(as(e1, "dgCMatrix"), e2))
50  ##           function(e1, e2) callGeneric(as(e1, "dgCMatrix"), e2))  setMethod("Arith",
51  ## setMethod("Arith",            signature(e1 = "numeric", e2 = "dsparseMatrix"),
52  ##           signature(e1 = "numeric", e2 = "dsparseMatrix"),            function(e1, e2) callGeneric(e1, as(e2, "dgCMatrix")))
 ##           function(e1, e2) callGeneric(e1, as(e2, "dgCMatrix")))  
53    
54  setMethod("Math",  setMethod("Math",
55            signature(x = "dsparseMatrix"),            signature(x = "dsparseMatrix"),
# Line 122  Line 121 
121                function(x, y) {                function(x, y) {
122                    nr <- rowCheck(x,y)                    nr <- rowCheck(x,y)
123                    ## beware of (packed) triangular, symmetric, ...                    ## beware of (packed) triangular, symmetric, ...
124                    hasDN <- !all(lapply(c(dnx <- dimnames(x), dny <- dimnames(y)), is.null))                    hasDN <- !all(lapply(c(dnx <- dimnames(x),
125                    ans <- .Call("Csparse_horzcat", as(x, "dgCMatrix"), as(y, "dgCMatrix"))                                           dny <- dimnames(y)), is.null))
126                      ans <- .Call("Csparse_horzcat",
127                                   as(x, "dgCMatrix"), as(y, "dgCMatrix"))
128                    if(hasDN) {                    if(hasDN) {
129                        ## R and S+ are different in which names they take                        ## R and S+ are different in which names they take
130                        ## if they differ -- but there's no warning in any case                        ## if they differ -- but there's no warning in any case
# Line 141  Line 142 
142                function(x, y) {                function(x, y) {
143                    nr <- colCheck(x,y)                    nr <- colCheck(x,y)
144                    ## beware of (packed) triangular, symmetric, ...                    ## beware of (packed) triangular, symmetric, ...
145                    hasDN <- !all(lapply(c(dnx <- dimnames(x), dny <- dimnames(y)), is.null))                    hasDN <- !all(lapply(c(dnx <- dimnames(x),
146                    ans <- .Call("Csparse_vertcat", as(x, "dgCMatrix"), as(y, "dgCMatrix"))                                           dny <- dimnames(y)), is.null))
147                      ans <- .Call("Csparse_vertcat",
148                                   as(x, "dgCMatrix"), as(y, "dgCMatrix"))
149                    if(hasDN) {                    if(hasDN) {
150                        ## R and S+ are different in which names they take                        ## R and S+ are different in which names they take
151                        ## if they differ -- but there's no warning in any case                        ## if they differ -- but there's no warning in any case

Legend:
Removed from v.1225  
changed lines
  Added in v.1226

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