SCM

SCM Repository

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

View of /pkg/R/lsCMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1280 - (download) (annotate)
Tue May 23 08:01:44 2006 UTC (13 years, 9 months ago) by maechler
File size: 1364 byte(s)
useDynlib(*, .registration=TRUE)
#### Logical Symmetric Sparse Matrices in Compressed column-oriented format

### contains = "lsparseMatrix"

setAs("lsCMatrix", "matrix",
      function(from) as(as(from, "lgCMatrix"), "matrix"))

setAs("lsCMatrix", "lgCMatrix",
      function(from) .Call(sCMatrix_to_gCMatrix, from))

setAs("lsCMatrix", "lsTMatrix",
      function(from) .Call(Csparse_to_Tsparse, from))

setAs("lsCMatrix", "dsCMatrix",
      function(from) new("dsCMatrix", i = from@i, p = from@p,
                         x = rep(1, length(from@i)), uplo = from@uplo,
                         Dim = from@Dim, Dimnames = from@Dimnames))

setAs("lsCMatrix", "dgTMatrix",
      function(from) as(as(x, "dsCMatrix"), "dgTMatrix"))

## FIXME: generalize to "lsparseMatrix" or (class union)  "symmetric sparse"
setMethod("image", "lsCMatrix",
          function(x, ...) {
              x <- as(as(x, "dsCMatrix"), "dgTMatrix")
              callGeneric()
          })

setMethod("chol", signature(x = "lsCMatrix", pivot = "missing"),
          function(x, pivot, LINPACK)
          .Call(lsCMatrix_chol, x, TRUE))

setMethod("chol", signature(x = "lsCMatrix", pivot = "logical"),
          function(x, pivot, LINPACK)
          .Call(lsCMatrix_chol, x, pivot))

setMethod("t", signature(x = "lsCMatrix"),
          function(x)
          .Call(lsCMatrix_trans, x),
          valueClass = "lsCMatrix")

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