SCM

SCM Repository

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

Diff of /pkg/R/dtpMatrix.R

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

revision 1462, Tue Aug 29 16:34:49 2006 UTC revision 1463, Tue Aug 29 22:30:57 2006 UTC
# Line 23  Line 23 
23        function(from) as(as(from, "dtrMatrix"), "dtpMatrix"))        function(from) as(as(from, "dtrMatrix"), "dtpMatrix"))
24    
25    
26  setMethod("%*%", signature(x = "dtpMatrix", y = "dgeMatrix"),  setMethod("%*%", signature(x = "dtpMatrix", y = "ddenseMatrix"),
27            function(x, y) .Call(dtpMatrix_dgeMatrix_mm, x, y))            function(x, y) .Call(dtpMatrix_matrix_mm, x, y))
28  setMethod("%*%", signature(x = "dgeMatrix", y = "dtpMatrix"),  setMethod("%*%", signature(x = "dgeMatrix", y = "dtpMatrix"),
29            function(x, y) .Call(dgeMatrix_dtpMatrix_mm, x, y))            function(x, y) .Call(dgeMatrix_dtpMatrix_mm, x, y))
30    ## DB: I don't think this is needed any more
31  ## %*% should always work for  <fooMatrix> %*% <fooMatrix>  ## %*% should always work for  <fooMatrix> %*% <fooMatrix>
32  setMethod("%*%", signature(x = "dtpMatrix", y = "dtpMatrix"),  ## setMethod("%*%", signature(x = "dtpMatrix", y = "dtpMatrix"),
33            function(x, y)  ##           function(x, y)
34            ## FIXME: this is cheap; could we optimize chosing the better of  ##           ## FIXME: this is cheap; could we optimize chosing the better of
35            ## callGeneric(x, as(y, "dgeMatrix"))  and  ##           ## callGeneric(x, as(y, "dgeMatrix"))  and
36            ## callGeneric(as(x "dgeMatrix"), y))  depending on their 'uplo' ?  ##           ## callGeneric(as(x "dgeMatrix"), y))  depending on their 'uplo' ?
37            callGeneric(x, as(y, "dgeMatrix")))  ##           callGeneric(x, as(y, "dgeMatrix")))
38    
39  ## dtpMatrix <-> matrix : will be used by the "numeric" one  ## dtpMatrix <-> matrix : will be used by the "numeric" one
40  setMethod("%*%", signature(x = "dtpMatrix", y = "matrix"),  setMethod("%*%", signature(x = "dtpMatrix", y = "matrix"),
41            function(x, y) callGeneric(x, as(y, "dgeMatrix")))            function(x, y) .Call(dtpMatrix_matrix_mm, x, y))
42  setMethod("%*%", signature(x = "matrix", y = "dtpMatrix"),  setMethod("%*%", signature(x = "matrix", y = "dtpMatrix"),
43            function(x, y) callGeneric(as(x, "dgeMatrix"), y))            function(x, y) callGeneric(as(x, "dgeMatrix"), y))
44    
# Line 91  Line 92 
92            valueClass = "numeric")            valueClass = "numeric")
93    
94  setMethod("solve", signature(a = "dtpMatrix", b="missing"),  setMethod("solve", signature(a = "dtpMatrix", b="missing"),
95            function(a, b, ...)            function(a, b, ...) .Call(dtpMatrix_solve, a),
           .Call(dtpMatrix_solve, a),  
96            valueClass = "dtpMatrix")            valueClass = "dtpMatrix")
97    
98    setMethod("solve", signature(a = "dtpMatrix", b="ddenseMatrix"),
99              function(a, b, ...) .Call(dtpMatrix_matrix_solve, a, b),
100              valueClass = "dgeMatrix")
101    
102  setMethod("solve", signature(a = "dtpMatrix", b="matrix"),  setMethod("solve", signature(a = "dtpMatrix", b="matrix"),
103            function(a, b, ...)            function(a, b, ...) .Call(dtpMatrix_matrix_solve, a, b),
104            .Call(dtpMatrix_matrix_solve, a, b),            valueClass = "dgeMatrix")
           valueClass = "matrix")  
105    
106  setMethod("t", signature(x = "dtpMatrix"),  setMethod("t", signature(x = "dtpMatrix"),
107            function(x) as(t(as(x, "dtrMatrix")), "dtpMatrix"),            function(x) as(t(as(x, "dtrMatrix")), "dtpMatrix"),

Legend:
Removed from v.1462  
changed lines
  Added in v.1463

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