MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
cholesky.hpp File Reference
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <type_traits>
#include <vector>
#include <mtl/concepts/matrix.hpp>
#include <mtl/concepts/vector.hpp>
#include <mtl/concepts/magnitude.hpp>
#include <mtl/concepts/scalar.hpp>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/math/identity.hpp>
#include <mtl/math/accumulator_traits.hpp>
#include <mtl/functor/scalar/conj.hpp>
#include <mtl/functor/scalar/real.hpp>
#include <mtl/functor/scalar/imag.hpp>
#include <mtl/detail/structure_tol.hpp>
#include <mtl/interface/dispatch_traits.hpp>
#include <mtl/detail/thread_pool.hpp>
#include <mtl/tag/summation_order.hpp>
#include <mtl/interface/device_dispatch.hpp>

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.

Functions

template<typename Ordering, typename M>
int mtl::detail::cholesky_factor_generic (M &A)
 The generic (non-LAPACK) A = L*L^T loop, in either summation order (#556).
template<typename Accumulator, typename M>
int mtl::detail::cholesky_factor_acc (M &A)
 The accumulator A = L*L^H loop (#585): each entry is assign(A(i,j)), then add_product(-L(i,k), conj(L(j,k))) for k < j, rounded once.
template<typename Accumulator, bool Conj, typename M, typename VecX, typename VecB>
void mtl::detail::cholesky_solve_acc (const M &L, VecX &x, const VecB &b)
 The two substitutions of an L*L^H (Conj = true) or L*L^T (false) solve, with each row's b(i) - sum of products formed in Accumulator and rounded once.
template<typename Accumulator = void, FieldMatrix M>
int mtl::cholesky_factor (M &A)
 Cholesky factorization: A = L * L^T, for a REAL symmetric positive definite A.
template<FieldMatrix M>
int mtl::cholesky_factor (M &A, tag::subtract_sum)
 cholesky_factor(A), with the default summation order named explicitly.
template<FieldMatrix M>
int mtl::cholesky_factor (M &A, tag::subtract_term_by_term)
 Cholesky factorization A = L * L^T with each entry formed TERM BY TERM: start from the matrix entry and subtract each product in turn (#556),.
template<typename Accumulator = void, FieldMatrix M, Vector VecX, Vector VecB>
void mtl::cholesky_solve (const M &L, VecX &x, const VecB &b)
 Solve A*x = b using precomputed Cholesky factor L (stored in lower triangle of A).
template<typename Accumulator = void, FieldMatrix M>
int mtl::cholesky_h_factor (M &A)
 Cholesky factorization: A = L * L^H, for a HERMITIAN positive definite A.
template<typename Accumulator = void, FieldMatrix M, Vector VecX, Vector VecB>
void mtl::cholesky_h_solve (const M &L, VecX &x, const VecB &b)
 Solve A*x = b using precomputed Cholesky factors of a HERMITIAN A, i.e.

Variables

constexpr int mtl::CHOLESKY_NOT_HERMITIAN = -2
 Returned by cholesky_h_factor when the input is complex and has a non-real diagonal, which a Hermitian matrix cannot have.