MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
triangular_solve.hpp File Reference
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <limits>
#include <stdexcept>
#include <string>
#include <vector>
#include <mtl/sparse/util/csc.hpp>

Namespaces

namespace  mtl
namespace  mtl::sparse
namespace  mtl::sparse::factorization
namespace  mtl::sparse::factorization::detail
 Numeric KLU factorization: BTF permutation, the permuted matrix B = P*A*Q (block upper triangular), the per-new-index block id, and a left-looking LU factorization of each diagonal block.

Functions

std::size_t mtl::sparse::factorization::reach (const std::vector< std::size_t > &L_col_ptr, const std::vector< std::size_t > &L_row_ind, std::size_t n, const std::vector< std::size_t > &b_indices, std::vector< std::size_t > &xi, std::vector< std::size_t > &stack_workspace, std::vector< std::size_t > &pos_workspace, std::vector< bool > &marked)
 Compute the topological ordering of nodes reachable from the nonzero pattern of b in the graph of L (given in CSC).
std::size_t mtl::sparse::factorization::reach (const std::vector< std::size_t > &L_col_ptr, const std::vector< std::size_t > &L_row_ind, std::size_t n, const std::vector< std::size_t > &b_indices, std::vector< std::size_t > &xi, std::vector< std::size_t > &stack_workspace, std::vector< bool > &marked)
 reach() with its own position workspace: allocates O(n) per call.
template<typename SizeType>
void mtl::sparse::factorization::detail::misplaced_diagonal (const char *fn, SizeType col)
 The diagonal of column col is not where the solve expects it (first in a column of L, last in a column of U): a wrong layout, or no diagonal stored.
template<typename SizeType>
void mtl::sparse::factorization::detail::zero_diagonal (const char *fn, SizeType col)
 A zero diagonal: the triangular matrix is singular.
template<typename Value, typename SizeType>
void mtl::sparse::factorization::sparse_lower_solve (const util::csc_matrix< Value, SizeType > &L, std::vector< Value > &x, const std::vector< std::size_t > &xi, std::size_t top)
 Sparse triangular solve: solve Lx = b where L is lower triangular in CSC and b is sparse.
template<typename Value, typename SizeType>
void mtl::sparse::factorization::dense_lower_solve (const util::csc_matrix< Value, SizeType > &L, std::vector< Value > &x)
 Dense lower triangular solve: solve Lx = b where L is in CSC format.
template<typename Value, typename SizeType>
void mtl::sparse::factorization::dense_upper_solve (const util::csc_matrix< Value, SizeType > &U, std::vector< Value > &x)
 Dense upper triangular solve: solve Ux = b where U is in CSC format.
template<typename Value, typename SizeType>
void mtl::sparse::factorization::dense_lower_transpose_solve (const util::csc_matrix< Value, SizeType > &L, std::vector< Value > &x)
 Dense lower triangular transpose solve: solve L^T x = b where L is in CSC.
template<typename Value, typename SizeType>
void mtl::sparse::factorization::dense_unit_lower_solve (const util::csc_matrix< Value, SizeType > &L, std::vector< Value > &x)
 Dense unit lower triangular solve: solve Lx = b where L is unit lower triangular in CSC format (diagonal entries in L are ignored; assumed 1).
template<typename Value, typename SizeType>
void mtl::sparse::factorization::dense_unit_lower_transpose_solve (const util::csc_matrix< Value, SizeType > &L, std::vector< Value > &x)
 Dense unit lower triangular transpose solve: solve L^T x = b where L is unit lower triangular in CSC (diagonal entries ignored; assumed 1).

Variables

constexpr std::size_t mtl::sparse::factorization::unvisited = std::numeric_limits<std::size_t>::max()
 Sentinel for unvisited nodes in DFS.