MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
qr.hpp File Reference
#include <algorithm>
#include <cassert>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>
#include <mtl/concepts/matrix.hpp>
#include <mtl/concepts/vector.hpp>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/mat/dense2D.hpp>
#include <mtl/detail/transpose_copy.hpp>
#include <mtl/operation/householder.hpp>
#include <mtl/tag/reflector_form.hpp>
#include <mtl/functor/scalar/conj.hpp>
#include <mtl/functor/scalar/real.hpp>
#include <mtl/math/identity.hpp>
#include <mtl/interface/dispatch_traits.hpp>
#include <mtl/math/accumulator_traits.hpp>

Namespaces

namespace  mtl

Functions

template<typename Accumulator = void, FieldMatrix M>
int mtl::qr_factor (M &A, vec::dense_vector< typename M::value_type > &tau)
 QR factorization: A (m x n, m >= n) is overwritten with R on+above diagonal and Householder vectors below diagonal.
template<FieldMatrix M>
int mtl::qr_factor (M &A, vec::dense_vector< typename M::value_type > &tau, tag::textbook_reflector)
 QR factorization with the textbook Householder reflector (#559).
template<typename Accumulator = void, Matrix M>
auto mtl::qr_extract_Q (const M &A, const vec::dense_vector< typename M::value_type > &tau)
 Extract explicit Q (m x m) from QR factorization stored in A and tau.
template<Matrix M>
auto mtl::qr_extract_R (const M &A)
 Extract explicit R (m x n) from QR factorization stored in A.
template<Matrix MQ, Matrix MR>
void mtl::qr_normalize_signs (MQ &Q, MR &R)
 Make R's diagonal non-negative: for each k < min(m, n) with R(k,k) < 0, negate row k of R and column k of Q.
template<typename Accumulator = void, FieldMatrix M, Vector VecX, Vector VecB>
void mtl::qr_solve (const M &QR, const vec::dense_vector< typename M::value_type > &tau, VecX &x, const VecB &b)
 Solve A*x = b via QR factorization (least-squares for m > n).