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 1331, Sat Jul 22 17:59:53 2006 UTC revision 1460, Tue Aug 29 14:07:52 2006 UTC
# Line 1  Line 1 
1  ## For multiplication operations, sparseMatrix overrides other method  ## For multiplication operations, sparseMatrix overrides other method
2  ## selections.  Coerce a ddensematrix argument to a dgeMatrix.  ## selections.  Coerce a ddensematrix argument to a dgeMatrix.
3    
4  setMethod("%*%", signature(x = "dsparseMatrix", y = "ddenseMatrix"),  ## setMethod("%*%", signature(x = "dsparseMatrix", y = "ddenseMatrix"),
5            function(x, y) callGeneric(x, as(y, "dgeMatrix")))  ##           function(x, y) callGeneric(x, as(y, "dgeMatrix")))
6    
7  setMethod("%*%", signature(x = "ddenseMatrix", y = "dsparseMatrix"),  ## setMethod("%*%", signature(x = "ddenseMatrix", y = "dsparseMatrix"),
8            function(x, y) callGeneric(as(x, "dgeMatrix"), y))  ##           function(x, y) callGeneric(as(x, "dgeMatrix"), y))
9    
10  setMethod("crossprod", signature(x = "dsparseMatrix", y = "ddenseMatrix"),  setMethod("crossprod", signature(x = "dsparseMatrix", y = "ddenseMatrix"),
11            function(x, y = NULL) callGeneric(x, as(y, "dgeMatrix")))            function(x, y = NULL) callGeneric(x, as(y, "dgeMatrix")))
# Line 17  Line 17 
17            function(x, nrow, ncol = n) diag(as(x, "dgCMatrix")))            function(x, nrow, ncol = n) diag(as(x, "dgCMatrix")))
18    
19  ## and coerce dsparse* to dgC*  ## and coerce dsparse* to dgC*
20  setMethod("%*%", signature(x = "dsparseMatrix", y = "dgeMatrix"),  ## setMethod("%*%", signature(x = "dsparseMatrix", y = "dgeMatrix"),
21            function(x, y) callGeneric(as(x, "dgCMatrix"), y))  ##           function(x, y) callGeneric(as(x, "dgCMatrix"), y))
22    
23  setMethod("%*%", signature(x = "dgeMatrix", y = "dsparseMatrix"),  ## setMethod("%*%", signature(x = "dgeMatrix", y = "dsparseMatrix"),
24            function(x, y) callGeneric(x, as(y, "dgCMatrix")))  ##           function(x, y) callGeneric(x, as(y, "dgCMatrix")))
25    
26  setMethod("crossprod", signature(x = "dsparseMatrix", y = "dgeMatrix"),  setMethod("crossprod", signature(x = "dsparseMatrix", y = "dgeMatrix"),
27            function(x, y = NULL) callGeneric(as(x, "dgCMatrix"), y))            function(x, y = NULL) callGeneric(as(x, "dgCMatrix"), y))

Legend:
Removed from v.1331  
changed lines
  Added in v.1460

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