# SCM Repository

[matrix] Diff of /pkg/Matrix/R/diagMatrix.R
 [matrix] / pkg / Matrix / R / diagMatrix.R

# Diff of /pkg/Matrix/R/diagMatrix.R

revision 2764, Fri Feb 17 19:58:29 2012 UTC revision 2778, Mon Apr 16 19:04:10 2012 UTC
# Line 193  Line 193
193  .diag2tT <- function(from, uplo = "U", kind = .M.kind(from)) {  .diag2tT <- function(from, uplo = "U", kind = .M.kind(from)) {
194      ## to triangular Tsparse      ## to triangular Tsparse
195      i <- if(from@diag == "U") integer(0) else seq_len(from@Dim[1]) - 1L      i <- if(from@diag == "U") integer(0) else seq_len(from@Dim[1]) - 1L
196      new(paste(kind, "tTMatrix", sep=''),      new(paste0(kind, "tTMatrix"),
197          diag = from@diag, Dim = from@Dim, Dimnames = from@Dimnames,          diag = from@diag, Dim = from@Dim, Dimnames = from@Dimnames,
198          uplo = uplo,          uplo = uplo,
199          x = from@x, # <- ok for diag = "U" and "N" (!)          x = from@x, # <- ok for diag = "U" and "N" (!)
# Line 204  Line 204
204      ## to symmetric Tsparse      ## to symmetric Tsparse
205      n <- from@Dim[1]      n <- from@Dim[1]
206      i <- seq_len(n) - 1L      i <- seq_len(n) - 1L
207      new(paste(kind, "sTMatrix", sep=''),      new(paste0(kind, "sTMatrix"),
208          Dim = from@Dim, Dimnames = from@Dimnames,          Dim = from@Dim, Dimnames = from@Dimnames,
209          i = i, j = i, uplo = uplo,          i = i, j = i, uplo = uplo,
210          x = if(from@diag == "N") from@x else ## "U"-diag          x = if(from@diag == "N") from@x else ## "U"-diag

Legend:
 Removed from v.2764 changed lines Added in v.2778