SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/R/diagMatrix.R
ViewVC logotype

Diff of /pkg/Matrix/R/diagMatrix.R

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

revision 1655, Mon Oct 30 17:16:27 2006 UTC revision 1682, Fri Dec 1 18:42:40 2006 UTC
# Line 360  Line 360 
360    
361    
362  ## FIXME?: In theory, this can be done *FASTER*, in some cases, via tapply1()  ## FIXME?: In theory, this can be done *FASTER*, in some cases, via tapply1()
   
363  setMethod("%*%", signature(x = "diagonalMatrix", y = "sparseMatrix"),  setMethod("%*%", signature(x = "diagonalMatrix", y = "sparseMatrix"),
364            function(x, y) as(x, "sparseMatrix") %*% y)            function(x, y) as(x, "sparseMatrix") %*% y)
365    ## NB: The previous is *not* triggering for  "ddi" o "dgC" (= distance 3)
366    ##     since there's a "ddense" o "Csparse" at dist. 2 => triggers first.
367    ## ==> do this:
368    setMethod("%*%", signature(x = "diagonalMatrix", y = "CsparseMatrix"),
369              function(x, y) as(x, "CsparseMatrix") %*% y)
370    ## NB: this is *not* needed for Tsparse & Rsparse
371    ## TODO: Write tests in ./tests/ which ensure that many "ops" with diagonal*
372    ##       do indeed work by going throug sparse (and *not* ddense)!
373    
374  setMethod("%*%", signature(x = "sparseMatrix", y = "diagonalMatrix"),  setMethod("%*%", signature(x = "sparseMatrix", y = "diagonalMatrix"),
375            function(x, y) x %*% as(y, "sparseMatrix"))            function(x, y) x %*% as(y, "sparseMatrix"))

Legend:
Removed from v.1655  
changed lines
  Added in v.1682

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