SCM

SCM Repository

[matrix] Annotation of /pkg/R/lsparseMatrix.R
ViewVC logotype

Annotation of /pkg/R/lsparseMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 954 - (view) (download)

1 : maechler 892 #### Superclass Methods for all sparse logical matrices
2 :    
3 :     ###------- Work via as(*, lgC) : ------------
4 :    
5 : maechler 925 ## For multiplication operations, sparseMatrix overrides other method
6 :     ## selections. Coerce a ddensematrix argument to a lsparseMatrix.
7 : maechler 892
8 : maechler 925 setMethod("%*%", signature(x = "lsparseMatrix", y = "ldenseMatrix"),
9 :     function(x, y) callGeneric(x, as(y, "lsparseMatrix")))
10 : maechler 892
11 : maechler 925 setMethod("%*%", signature(x = "ldenseMatrix", y = "lsparseMatrix"),
12 :     function(x, y) callGeneric(as(x, "lsparseMatrix"), y))
13 : maechler 892
14 : maechler 925 setMethod("crossprod", signature(x = "lsparseMatrix", y = "ldenseMatrix"),
15 :     function(x, y = NULL) callGeneric(x, as(y, "lsparseMatrix")))
16 :    
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 :    
28 : maechler 954 setMethod("!", "lsparseMatrix",
29 :     ## turns FALSE to TRUE --> dense matrix
30 :     function(e1) !as(e1, "lgeMatrix"))
31 :    

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