Learn R Programming

Matrix (version 1.2-6)

dtrMatrix-class: Triangular, dense, numeric matrices

Description

The "dtrMatrix" class is the class of triangular, dense, numeric matrices in nonpacked storage. The "dtpMatrix" class is the same except in packed storage.

Arguments

Objects from the Class

Objects can be created by calls of the form new("dtrMatrix", ...).

Slots

uplo:
Object of class "character". Must be either "U", for upper triangular, and "L", for lower triangular.
diag:
Object of class "character". Must be either "U", for unit triangular (diagonal is all ones), or "N"; see triangularMatrix.
x:
Object of class "numeric". The numeric values that constitute the matrix, stored in column-major order.
Dim:
Object of class "integer". The dimensions of the matrix which must be a two-element vector of non-negative integers.

Extends

Class "ddenseMatrix", directly. Class "triangularMatrix", directly. Class "Matrix" and others, by class "ddenseMatrix".

Methods

Among others (such as matrix products, e.g. ?crossprod-methods),
coerce
signature(from = "dgeMatrix", to = "dtrMatrix")
coerce
signature(from = "dtrMatrix", to = "matrix")
coerce
signature(from = "dtrMatrix", to = "ltrMatrix")
coerce
signature(from = "dtrMatrix", to = "matrix")
coerce
signature(from = "matrix", to = "dtrMatrix")
norm
signature(x = "dtrMatrix", type = "character")
rcond
signature(x = "dtrMatrix", norm = "character")
solve
signature(a = "dtrMatrix", b = "....")
efficientely use a “forwardsolve” or backsolve for a lower or upper triangular matrix, respectively, see also solve-methods.
+, -, *, ..., ==, >=, ...
all the Ops group methods are available. When applied to two triangular matrices, these return a triangular matrix when easily possible.

Objects from the Class

This class is currently still mostly unimplemented! Objects can be created by calls of the form new("dtRMatrix", ...).

Slots

uplo:
Object of class "character". Must be either "U", for upper triangular, and "L", for lower triangular. At present only the lower triangle form is allowed.
diag:
Object of class "character". Must be either "U", for unit triangular (diagonal is all ones), or "N"; see triangularMatrix.
j:
Object of class "integer" of length nnzero(.) (number of non-zero elements). These are the row numbers for each non-zero element in the matrix.
p:
Object of class "integer" of pointers, one for each row, to the initial (zero-based) index of elements in the row. (Only present in the dsRMatrix class.)
x:
Object of class "numeric" - the non-zero elements of the matrix.
Dim:
The dimension (a length-2 "integer")
Dimnames:
corresponding names (or NULL), inherited from the Matrix, see there.

Extends

Class "dgRMatrix", directly. Class "dsparseMatrix", by class "dgRMatrix". Class "dMatrix", by class "dgRMatrix". Class "sparseMatrix", by class "dgRMatrix". Class "Matrix", by class "dgRMatrix".

Methods

No methods currently with class "dsRMatrix" in the signature.

See Also

Classes ddenseMatrix, dtpMatrix, triangularMatrix

Examples

Run this code

(m <- rbind(2:3, 0:-1))
(M <- as(m, "dgeMatrix"))

(T <- as(M, "dtrMatrix")) ## upper triangular is default
(T2 <- as(t(M), "dtrMatrix"))
stopifnot(T@uplo == "U", T2@uplo == "L", identical(T2, t(T)))

Run the code above in your browser using DataLab