# SCM Repository

[matrix] Diff of /pkg/R/lsparseMatrix.R
 [matrix] / pkg / R / lsparseMatrix.R

# Diff of /pkg/R/lsparseMatrix.R

revision 924, Mon Sep 19 08:40:29 2005 UTC revision 925, Mon Sep 19 19:01:31 2005 UTC
# Line 2  Line 2
2
3  ###------- Work via  as(*, lgC) : ------------  ###------- Work via  as(*, lgC) : ------------
4
5  ##setMethod("%*%", signature(x = "lsparseMatrix", y = "lsparseMatrix"),  ## For multiplication operations, sparseMatrix overrides other method
6  ##          function(x, y) callGeneric(as(x, "lgCMatrix"), as(y, "lgCMatrix")))  ## selections.  Coerce a ddensematrix argument to a lsparseMatrix.
7
8  ##setMethod("crossprod", signature(x = "lsparseMatrix", y = "missing"),  setMethod("%*%", signature(x = "lsparseMatrix", y = "ldenseMatrix"),
9  ##        function(x, y = NULL)            function(x, y) callGeneric(x, as(y, "lsparseMatrix")))
10  ##          .Call("lgCMatrix_crossprod", as(x, "lgCMatrix"), TRUE, NULL),
11  ##        valueClass = "lsCMatrix")  setMethod("%*%", signature(x = "ldenseMatrix", y = "lsparseMatrix"),
12              function(x, y) callGeneric(as(x, "lsparseMatrix"), y))
13  ##setMethod("tcrossprod", signature(x = "lsparseMatrix"),
14  ##        function(x)  setMethod("crossprod", signature(x = "lsparseMatrix", y = "ldenseMatrix"),
15  ##          .Call("lgCMatrix_crossprod", as(x, "lgCMatrix"), FALSE, NULL),            function(x, y = NULL) callGeneric(x, as(y, "lsparseMatrix")))
16  ##        valueClass = "lsCMatrix")
17    setMethod("crossprod", signature(x = "ldenseMatrix", y = "lsparseMatrix"),
18              function(x, y = NULL) callGeneric(as(x, "lsparseMatrix"), y))
19
20    ## and coerce lsparse* to lgC*
21    setMethod("%*%", signature(x = "lsparseMatrix", y = "lsparseMatrix"),
22              function(x, y) callGeneric(as(x, "lgCMatrix"), as(y, "lgCMatrix")))
23
24    setMethod("crossprod", signature(x = "lsparseMatrix", y = "lsparseMatrix"),
25              function(x, y = NULL)
26              callGeneric(as(x, "lgCMatrix"), as(y, "lgCMatrix")))
27

Legend:
 Removed from v.924 changed lines Added in v.925

 root@r-forge.r-project.org ViewVC Help Powered by ViewVC 1.0.0
Thanks to: