MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
sqrtm.hpp File Reference
#include <complex>
#include <cstddef>
#include <limits>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <vector>
#include <mtl/concepts/matrix.hpp>
#include <mtl/concepts/scalar.hpp>
#include <mtl/concepts/magnitude.hpp>
#include <mtl/mat/dense2D.hpp>
#include <mtl/operation/mult.hpp>
#include <mtl/operation/schur.hpp>
#include <mtl/operation/sylvester.hpp>
#include <mtl/detail/complex_qr.hpp>
#include <mtl/detail/matrix_checks.hpp>
#include <mtl/detail/unit_roundoff.hpp>

Namespaces

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

Functions

template<typename R>
void mtl::detail::sqrtm_impl::sqrt_block2 (const R &a0, const R &b, const R &c, R(&r)[2][2])
 The principal square root of a real 2x2 block [a b; c a] with b c < 0 (Higham 1987): alpha I + (T - a I) / (2 alpha), alpha the real part of sqrt(a + i mu), mu = sqrt(-b c).
template<typename T>
void mtl::detail::sqrtm_impl::require_finite_result (const mat::dense2D< T > &X, const char *who, const char *what="the result")
 Throws std::overflow_error unless every entry of X is finite.
void mtl::detail::sqrtm_impl::no_principal_root (const char *who)
template<typename T>
mat::dense2D< T > mtl::detail::sqrtm_impl::sqrt_quasi_triangular (const mat::dense2D< T > &Tm, const char *who)
 R with R R = T for T upper quasi-triangular (real) or upper triangular (complex), the principal root.
template<typename T>
mat::dense2D< T > mtl::detail::sqrtm_impl::adjoint (const mat::dense2D< T > &Q)
 Q^H: the transpose, conjugated for a complex type.
template<typename Accumulator = void, FieldMatrix M>
auto mtl::sqrtm (const M &A)
 The principal square root of a square matrix: the X with X X = A whose eigenvalues have positive real parts, as a dense2D of A's element type.