MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::detail::frechet_impl Namespace Reference

Classes

struct  real_of
struct  real_of< std::complex< R > >

Functions

template<typename M>
real_of< typenameM::value_type >::type one_norm (const M &A)
template<typename R>
int balance_exponent (const R &na, const R &ne)
 The exponent k of the power of two 2^k that brings ||E||_1 to ||A||_1, or 0 when either is zero.
template<typename T>
T scale_pow2 (const T &x, int k)
template<typename MA, typename ME>
void check_pair (const MA &A, const ME &E, const char *who)
template<typename T>
bool all_finite (const mat::dense2D< T > &X)
template<typename F, typename MA, typename ME>
auto block_frechet_at (F &f, const MA &A, const ME &E, int k)
 f([A 2^k E; 0 A]): f(A), and L_f(A, E) scaled back by 2^-k.
template<typename F, typename MA, typename ME>
auto block_frechet (F &&f, const MA &A, const ME &E)
 f(A) and L_f(A, E) from f([A cE; 0 A]) with c = 2^k balancing E against A.
template<typename T>
mat::dense2D< T > adjoint_of (const mat::dense2D< T > &A)
template<typename T, typename Deriv>
real_of< T >::type cond_estimate (const mat::dense2D< T > &A, const mat::dense2D< T > &FA, Deriv &&deriv)
 The 1-norm relative condition number estimate of Higham (2008, Sec.

Function Documentation

◆ adjoint_of()

template<typename T>
mat::dense2D< T > mtl::detail::frechet_impl::adjoint_of ( const mat::dense2D< T > & A)

◆ all_finite()

template<typename T>
bool mtl::detail::frechet_impl::all_finite ( const mat::dense2D< T > & X)

◆ balance_exponent()

template<typename R>
int mtl::detail::frechet_impl::balance_exponent ( const R & na,
const R & ne )

The exponent k of the power of two 2^k that brings ||E||_1 to ||A||_1, or 0 when either is zero.

◆ block_frechet()

template<typename F, typename MA, typename ME>
auto mtl::detail::frechet_impl::block_frechet ( F && f,
const MA & A,
const ME & E )

f(A) and L_f(A, E) from f([A cE; 0 A]) with c = 2^k balancing E against A.

Scaling E up (k > 0) keeps the derivative's block from being swamped by f(A)'s rounding, but it can push that block past the overflow threshold (A = [709], E = [1]: 512 e^709). Then the unscaled E is used instead.

◆ block_frechet_at()

template<typename F, typename MA, typename ME>
auto mtl::detail::frechet_impl::block_frechet_at ( F & f,
const MA & A,
const ME & E,
int k )

f([A 2^k E; 0 A]): f(A), and L_f(A, E) scaled back by 2^-k.

◆ check_pair()

template<typename MA, typename ME>
void mtl::detail::frechet_impl::check_pair ( const MA & A,
const ME & E,
const char * who )

◆ cond_estimate()

template<typename T, typename Deriv>
real_of< T >::type mtl::detail::frechet_impl::cond_estimate ( const mat::dense2D< T > & A,
const mat::dense2D< T > & FA,
Deriv && deriv )

The 1-norm relative condition number estimate of Higham (2008, Sec.

3.4), from deriv(A, E) -> L_f(A, E) and f(A).

◆ one_norm()

template<typename M>
real_of< typenameM::value_type >::type mtl::detail::frechet_impl::one_norm ( const M & A)

◆ scale_pow2()

template<typename T>
T mtl::detail::frechet_impl::scale_pow2 ( const T & x,
int k )