SCM

SCM Repository

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

View of /pkg/R/ltCMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1174 - (download) (annotate)
Mon Jan 16 20:03:48 2006 UTC (13 years, 9 months ago) by maechler
File size: 884 byte(s)
make Matrix() "smart" -- with help of quite a few new setAs(. , .) settings
#### Logical Sparse Triangular Matrices in Compressed column-oriented format

### contains = "lsparseMatrix"

setAs("ltCMatrix", "matrix",
      function(from) as(as(from, "dtCMatrix"), "matrix"))

setAs("ltCMatrix", "dMatrix", # < instead of "dtCMatrix"
      function(from) new("dtCMatrix", i = from@i, p = from@p,
                         x = rep.int(1, length(from@i)), uplo = from@uplo,
                         diag = from@diag,
                         Dim = from@Dim, Dimnames = from@Dimnames))

## setAs("ltCMatrix", "generalMatrix",
##       function(from) ......)

setMethod("image", "ltCMatrix",
          function(x, ...) {
              x <- as(as(x, "dtCMatrix"), "dgTMatrix")
              callGeneric()
          })

setMethod("t", signature(x = "ltCMatrix"),
          function(x) .Call("ltCMatrix_trans", x, PACKAGE = "Matrix"),
          valueClass = "ltCMatrix")

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