SCM

SCM Repository

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

Diff of /pkg/R/ldenseMatrix.R

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

revision 953, Wed Sep 28 19:31:36 2005 UTC revision 954, Wed Sep 28 19:34:31 2005 UTC
# Line 47  Line 47 
47            function(x) as(callGeneric(as(x, "ltrMatrix")), "ltpMatrix"))            function(x) as(callGeneric(as(x, "ltrMatrix")), "ltpMatrix"))
48  setMethod("t", signature(x = "lspMatrix"),  setMethod("t", signature(x = "lspMatrix"),
49            function(x) as(callGeneric(as(x, "lsyMatrix")), "lspMatrix"))            function(x) as(callGeneric(as(x, "lsyMatrix")), "lspMatrix"))
50    
51    setMethod("!", "ltrMatrix",
52              function(e1) {
53                  e1@x <- !e1@x
54                  ## And now we must fill in the '!FALSE' results :
55    
56                  ## FIXME: the following should be .Call using
57                  ##        a variation of make_array_triangular:
58                  r <- as(e1, "lgeMatrix")
59                  n <- e1@Dim[1]
60                  coli <- rep(1:n, each=n)
61                  rowi <- rep(1:n, n)
62                  Udiag <- e1@diag == "U"
63                  log.i <-
64                      if(e1@uplo == "U") {
65                          if(Udiag) rowi >= coli else rowi > coli
66                      } else {
67                          if(Udiag) rowi <= coli else rowi < coli
68                      }
69                  r[log.i] <- TRUE
70                  r
71              })
72    
73    setMethod("!", "ltpMatrix", function(e1) !as(x, "ltrMatrix"))
74    
75    ## for the other ldense* ones:
76    setMethod("!", "ldenseMatrix",
77              function(e1) { e1@x <- !e1@x ; e1 })

Legend:
Removed from v.953  
changed lines
  Added in v.954

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