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::qr_numeric< Value > Struct Template Reference

Result of numeric QR factorization. More...

#include <sparse_qr.hpp>

Public Member Functions

std::size_t num_rows () const
std::size_t num_cols () const
template<typename Accumulator = void, typename VecX, typename VecB>
void solve (VecX &x, const VecB &b) const
 Solve min ||A*x - b||_2.

Public Attributes

util::csc_matrix< Value > R
std::vector< std::vector< Value > > V
std::vector< std::vector< std::size_t > > V_idx
std::vector< Value > beta
qr_symbolic symbolic

Detailed Description

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

Result of numeric QR factorization.

R is upper triangular (n x n, CSC). Householder vectors and betas encode Q implicitly.

Member Function Documentation

◆ num_cols()

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

◆ num_rows()

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

◆ solve()

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

Solve min ||A*x - b||_2.

A*Q = Q_h * R => A = Q_h * R * Q^T min ||Ax - b|| => R * Q^T * x = (Q_h^T * b)[0:n-1]

Accumulator (default void, leading as in sparse_qr_numeric) selects the accumulator policy of the solve-time reductions (#535): the v_k^T w dot of the Q_h^T b step and each row's w[i] - sum_k R(i,k) y[k] of the R back-substitution. void is the raw Value path, byte for byte. A non-void Acc holds one accumulator per row of R (O(ncols) workspace, see math/accumulator_traits.hpp) so that each y[i] is rounded once, when its column is reached, and the terms are added in the same order as the default scatter.

Member Data Documentation

◆ beta

template<typename Value>
std::vector<Value> mtl::sparse::factorization::qr_numeric< Value >::beta

◆ R

template<typename Value>
util::csc_matrix<Value> mtl::sparse::factorization::qr_numeric< Value >::R

◆ symbolic

template<typename Value>
qr_symbolic mtl::sparse::factorization::qr_numeric< Value >::symbolic

◆ V

template<typename Value>
std::vector<std::vector<Value> > mtl::sparse::factorization::qr_numeric< Value >::V

◆ V_idx

template<typename Value>
std::vector<std::vector<std::size_t> > mtl::sparse::factorization::qr_numeric< Value >::V_idx

The documentation for this struct was generated from the following file:
  • /home/runner/work/mtl5/mtl5/include/mtl/sparse/factorization/sparse_qr.hpp