Skip to content

sparse cholesky design #161

@paciorek

Description

@paciorek

Eigen computes sparse Cholesky based on a reordering to preserve as much sparsity as possible. This means it doesn't make sense to try to give the user the sparse Cholesky factor, either in compiled or uncompiled code.

Here is a draft design:

  1. Provide a sparseCholFactor operator that returns a shared pointer to a simplicialLLT object by initializing the simplicialLLT (e.g., called llt) and then calling llt->compute(inputMat). Note that we will no overload chol(A) because the output is different when A is sparse versus dense.
  2. In R, we will instead call Matrix::Cholesky which does a similar reordering (but I don't know it is identical).
  3. Provide the following operators than can use the simplicialLLT:
    i. sparseCholeskySolve(b): this will call llt->solve(b) in Eigen code, solving the system of equations Ax=b.
    ii. sparseCholeskyForwardsolve(b): this will call llt->matrixL().triangularView<Eigen::Lower>().solve(b) to do $L^{-1}b$.
    iii. sparseCholeskyDiag(): this will call code that will extract the diag from matrixL and inverse permute. This will presumably mostly be used for determinants.

I have a draft of items 1 and 2 working on branch sparse_chol. And I have the Eigen code to do (3) from Claude.

@perrydv happy to have your inputs, but also happy to proceed on this path.

LDLT for sparse and dense will be future work (possibly post-initial release). I will want to experiment to better understand cases where LDLT works and LLT does not. Need to look at some GP cases where matrix is nearly non-p.d., such as Gaussian correlation or Matern with larger nu values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions