SCM

SCM Repository

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

Diff of /pkg/R/denseMatrix.R

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

revision 1330, Fri Jul 21 08:28:18 2006 UTC revision 1331, Sat Jul 22 17:59:53 2006 UTC
# Line 10  Line 10 
10    
11  setAs("denseMatrix", "CsparseMatrix",  setAs("denseMatrix", "CsparseMatrix",
12        function(from) {        function(from) {
13            if(!is(from, "generalMatrix")) { ## e.g. for triangular | symmetric            cl <- class(from)
14              notGen <- !is(from, "generalMatrix")
15              if (notGen) { ## e.g. for triangular | symmetric
16                ## FIXME: this is a *waste* in the case of packed matrices!                ## FIXME: this is a *waste* in the case of packed matrices!
17                if     (is(from, "dMatrix")) from <- as(from, "dgeMatrix")                if     (extends(cl, "dMatrix")) from <- as(from, "dgeMatrix")
18                else if(is(from, "lMatrix")) from <- as(from, "lgeMatrix")                else if(extends(cl, "lMatrix")) from <- as(from, "lgeMatrix")
19                else if(is(from, "zMatrix")) from <- as(from, "zgeMatrix")                else if(extends(cl, "zMatrix")) from <- as(from, "zgeMatrix")
20                else stop("undefined method for class ", class(from))                else stop("undefined method for class ", cl)
21            }            }
22            .Call(dense_to_Csparse, from)            .Call(dense_to_Csparse, from)
23        })        })

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

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