solve

CholeskyFactor.solve(b)[source]

Solve the linear system \(A x = b\) for x, using the factorization.

Parameters:

b ((N,) or (N, K) ndarray or sparse matrix) – The right-hand side vector or matrix.

Returns:

x ((N,) or (N, K) ndarray or sparse matrix) – The solution vector or matrix, returned in the same format as b.

Raises:

CholmodNotPositiveDefiniteError – If the matrix A is exactly singular, or singular to working precision.

Notes

This function solves the linear system:

\[R^{\top} R x = b,\]

where R is the upper triangular factor from the Cholesky factorization of A. The input b is either dense or sparse, vector or matrix.

If order was not natural when the factorization was computed, solve the system:

\[P^{\top} R^{\top} R P x = b\]

where P is the permutation matrix corresponding to the permutation vector. Similarly, if lower was True when the factorization was computed, the system solved is:

\[P^{\top} L L^{\top} P x = b.\]

If the factorization is in LDL form, the system solved is:

\[P^{\top} L D L^{\top} P x = b.\]

This function uses the CHOLMOD library to solve the linear system. It is intended to combine the MATLAB interfaces cholmod2.m [1], and ldlsolve.m [2].

Added in version 0.5.0.

References