symDMatrix (version 2.1.1)

symDMatrix: Create a New symDMatrix Instance

Description

This function constructs a new symDMatrix object.

Usage

symDMatrix(...)

Arguments

...

ColumnLinkedMatrix objects containing blocks that inherit from ff_matrix.

Value

A symDMatrix object.

Details

Several structural checks are performed on the passed blocks: there must be at least one block, the blocks must be of type ColumnLinkedMatrix, and the number of blocks must be consistent across the ColumnLinkedMatrix objects. Each block must inherit from ff_matrix and have the same number of rows or columns as blocks in the same row or column, respectively. Non-final blocks have to be square, unless if there is only a single block, in which case that block also has to be square.

See Also

as.symDMatrix to create a symDMatrix object from other objects.

Examples

Run this code
# NOT RUN {
# Generate a symmetric matrix
X <- cov(matrix(data = rnorm(25), nrow = 5, ncol = 5))

# Break this matrix into blocks X11, X12, X22
# X21 can be stored as a virtual transpose of X12
X11 <- ff::as.ff(X[1:3, 1:3])
X12 <- ff::as.ff(X[1:3, 4:5])
X22 <- ff::as.ff(X[4:5, 4:5])
X21 <- ff::vt(X12)

# Create a symDMatrix from blocks
S <- symDMatrix(
    LinkedMatrix::ColumnLinkedMatrix(X11, X12),
    LinkedMatrix::ColumnLinkedMatrix(X21, X22)
)
nBlocks(S)
blockSize(S)
blockSize(S, last = TRUE)
# }

Run the code above in your browser using DataLab