SCM

SCM Repository

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

View of /pkg/R/ntTMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1548 - (download) (annotate)
Mon Sep 11 22:13:07 2006 UTC (12 years, 5 months ago) by maechler
File size: 952 byte(s)
new nMatrix and subclasses; lsparse change to have x slot; many consequences
#### Logical Sparse Triangular Matrices in Triplet format

### contains = "nsparseMatrix"

setAs("ntTMatrix", "matrix",
      function(from) as(as(from, "ngTMatrix"), "matrix"))

setAs("ntTMatrix", "ngTMatrix",
      function(from) new("ngTMatrix", i = from@i, j = from@j, x = from@x,
                         Dim = from@Dim, Dimnames = from@Dimnames))

setAs("ntTMatrix", "dtTMatrix",
      function(from) new("dtTMatrix", 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", "ntTMatrix",
          function(x, ...) {
              x <- as(as(x, "dtTMatrix"), "dgTMatrix")
              callGeneric()
          })

## FIXME
## setMethod("t", signature(x = "ntTMatrix"),
##           function(x) .Call(ntTMatrix_trans, x),
##           valueClass = "ntTMatrix")

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