SCM

SCM Repository

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

Diff of /pkg/Matrix/R/ddenseMatrix.R

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

revision 1617, Fri Oct 6 15:42:12 2006 UTC revision 1618, Fri Oct 6 15:44:01 2006 UTC
# Line 32  Line 32 
32        function(from) .Call(dense_to_Csparse, from))        function(from) .Call(dense_to_Csparse, from))
33    
34  setAs("matrix", "CsparseMatrix",  setAs("matrix", "CsparseMatrix",
35        function(from)        function(from) {
36        .Call(dense_to_Csparse, .Call(dup_mMatrix_as_dgeMatrix, from)))              if(is.numeric(from))
37                    .Call(dense_to_Csparse, .Call(dup_mMatrix_as_dgeMatrix, from))
38                else if(is.logical(from)) ## FIXME: this works, but maybe wastefully
39                    as(Matrix(from, sparse=TRUE), "CsparseMatrix")
40                else stop('not-yet-implemented coercion to "CsparseMatrix"')
41          })
42    
43    
44  ## special case needed in the Matrix function  ## special case needed in the Matrix function
45  setAs("matrix", "dgCMatrix",  setAs("matrix", "dgCMatrix",

Legend:
Removed from v.1617  
changed lines
  Added in v.1618

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