SCM

SCM Repository

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

Diff of /pkg/R/Matrix.R

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

revision 2036, Mon Aug 6 12:03:47 2007 UTC revision 2039, Mon Aug 6 18:49:27 2007 UTC
# Line 224  Line 224 
224            function(x, y = NULL)  callGeneric(as.matrix(x), y))            function(x, y = NULL)  callGeneric(as.matrix(x), y))
225    
226  setMethod("crossprod", signature(x = "Matrix", y = "matrix"),  setMethod("crossprod", signature(x = "Matrix", y = "matrix"),
227            function(x, y) callGeneric(x, Matrix(y)))            function(x, y = NULL) callGeneric(x, Matrix(y)))
228  setMethod("crossprod", signature(x = "matrix", y = "Matrix"),  setMethod("crossprod", signature(x = "matrix", y = "Matrix"),
229            function(x, y) callGeneric(Matrix(x), y))            function(x, y = NULL) callGeneric(Matrix(x), y))
230    
231  ## The as.matrix() promotion seems illogical to MM,  ## The as.matrix() promotion seems illogical to MM,
232  ## but is according to help(tcrossprod, package = "base") :  ## but is according to help(tcrossprod, package = "base") :
# Line 235  Line 235 
235  setMethod("tcrossprod", signature(x = "numeric", y = "Matrix"),  setMethod("tcrossprod", signature(x = "numeric", y = "Matrix"),
236            function(x, y = NULL)  callGeneric(as.matrix(x), y))            function(x, y = NULL)  callGeneric(as.matrix(x), y))
237  setMethod("tcrossprod", signature(x = "Matrix", y = "matrix"),  setMethod("tcrossprod", signature(x = "Matrix", y = "matrix"),
238            function(x, y) callGeneric(x, Matrix(y)))            function(x, y = NULL) callGeneric(x, Matrix(y)))
239  setMethod("tcrossprod", signature(x = "matrix", y = "Matrix"),  setMethod("tcrossprod", signature(x = "matrix", y = "Matrix"),
240            function(x, y) callGeneric(Matrix(x), y))            function(x, y = NULL) callGeneric(Matrix(x), y))
241    
242  ## maybe not optimal  ## maybe not optimal
243  setMethod("solve", signature(a = "Matrix", b = "missing"),  setMethod("solve", signature(a = "Matrix", b = "missing"),
# Line 251  Line 251 
251            function(a, b, ...) callGeneric(Matrix(a), b))            function(a, b, ...) callGeneric(Matrix(a), b))
252    
253  ## when no sub-class method is found, bail out  ## when no sub-class method is found, bail out
 setMethod("solve", signature(a = "Matrix", b = "matrix"),  
           function(a, b, ...) .bail.out.2("solve", class(a), "matrix"))  
254  setMethod("solve", signature(a = "Matrix", b = "Matrix"),  setMethod("solve", signature(a = "Matrix", b = "Matrix"),
255            function(a, b, ...) .bail.out.2("solve", class(a), class(b)))            function(a, b, ...) .bail.out.2("solve", class(a), class(b)))
 setMethod("solve", signature(a = "Matrix", b = "matrix"),  
           function(a, b, ...) .bail.out.2("solve", class(a), class(b)))  
 setMethod("solve", signature(a = "matrix", b = "Matrix"),  
           function(a, b, ...) .bail.out.2("solve", class(a), class(b)))  
256    
257  ## bail-out methods in order to get better error messages  ## bail-out methods in order to get better error messages
258  setMethod("%*%", signature(x = "Matrix", y = "Matrix"),  setMethod("%*%", signature(x = "Matrix", y = "Matrix"),

Legend:
Removed from v.2036  
changed lines
  Added in v.2039

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