SCM

SCM Repository

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

Diff of /pkg/R/dspMatrix.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 28  Line 28 
28            .Call(dspMatrix_rcond, x, "O"),            .Call(dspMatrix_rcond, x, "O"),
29            valueClass = "numeric")            valueClass = "numeric")
30    
31  setMethod("%*%", signature(x = "dspMatrix", y = "dgeMatrix"),  setMethod("%*%", signature(x = "dspMatrix", y = "ddenseMatrix"),
32            function(x, y)            function(x, y) .Call(dspMatrix_matrix_mm, x, y),
           .Call(dspMatrix_matrix_mm, x, y, TRUE),  
33            valueClass = "dgeMatrix")            valueClass = "dgeMatrix")
34    
35  setMethod("%*%", signature(x = "dspMatrix", y = "matrix"),  setMethod("%*%", signature(x = "dspMatrix", y = "matrix"),
36            function(x, y)            function(x, y) .Call(dspMatrix_matrix_mm, x, y),
           .Call(dspMatrix_matrix_mm, x, y, FALSE),  
37            valueClass = "dgeMatrix")            valueClass = "dgeMatrix")
38    
39  ##setMethod("%*%", signature(x = "dspMatrix", y = "numeric"),  ## Should define multiplication from the right
 ##          function(x, y)  
 ##          .Call(dspMatrix_matrix_mm, x, as.matrix(y), FALSE),  
 ##          valueClass = "dgeMatrix")  
   
 setMethod("%*%", signature(x = "dspMatrix", y = "integer"),  
           function(x, y) {  
               storage.mode(y) <- "double"  
               .Call(dspMatrix_matrix_mm, x, as.matrix(y), FALSE)  
           }, valueClass = "dgeMatrix")  
40    
41  setMethod("solve", signature(a = "dspMatrix", b = "missing"),  setMethod("solve", signature(a = "dspMatrix", b = "missing"),
42            function(a, b, ...) .Call(dspMatrix_solve, a),            function(a, b, ...) .Call(dspMatrix_solve, a),
43            valueClass = "dspMatrix")            valueClass = "dspMatrix")
44    
45  setMethod("solve", signature(a = "dspMatrix", b = "matrix"),  setMethod("solve", signature(a = "dspMatrix", b = "matrix"),
46            function(a, b, ...)            function(a, b, ...) .Call(dspMatrix_matrix_solve, a, b),
           .Call(dspMatrix_matrix_solve, a, b),  
47            valueClass = "dgeMatrix")            valueClass = "dgeMatrix")
48    
49  setMethod("solve", signature(a = "dspMatrix", b = "dgeMatrix"),  setMethod("solve", signature(a = "dspMatrix", b = "ddenseMatrix"),
50            function(a, b, ...)            function(a, b, ...) .Call(dspMatrix_matrix_solve, a, b),
           .Call(dspMatrix_matrix_solve, a, as(b,"matrix")),  
51            valueClass = "dgeMatrix")            valueClass = "dgeMatrix")
52    
53  ##setMethod("solve", signature(a = "dspMatrix", b = "numeric"),  ##setMethod("solve", signature(a = "dspMatrix", b = "numeric"),
# Line 68  Line 55 
55  ##        .Call(dspMatrix_matrix_solve, a, as.matrix(b)),  ##        .Call(dspMatrix_matrix_solve, a, as.matrix(b)),
56  ##        valueClass = "dgeMatrix")  ##        valueClass = "dgeMatrix")
57    
58  setMethod("solve", signature(a = "dspMatrix", b = "integer"),  ## No longer needed
59            function(a, b, ...) {  ## setMethod("solve", signature(a = "dspMatrix", b = "integer"),
60                storage.mode(b) <- "double"  ##        function(a, b, ...) {
61                .Call(dspMatrix_matrix_solve, a, as.matrix(b))  ##            storage.mode(b) <- "double"
62            }, valueClass = "dgeMatrix")  ##            .Call(dspMatrix_matrix_solve, a, as.matrix(b))
63    ##        }, valueClass = "dgeMatrix")
64    
65  setMethod("norm", signature(x = "dspMatrix", type = "character"),  setMethod("norm", signature(x = "dspMatrix", type = "character"),
66            function(x, type, ...) .Call(dspMatrix_norm, x, type),            function(x, type, ...) .Call(dspMatrix_norm, x, type),

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