SCM

SCM Repository

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

Diff of /pkg/R/sparseMatrix.R

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

revision 1713, Thu Dec 28 22:11:08 2006 UTC revision 1714, Thu Dec 28 22:11:32 2006 UTC
# Line 187  Line 187 
187  ## FIXME: also for RsparseMatrix  ## FIXME: also for RsparseMatrix
188    
189    
190    ## Group Methods
191    
192    ##-> see ./Ops.R
193    
194    
 ## "Arith" short cuts / exceptions  
 setMethod("-", signature(e1 = "sparseMatrix", e2 = "missing"),  
           function(e1) { e1@x <- -e1@x ; e1 })  
 ## with the following exceptions:  
 setMethod("-", signature(e1 = "nsparseMatrix", e2 = "missing"),  
           function(e1) callGeneric(as(e1, "dgCMatrix")))  
 setMethod("-", signature(e1 = "pMatrix", e2 = "missing"),  
           function(e1) callGeneric(as(e1, "ngTMatrix")))  
   
 ## Group method  "Arith"  
   
 ## have CsparseMatrix methods (-> ./Csparse.R )  
 ## which may preserve "symmetric", "triangular" -- simply defer to those:  
   
 setMethod("Arith", ##  "+", "-", "*", "^", "%%", "%/%", "/"  
           signature(e1 = "sparseMatrix", e2 = "sparseMatrix"),  
           function(e1, e2) callGeneric(as(e1, "CsparseMatrix"),  
                                        as(e2, "CsparseMatrix")))  
 setMethod("Arith",  
           signature(e1 = "sparseMatrix", e2 = "numeric"),  
           function(e1, e2) callGeneric(as(e1, "CsparseMatrix"), e2))  
 setMethod("Arith",  
           signature(e1 = "numeric", e2 = "sparseMatrix"),  
           function(e1, e2) callGeneric(e1, as(e2, "CsparseMatrix")))  
   
 setMethod("Math",  
           signature(x = "sparseMatrix"),  
           function(x) callGeneric(as(x, "CsparseMatrix")))  
   
 setMethod("Compare", signature(e1 = "sparseMatrix", e2 = "sparseMatrix"),  
           function(e1, e2) callGeneric(as(e1, "CsparseMatrix"),  
                                        as(e2, "CsparseMatrix")))  
 ##-> ./Csparse.R  
195    
196  ### --- show() method ---  ### --- show() method ---
197    

Legend:
Removed from v.1713  
changed lines
  Added in v.1714

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