MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
native_klu.hpp File Reference
#include <cstddef>
#include <iomanip>
#include <sstream>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include <type_traits>
#include <mtl/concepts/scalar.hpp>
#include <mtl/mat/compressed2D.hpp>
#include <mtl/mat/inserter.hpp>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/sparse/factorization/sparse_lu.hpp>
#include <mtl/sparse/ordering/amd.hpp>
#include <mtl/sparse/ordering/dulmage_mendelsohn.hpp>
#include <mtl/sparse/util/permutation.hpp>

Classes

struct  mtl::sparse::factorization::detail::klu_slice< Value >
 A non-owning view of m consecutive Values, with the size() and operator() lu_numeric::solve takes for its vectors. More...
struct  mtl::sparse::factorization::klu_numeric< Value >
struct  mtl::sparse::factorization::klu_refactor_options< Value >
 Options of native_klu_refactor's checked form (issue 946). More...
struct  mtl::sparse::factorization::klu_growth_error
 Thrown by native_klu_refactor when the refactorization's rgrowth() is below klu_refactor_options::min_rgrowth. More...

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

template<typename Accumulator = void, typename Value, typename Parameters>
requires OrderedField<Value>
klu_numeric< Value > mtl::sparse::factorization::native_klu_factor (const mat::compressed2D< Value, Parameters > &A, Value threshold=Value{1}, bool scale=true, Value pivot_perturb=Value{0})
 Factor A using native KLU: BTF, then a left-looking LU of each diagonal block with threshold partial pivoting.
template<typename Value, typename Parameters>
requires OrderedField<Value>
klu_numeric< Value > mtl::sparse::factorization::native_klu_refactor (const mat::compressed2D< Value, Parameters > &A, const klu_numeric< Value > &prev)
 Refactorize a matrix with the SAME sparsity pattern as a prior native KLU factorization, reusing its BTF permutation, per-block orderings, and per-block pivot sequences – recomputing only the numeric values.
template<typename Value, typename Parameters>
requires OrderedField<Value>
klu_numeric< Value > mtl::sparse::factorization::native_klu_refactor (const mat::compressed2D< Value, Parameters > &A, const klu_numeric< Value > &prev, const std::type_identity_t< klu_refactor_options< Value > > &opt)
 native_klu_refactor, then the check opt asks for: with opt.min_rgrowth
template<typename Value, typename Parameters, typename VecX, typename VecB>
requires OrderedField<Value>
void mtl::sparse::factorization::native_klu_solve (const mat::compressed2D< Value, Parameters > &A, VecX &x, const VecB &b, Value threshold=Value{1})
 One-shot native KLU solve: factor and solve A*x = b.