MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
complex_qr.hpp File Reference
#include <algorithm>
#include <complex>
#include <limits>
#include <stdexcept>
#include <string>
#include <mtl/mat/dense2D.hpp>
#include <mtl/detail/francis_qr.hpp>
#include <mtl/math/pow2_scaling.hpp>

Classes

struct  mtl::detail::complex_qr_options< R >

Namespaces

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

Functions

template<typename R>
R mtl::detail::cabs1 (const std::complex< R > &z)
 |re z| + |im z|: LAPACK's CABS1, the cheap norm zlahqr's tests use.
template<typename R>
R mtl::detail::cmod (const std::complex< R > &z)
 |z|, without overflow in the squares (dlapy2).
template<typename R>
R mtl::detail::lapy3 (R x, R y, R z)
 sqrt(x^2 + y^2 + z^2) without overflow in the squares (dlapy3).
template<typename R>
std::complex< R > mtl::detail::ladiv (const std::complex< R > &x, const std::complex< R > &y)
 x / y by Smith's algorithm, which divides by the larger of y's parts and so does not overflow in |y|^2 (zladiv).
template<typename R>
std::complex< R > mtl::detail::csqrt (const std::complex< R > &z)
 The principal square root of z: the root with a non-negative real part.
template<typename R>
std::complex< R > mtl::detail::larfg2 (std::complex< R > &alpha, std::complex< R > &x, const R &safmin)
 zlarfg for n = 2: the reflector G = I - tau [1; v] [1; v]^H with G^H [alpha; x] = [beta; 0], beta real.
template<typename R>
void mtl::detail::complex_qr (mat::dense2D< std::complex< R > > &H, mat::dense2D< std::complex< R > > &Z, const complex_qr_options< R > &opt)
 zlahqr with wantt and wantz on the whole matrix: H upper Hessenberg on entry, upper triangular on return, and every transformation applied to Z from the right.
template<typename R>
complex_qr_options< R > mtl::detail::make_complex_qr_options (std::size_t n, const char *who)
 The options for R: the deflation floor and larfg2's rescaling use R's numeric_limits minimum only when it is a safe minimum in LAPACK's sense, below the epsilon, which excludes fixed point (as schur() does for reals).
template<typename R>
int mtl::detail::scale_to_unit_binade (mat::dense2D< std::complex< R > > &W)
 Scale W by a power of two so that its largest real or imaginary part is in [1/2, 1], as scale_to_unit_binade does for a real matrix; returns the exponent k of the factor 2^-k applied.