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 608, Fri Mar 4 17:33:29 2005 UTC revision 609, Fri Mar 4 17:34:03 2005 UTC
# Line 9  Line 9 
9  setAs("dtpMatrix", "matrix",  setAs("dtpMatrix", "matrix",
10        function(from) as(as(from, "dtrMatrix"), "matrix"))        function(from) as(as(from, "dtrMatrix"), "matrix"))
11    
12    
13  setMethod("%*%", signature(x = "dtpMatrix", y = "dgeMatrix"),  setMethod("%*%", signature(x = "dtpMatrix", y = "dgeMatrix"),
14            function(x, y) .Call("dtpMatrix_dgeMatrix_mm", x, y))            function(x, y) .Call("dtpMatrix_dgeMatrix_mm", x, y))
15    setMethod("%*%", signature(x = "dgeMatrix", y = "dtpMatrix"),
16              function(x, y) callGeneric(x, as(y, "dgeMatrix")))
17    
18  setMethod("%*%", signature(x = "dtpMatrix", y = "matrix"),  setMethod("%*%", signature(x = "dtpMatrix", y = "matrix"),
19            function(x, y) .Call("dtpMatrix_matrix_mm", x, y))            function(x, y) .Call("dtpMatrix_matrix_mm", x, y))
20    ## extending to vector RHS
21    setMethod("%*%", signature(x = "dtpMatrix", y = "numeric"),
22              function(x, y) callGeneric(x, as.matrix(y)))
23    ## the other way around
24    setMethod("%*%", signature(x = "numeric", y = "dtpMatrix"),
25              function(x, y) callGeneric(as(as.matrix(x), "dgeMatrix"), y))
26    
27  setMethod("determinant", signature(x = "dtpMatrix", logarithm = "missing"),  setMethod("determinant", signature(x = "dtpMatrix", logarithm = "missing"),
28            function(x, logarithm, ...) determinant(x, TRUE))            function(x, logarithm, ...) determinant(x, TRUE))
29    
30  setMethod("diag", signature(x = "dtpMatrix"),  setMethod("diag", signature(x = "dtpMatrix"),
31            function(x = 1, nrow, ncol = n)            function(x = 1, nrow, ncol = n) .Call("dtpMatrix_getDiag", x),
           .Call("dtpMatrix_getDiag", x),  
32            valueClass = "numeric")            valueClass = "numeric")
33    
34  setMethod("determinant", signature(x = "dtpMatrix", logarithm = "logical"),  setMethod("determinant", signature(x = "dtpMatrix", logarithm = "logical"),

Legend:
Removed from v.608  
changed lines
  Added in v.609

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