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 1714, Thu Dec 28 22:11:32 2006 UTC revision 1945, Wed Jul 4 18:07:07 2007 UTC
# Line 4  Line 4 
4  ## >> but << needs all sub(sub(sub)) classes of "ddenseMatrix" listed  ## >> but << needs all sub(sub(sub)) classes of "ddenseMatrix" listed
5  ##   -----  in  ../src/Mutils.c  ##   -----  in  ../src/Mutils.c
6    
 ## Should this method return 'from' without duplication when it has  
 ## class dgeMatrix?  
7  setAs("ddenseMatrix", "dgeMatrix",  setAs("ddenseMatrix", "dgeMatrix",
8        function(from) {        function(from) {
9            if (class(from) != "dgeMatrix")            if (class(from) != "dgeMatrix")
10                from <- .Call(dup_mMatrix_as_dgeMatrix, from)                .Call(dup_mMatrix_as_dgeMatrix, from)
11            from            else from
12        })        })
13    
14  ## d(ouble) to l(ogical):  ## d(ouble) to l(ogical):
15  setAs("dgeMatrix", "lgeMatrix", d2l_Matrix)  setAs("dgeMatrix", "lgeMatrix", function(from) d2l_Matrix(from, "dgeMatrix"))
16  setAs("dtrMatrix", "ltrMatrix", d2l_Matrix)  setAs("dsyMatrix", "lsyMatrix", function(from) d2l_Matrix(from, "dsyMatrix"))
17  setAs("dtpMatrix", "ltpMatrix", d2l_Matrix)  setAs("dspMatrix", "lspMatrix", function(from) d2l_Matrix(from, "dspMatrix"))
18  setAs("dsyMatrix", "lsyMatrix", d2l_Matrix)  setAs("dtrMatrix", "ltrMatrix", function(from) d2l_Matrix(from, "dtrMatrix"))
19  setAs("dspMatrix", "lspMatrix", d2l_Matrix)  setAs("dtpMatrix", "ltpMatrix", function(from) d2l_Matrix(from, "dtpMatrix"))
20    
21  setAs("ddenseMatrix", "CsparseMatrix",  setAs("ddenseMatrix", "CsparseMatrix",
22        function(from) {        function(from) {
23            if (class(from) != "dgeMatrix")            if (class(from) != "dgeMatrix") # don't lose symmetry/triangularity/...
24                from <- .Call(dup_mMatrix_as_dgeMatrix, from)                as_Csparse(from)
25            .Call(dense_to_Csparse, from)            else .Call(dense_to_Csparse, from)
26        })        })
27    
28  ## special case  ## special case
# Line 84  Line 82 
82            function(x, y = NULL) callGeneric(as(x, "dgeMatrix")))            function(x, y = NULL) callGeneric(as(x, "dgeMatrix")))
83    
84  setMethod("diag", signature(x = "ddenseMatrix"),  setMethod("diag", signature(x = "ddenseMatrix"),
85            function(x = 1, nrow, ncol = n) callGeneric(as(x, "dgeMatrix")))            function(x, nrow, ncol = n) callGeneric(as(x, "dgeMatrix")))
86    
87  ## These methods cause an infinite loop in pre-2.4.0  setMethod("solve", signature(a = "ddenseMatrix", b = "missing"),
88  ## setMethod("solve", signature(a = "ddenseMatrix", b = "missing"),            function(a, b, ...) callGeneric(as(a, "dgeMatrix")))
 ##           function(a, b, ...) callGeneric(as(a, "dgeMatrix")))  
89    
90  ## setMethod("solve", signature(a = "ddenseMatrix", b = "ANY"),  setMethod("solve", signature(a = "ddenseMatrix", b = "ANY"),
91  ##           function(a, b, ...) callGeneric(as(a, "dgeMatrix"), b))            function(a, b, ...) callGeneric(as(a, "dgeMatrix"), b))
92    
93  ## General method for dense matrix multiplication in case specific methods  ## General method for dense matrix multiplication in case specific methods
94  ## have not been defined.  ## have not been defined.

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

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