dsCMatrix-class {Matrix}R Documentation

Numeric Symmetric Sparse (column compressed) Matrices

Description

The dsCMatrix class is a class of symmetric, sparse numeric matrices in the compressed, column-oriented format. In this implementation the non-zero elements in the columns are sorted into increasing row order.
The dsTMatrix class is the class of symmetric, sparse numeric matrices in triplet format.

Objects from the Class

Objects can be created by calls of the form new("dsCMatrix", ...) or new("dsTMatrix", ...)

Slots

uplo:
A character object indicating if the upper triangle ("U" or "u") or the lower triangle ("L" or "l") is stored.
p:
Object of class "integer" of pointers, one for each column, to the initial (zero-based) index of elements in the column. (Only present in the dsCMatrix class.)
i:
Object of class "integer" of length nnzero (half number of non-zero elements). These are the row numbers for each non-zero element in the lower triangle of the matrix.
j:
Object of class "integer" of length nnzero (half number of non-zero elements). These are the column numbers for each non-zero element in the lower triangle of the matrix. (Only present in the dsTMatrix class.)
x:
Object of class "numeric" - the non-zero elements of the matrix (to be duplicated for full matrix).
factors:
Object of class "list" - a list of factorizations of the matrix.
Dim:
Object of class "integer" - the dimensions of the matrix - must be an integer vector with exactly two non-negative values.

Extends

Class "dgCMatrix", directly.

Methods

solve
signature(a = "dsCMatrix", b = "dsparseMatrix"): Solve a linear system of equations defined by x using a Cholesky decomposition. All steps will be based on sparse representations.
solve
signature(a = "dsCMatrix", b = "matrix"): Solve a linear system of equations defined by x using a Cholesky decomposition.
chol
signature(x = "dsCMatrix", pivot = "logical"): Returns (and stores) the Cholesky decomposition of the matrix x. If pivot is TRUE (the default) Metis is used to create a reordering of the rows and columns of x so as to minimize fill-in.
determinant
signature(x = "dsCMatrix", logarithm = "missing"): Evaluate the determinant of x on the logarithm scale. This creates and stores the Cholesky factorization.
determinant
signature(x = "dsCMatrix", logarithm = "logical"): Evaluate the determinant of x on the logarithm scale or not, according to the logarithm argument. This creates and stores the Cholesky factorization.
t
signature(x = "dsCMatrix"): Transpose. Because x is symmetric this has no effect.
t
signature(x = "dsTMatrix"): Transpose. For the dsTMatrix class the row and column indices are interchanged so that a matrix for which the upper triangle is stored produces a matrix for which the lower triangle is stored and vice versa.
coerce
signature(from = "dsCMatrix", to = "dgTMatrix")
coerce
signature(from = "dsCMatrix", to = "dgeMatrix")
coerce
signature(from = "dsCMatrix", to = "matrix")
coerce
signature(from = "dsTMatrix", to = "dgeMatrix")
coerce
signature(from = "dsTMatrix", to = "dsCMatrix")
coerce
signature(from = "dsTMatrix", to = "dsyMatrix")
coerce
signature(from = "dsTMatrix", to = "matrix")

See Also

Classes dgCMatrix, dgTMatrix, dgeMatrix

Examples

## First a "dgCMatrix"
mm <- Matrix(toeplitz(c(10, 0, 1, 0, 3)), sparse = TRUE)
mT <- as(mm, "dgTMatrix")
(symM <- as(mT, "dsCMatrix"))
str(symM)

[Package Matrix version 0.9975-6 Index]