SCM

SCM Repository

[matrix] View of /pkg/R/lsTMatrix.R
ViewVC logotype

View of /pkg/R/lsTMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1665 - (download) (annotate)
Fri Nov 3 23:18:07 2006 UTC (13 years, 2 months ago) by maechler
File size: 898 byte(s)
fully-sparse solve() for dsC; indexing & comparison fixes
#### Logical Sparse Symmetric Matrices in Triplet format

### contains = "lsparseMatrix"

setAs("lsTMatrix", "matrix",
      function(from) as(as(from, "lgTMatrix"), "matrix"))

setAs("lsTMatrix", "lsCMatrix",
      function(from) .Call(Tsparse_to_Csparse, from, FALSE))

setAs("lsTMatrix", "lgTMatrix",
      function(from) new("lgTMatrix", i = from@i, j = from@j, x = from@x,
                         Dim = from@Dim, Dimnames = from@Dimnames))

setAs("lsTMatrix", "dsTMatrix",
      function(from) new("dsTMatrix", i = from@i, j = from@j,
                         x = rep.int(1, length(from@i)), uplo = from@uplo,
                         diag = from@diag,
                         Dim = from@Dim, Dimnames = from@Dimnames))

## untested:
setMethod("image", "lsTMatrix",
          function(x, ...) {
              x <- as(as(x, "dsTMatrix"), "dgTMatrix")
              callGeneric()
          })

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