SCM

SCM Repository

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

View of /pkg/R/dtTMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 557 - (download) (annotate)
Thu Feb 17 01:18:02 2005 UTC (14 years, 4 months ago) by bates
File size: 647 byte(s)
Coercions and methods for the dsTMatrix class
  ### Coercion and Methods for Triangular Triplet Matrices

## Conversion to dense storage is first to a dtrMatrix
setAs("dtTMatrix", "dtrMatrix",
      function(from) .Call("dtTMatrix_as_dtrMatrix", from))

setAs("dtTMatrix", "matrix",
      function(from) as(as(from, "dtrMatrix"), "matrix"))

setAs("dtTMatrix", "dgeMatrix",
      function(from) as(as(from, "dtrMatrix"), "dgeMatrix"))

setMethod("t", signature(x = "dtTMatrix"),
          function(x)
          new("dtTMatrix", Dim = rev(x@Dim), diag = x@diag,
              i = x@j, j = x@i, x = x@x,
              uplo = if (x@uplo == "U") "L" else "U"),
          valueClass = "dtTMatrix")

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