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

Classes

struct  mtl::normalized_reflection< T >
 A reflector H = I - tau*v*v^H with v(0) == 1, and beta, H*x = beta*e_1, as householder_reflector() returns them. More...
struct  mtl::textbook_reflection< T >
 A textbook Householder reflector (#559): H = I - (2/vtv)*v*v^T with v NOT normalized, and H*x = alpha*e_1. More...

Namespaces

namespace  mtl

Functions

template<typename Accumulator = void, typename T>
normalized_reflection< T > mtl::householder_reflector (const vec::dense_vector< T > &x)
 Compute Householder vector v and scalar tau for a column vector x, such that H = I - tau*v*v^H satisfies H*x = beta*e_1, and return beta with them.
template<typename Accumulator = void, typename T>
std::pair< vec::dense_vector< T >, T > mtl::householder (const vec::dense_vector< T > &x)
 Compute Householder vector v and scalar tau for a column vector x, such that H = I - tau*v*v^H satisfies H*x = beta*e_1.
template<typename T>
textbook_reflection< T > mtl::householder (const vec::dense_vector< T > &x, tag::textbook_reflector)
 Textbook (Golub & Van Loan sec.
template<typename Accumulator = void, Matrix M, typename T>
void mtl::apply_householder_left (M &A, const vec::dense_vector< T > &v, T beta, typename M::size_type row, typename M::size_type col)
 Apply Householder reflection H = I - beta*v*v^H on the LEFT (A := H*A) to columns col..ncols-1 of matrix A, rows row..nrows-1.
template<Matrix M, typename T>
void mtl::apply_householder_left (M &A, const vec::dense_vector< T > &v, T vtv, typename M::size_type row, typename M::size_type col, tag::textbook_reflector)
 Apply a textbook reflector H = I - (2/vtv)*v*v^T on the LEFT (A := H*A) to columns col..ncols-1, rows row..row+v.size()-1 (#559).
template<typename Accumulator = void, Matrix M, typename T>
void mtl::apply_householder_right (M &A, const vec::dense_vector< T > &v, T beta, typename M::size_type row, typename M::size_type col)
 Apply Householder reflection on the right: A := A * (I - beta*v*v^H).
template<Matrix M, typename T>
void mtl::apply_householder_right (M &A, const vec::dense_vector< T > &v, T vtv, typename M::size_type row, typename M::size_type col, tag::textbook_reflector)
 Apply a textbook reflector H = I - (2/vtv)*v*v^T on the RIGHT (A := A*H) to rows row..nrows-1, columns col..col+v.size()-1 (#559).