SupernodalMatrix API

For supernodal Cholesky factorizations, SupernodalMatrix stores the output of selinv. This subtype of AbstractMatrix allows for a more efficient memory access tailored to supernodal representations.

While you can just use it like a regular AbstractMatrix (i.e. you can get its size and index into it as you would expect), you might be interested in more specialized methods.

Fields and construction

SelectedInversion.SupernodalMatrixType
SupernodalMatrix

Represents a sparse block lower triangular matrix with a supernodal layout. A supernode is a set of contiguous columns with identical sparsity pattern below the triangular block at the top. For each supernode, the corresponding nonzero entries are stored in a dense chunk. This enables us to use BLAS for operations on these chunks, so we combine the strengths of sparse and dense matrices.

Fields

  • N::Int: Number of rows
  • M::Int: Number of columns
  • n_super::Int: Number of supernodes
  • super_to_col::Vector{Int}: Start/end column of each supernode. Length n_super + 1.
  • col_to_super::Vector{Int}: Maps each column to its supernode index. Length M.
  • super_to_vals::Vector{Int}: Start/end indices of each supernode into vals. Length n_super + 1.
  • super_to_rows::Vector{Int}: Start/end indices of each supernode into rows. Length n_super + 1.
  • vals::Vector{Float64}: Nonzero values.
  • rows::Vector{Int}: Row indices. CAREFUL: These are zero-indexed!
  • max_super_rows::Int: Maximum number of rows below the triangular block in a supernode chunk.
  • transposed_chunks::Bool: Whether to store the transpose of chunks, such that the first axis in the chunk corresponds to the columns in the supernode.
  • symmetric_access::Bool: Whether to enforce symmetry when accessing entries.
  • invperm::Vector{Int}: Permutation to apply before accessing entries when depermuted_access == true.
  • depermuted_access::Bool: Whether to apply an inverse permutation before accessing entries.
source
SelectedInversion.SupernodalMatrixMethod
SupernodalMatrix(
    F::SparseArrays.CHOLMOD.Factor;
    transpose_chunks = false,
    symmetric_access = false,
    depermuted_access = false,
)

Construct a SupernodalMatrix from a supernodal Cholesky factorization.

Keyword arguments are explained in the SupernodalMatrix docstring.

source

Methods

SelectedInversion.get_rowsFunction
get_rows(S::SupernodalMatrix, sup_idx::Int)

Get the row indices corresponding to supernode sup_idx. CAREFUL: These are zero-indexed!

source
SelectedInversion.get_row_col_idcsFunction
get_row_col_idcs(S::SupernodalMatrix, sup_idx::Int)

Get the row and column indices corresponding to supernode sup_idx. Both sets of indices are one-indexed.

source
SelectedInversion.get_SjFunction
get_Sj(S::SupernodalMatrix, sup_idx::Int)

Get the row indices below the triangular block of supernode sup_idx. CAREFUL: These are zero-indexed!

source
SelectedInversion.partition_SjFunction
partition_Sj(S::SupernodalMatrix, Sj)

Partition the output of get_Sj into contiguous subsets where each subset is fully contained in one supernode.

source
SelectedInversion.get_chunkFunction
get_chunk(S::SupernodalMatrix, sup_idx::Int)

Get the dense chunk corresponding to supernode sup_idx. Includes the triangular block at the top.

source
SelectedInversion.get_split_chunkFunction
get_split_chunk(S::SupernodalMatrix, sup_idx::Int)

Get the chunk corresponding to supernode sup_idx, split into the diagonal / lower triangular block at the top, and the remaining block below it.

source