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 1673, Mon Nov 6 20:54:26 2006 UTC revision 1705, Sat Dec 16 12:37:25 2006 UTC
# Line 56  Line 56 
56    
57  setMethod("dim", signature(x = "Matrix"),  setMethod("dim", signature(x = "Matrix"),
58            function(x) x@Dim, valueClass = "integer")            function(x) x@Dim, valueClass = "integer")
59    
60  setMethod("dimnames", signature(x = "Matrix"), function(x) x@Dimnames)  setMethod("dimnames", signature(x = "Matrix"), function(x) x@Dimnames)
61    
62    
63  ## not exported but used more than once for "dimnames<-" method :  ## not exported but used more than once for "dimnames<-" method :
64  ## -- or do only once for all "Matrix" classes ??  ## -- or do only once for all "Matrix" classes ??
65  dimnamesGets <- function (x, value) {  dimnamesGets <- function (x, value) {
# Line 75  Line 78 
78  setMethod("unname", signature("Matrix", force="missing"),  setMethod("unname", signature("Matrix", force="missing"),
79            function(obj) { obj@Dimnames <- list(NULL,NULL); obj})            function(obj) { obj@Dimnames <- list(NULL,NULL); obj})
80    
81    setMethod("all", signature(x = "Matrix"),
82              function(x, ..., na.rm) { x <- as(x, "lMatrix"); callNextMethod()})
83    setMethod("any", signature(x = "Matrix"),
84              function(x, ..., na.rm) { x <- as(x, "lMatrix"); callNextMethod()})
85    
86    
87    
88  Matrix <-  Matrix <-
89      function (data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL,      function (data = NA, nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL,
90                sparse = NULL, forceCheck = FALSE)                sparse = NULL, forceCheck = FALSE)
# Line 396  Line 406 
406    
407  setReplaceMethod("[", signature(x = "Matrix", i = "ANY", j = "ANY",  setReplaceMethod("[", signature(x = "Matrix", i = "ANY", j = "ANY",
408                                  value = "Matrix"),                                  value = "Matrix"),
409                     function (x, i, j, value) {
410    ### FIXME: *TEMPORARY* diagnostic output:
411                         cat("<Matrix1>[i,j] <- <Matrix1>:\n<Matrix1> = x :")
412                         str(x)
413                         cat("<Matrix2> = value :")
414                         str(value)
415                         cat("i :"); if(!missing(i)) str(i) else cat("<missing>\n")
416                         cat("j :"); if(!missing(j)) str(j) else cat("<missing>\n")
417    
418                         callGeneric(x=x, i=i, j=j, value = as.vector(value))
419                     })
420    setReplaceMethod("[", signature(x = "Matrix", i = "ANY", j = "ANY",
421                                    value = "Matrix"),
422                   function (x, i, j, value)                   function (x, i, j, value)
423                   callGeneric(x=x, i=i, j=j, value = as.vector(value)))                   callGeneric(x=x, i=i, j=j, value = as.vector(value)))
424    
425  setReplaceMethod("[", signature(x = "Matrix", i = "ANY", j = "ANY",  setReplaceMethod("[", signature(x = "Matrix", i = "ANY", j = "ANY",
426                                  value = "matrix"),                                  value = "matrix"),
427                   function (x, i, j, value)                   function (x, i, j, value)

Legend:
Removed from v.1673  
changed lines
  Added in v.1705

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