Matrix (version 0.99-3)

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", ...).

Extends

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

See Also

dgeMatrix-class, dtpMatrix-class, Matrix-class

Examples

Run this code
(m <- rbind(2:3, 0:-1))
(M <- as(m, "dgeMatrix"))
(T <- as(M, "dtrMatrix")) ## upper triangular is default
## hence this may surprise at first:
(T2 <- as(t(M), "dtrMatrix"))# is factually diagonal
## and different from
(T3 <- t(T)) # which is *lower* triangular:
str(T3)

Run the code above in your browser using DataCamp Workspace