MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::sparse::factorization::cholesky_numeric< Value > Struct Template Reference

Result of numeric Cholesky factorization. More...

#include <sparse_cholesky.hpp>

Public Member Functions

std::size_t num_rows () const
std::size_t num_cols () const
const util::csc_matrix< Value > & factor () const
 Read-only access to the lower Cholesky factor L (CSC).
void set_factor (util::csc_matrix< Value > L)
 Install the numeric factor and (re)build the coupled forward and transpose solve schedules from it.
template<typename Accumulator = void, typename VecX, typename VecB>
void solve (VecX &x, const VecB &b) const
 Solve A*x = b using the Cholesky factorization.

Public Attributes

cholesky_symbolic symbolic

Detailed Description

template<typename Value>
struct mtl::sparse::factorization::cholesky_numeric< Value >

Result of numeric Cholesky factorization.

Holds the lower triangular factor L (CSC) and its forward-solve level schedule as coupled, read-only state: L is only ever installed together with the schedule built from it (via set_factor), so the two cannot drift out of sync. The symbolic analysis is exposed for permutation info during solve.

Member Function Documentation

◆ factor()

template<typename Value>
const util::csc_matrix< Value > & mtl::sparse::factorization::cholesky_numeric< Value >::factor ( ) const
inline

Read-only access to the lower Cholesky factor L (CSC).

◆ num_cols()

template<typename Value>
std::size_t mtl::sparse::factorization::cholesky_numeric< Value >::num_cols ( ) const
inline

◆ num_rows()

template<typename Value>
std::size_t mtl::sparse::factorization::cholesky_numeric< Value >::num_rows ( ) const
inline

◆ set_factor()

template<typename Value>
void mtl::sparse::factorization::cholesky_numeric< Value >::set_factor ( util::csc_matrix< Value > L)
inline

Install the numeric factor and (re)build the coupled forward and transpose solve schedules from it.

L and its schedules are always set together here, which enforces the invariant the level solves rely on – the schedules' cached structure always matches L's pattern. The factor must be square and match the symbolic dimension (set symbolic first). Strongly exception safe: both schedules are built into locals before any member is replaced, so a throw leaves the object unchanged.

◆ solve()

template<typename Value>
template<typename Accumulator = void, typename VecX, typename VecB>
void mtl::sparse::factorization::cholesky_numeric< Value >::solve ( VecX & x,
const VecB & b ) const
inline

Solve A*x = b using the Cholesky factorization.

A = P^T L L^T P, so x = P^T L^{-T} L^{-1} P b Accumulator (default void, leading as in the numeric phase) selects the accumulator policy of the triangular-solve row reductions (#535): void is the raw Value loop; see level_schedule.hpp for the contract.

Member Data Documentation

◆ symbolic

template<typename Value>
cholesky_symbolic mtl::sparse::factorization::cholesky_numeric< Value >::symbolic

The documentation for this struct was generated from the following file: