Revision 1a5ec6abacd340fd70a26c48a7b0b63fbb8104f6 authored by Douglas Bates on 19 August 2005, 00:00:00 UTC, committed by Gabor Csardi on 19 August 2005, 00:00:00 UTC
1 parent 54b7f7b
Raw File
dtTMatrix.R
  ### 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")
back to top