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 2245, Mon Aug 25 15:06:12 2008 UTC revision 2255, Sat Aug 30 07:20:33 2008 UTC
# Line 365  Line 365 
365  ## not just base::as.vector but the generic with our methods:  ## not just base::as.vector but the generic with our methods:
366  all.equal_num <- base::all.equal.numeric ## from <R>/src/library/base/R/all.equal.R  all.equal_num <- base::all.equal.numeric ## from <R>/src/library/base/R/all.equal.R
367  environment(all.equal_num) <- environment()## == as.environment("Matrix")  environment(all.equal_num) <- environment()## == as.environment("Matrix")
368  all.equal_num_2 <- function(target,current, ...)  
369      all.equal_num(as.vector(target), as.vector(current), ...)  all.equal_Mat <- function(target, current, check.attributes = TRUE, ...)
370    {
371        msg <- attr.all_Mat(target, current, check.attributes=check.attributes, ...)
372        if(is.list(msg)) return(msg[[1]])
373        ## else
374        r <- all.equal_num(as.vector(target), as.vector(current),
375                           check.attributes=check.attributes, ...)
376        if(is.null(msg) && (r.ok <- isTRUE(r))) TRUE else c(msg, if(!r.ok) r)
377    }
378  ## The all.equal() methods for dense matrices (and fallback):  ## The all.equal() methods for dense matrices (and fallback):
379  setMethod("all.equal", c(target = "Matrix", current = "Matrix"),  setMethod("all.equal", c(target = "Matrix", current = "Matrix"),
380            all.equal_num_2)            all.equal_Mat)
381  setMethod("all.equal", c(target = "Matrix", current = "ANY"),  setMethod("all.equal", c(target = "Matrix", current = "ANY"),
382            all.equal_num_2)            all.equal_Mat)
383  setMethod("all.equal", c(target = "ANY", current = "Matrix"),  setMethod("all.equal", c(target = "ANY", current = "Matrix"),
384            all.equal_num_2)            all.equal_Mat)
385  ## -> ./sparseMatrix.R, ./sparseVector.R  have specific methods  ## -> ./sparseMatrix.R, ./sparseVector.R  have specific methods
386    
387    

Legend:
Removed from v.2245  
changed lines
  Added in v.2255

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