SCM

SCM Repository

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

Diff of /pkg/R/Ops.R

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

revision 2119, Tue Mar 4 21:44:04 2008 UTC revision 2120, Tue Mar 4 21:44:41 2008 UTC
# Line 748  Line 748 
748                if(length(e2) == 1) { ## e.g.,  Mat ^ a                if(length(e2) == 1) { ## e.g.,  Mat ^ a
749                    f0 <- callGeneric(0, e2)                    f0 <- callGeneric(0, e2)
750                    if(is0(f0)) { # remain sparse, symm., tri.,...                    if(is0(f0)) { # remain sparse, symm., tri.,...
751                        e1 <- as(e1, "dMatrix")                        e1 <- diagU2N(as(e1, "dMatrix"))
752                        e1@x <- callGeneric(e1@x, e2)                        e1@x <- callGeneric(e1@x, e2)
753                        return(e1)                        return(e1)
754                    }                    }
# Line 763  Line 763 
763                if(length(e1) == 1) {                if(length(e1) == 1) {
764                    f0 <- callGeneric(e1, 0)                    f0 <- callGeneric(e1, 0)
765                    if(is0(f0)) {                    if(is0(f0)) {
766                        e2 <- as(e2, "dMatrix")                        e2 <- diagU2N(as(e2, "dMatrix"))
767                        e2@x <- callGeneric(e1, e2@x)                        e2@x <- callGeneric(e1, e2@x)
768                        return(e2)                        return(e2)
769                    }                    }
# Line 875  Line 875 
875    
876  ## "Arith" short cuts / exceptions  ## "Arith" short cuts / exceptions
877  setMethod("-", signature(e1 = "sparseMatrix", e2 = "missing"),  setMethod("-", signature(e1 = "sparseMatrix", e2 = "missing"),
878            function(e1) { e1@x <- -e1@x ; e1 })            function(e1, e2) { e1 <- diagU2N(e1); e1@x <- -e1@x; e1 })
879  ## with the following exceptions:  ## with the following exceptions:
880  setMethod("-", signature(e1 = "nsparseMatrix", e2 = "missing"),  setMethod("-", signature(e1 = "nsparseMatrix", e2 = "missing"),
881            function(e1) callGeneric(as(as(e1, "dMatrix"), "dgCMatrix")))            function(e1,e2) callGeneric(as(as(e1, "dMatrix"), "dgCMatrix")))
882  setMethod("-", signature(e1 = "pMatrix", e2 = "missing"),  setMethod("-", signature(e1 = "pMatrix", e2 = "missing"),
883            function(e1) callGeneric(as(e1, "ngTMatrix")))            function(e1,e2) callGeneric(as(e1, "ngTMatrix")))
884    
885  ## Group method  "Arith"  ## Group method  "Arith"
886    

Legend:
Removed from v.2119  
changed lines
  Added in v.2120

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge