# SCM Repository

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

# Diff of /pkg/R/dsparseMatrix.R

revision 945, Wed Sep 28 08:54:28 2005 UTC revision 946, Wed Sep 28 08:56:42 2005 UTC
# Line 29  Line 29
29  setMethod("crossprod", signature(x = "dgeMatrix", y = "dsparseMatrix"),  setMethod("crossprod", signature(x = "dgeMatrix", y = "dsparseMatrix"),
30            function(x, y = NULL) callGeneric(x, as(y, "dgCMatrix")))            function(x, y = NULL) callGeneric(x, as(y, "dgCMatrix")))
31
32    setMethod("image", "dsparseMatrix",
33              function(x, ...) image(as(x, "dgTMatrix"), ...))
34
35
36
37  ## Group Methods, see ?Arith (e.g.)  ## Group Methods, see ?Arith (e.g.)
38  ## -----  ## -----
39
# Line 46  Line 51
51
52  setMethod("Math",  setMethod("Math",
53            signature(x = "dsparseMatrix"),            signature(x = "dsparseMatrix"),
54            function(x) callGeneric(as(x, "dgCMatrix")))            function(x) {
55                  r <- callGeneric(as(x, "dgCMatrix"))
56                  if(is(r, "dsparseMatrix")) as(r, class(x))
57              })
58
59    if(FALSE) ## unneeded with "Math2" in ./dMatrix.R
60  setMethod("Math2",  setMethod("Math2",
61            signature(x = "dsparseMatrix", digits = "numeric"),            signature(x = "dsparseMatrix", digits = "numeric"),
62            function(x, digits) callGeneric(as(x, "dgCMatrix"), digits = digits))            function(x, digits) {
63                  r <- callGeneric(as(x, "dgCMatrix"), digits = digits)
64                  if(is(r, "dsparseMatrix")) as(r, class(x))
65              })
66
67
68  ### cbind2 / rbind2  ### cbind2 / rbind2

Legend:
 Removed from v.945 changed lines Added in v.946