|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
#include <algorithm>#include <concepts>#include <cmath>#include <cstddef>#include <cstdint>#include <random>#include <stdexcept>#include <string>#include <vector>#include <mtl/mat/dense2D.hpp>#include <mtl/mat/operators.hpp>#include <mtl/operation/random.hpp>#include <mtl/operation/trans.hpp>#include <mtl/math/identity.hpp>#include <mtl/generators/randorth.hpp>Namespaces | |
| namespace | mtl |
| namespace | mtl::generators |
| namespace | mtl::generators::detail |
Functions | |
| template<typename T> | |
| auto | mtl::generators::detail::make_sigma (std::size_t p, T kappa, int mode, std::mt19937_64 &gen) -> std::vector< T > |
| Generate a sigma vector of length p from condition number kappa and mode. | |
| template<typename T> | |
| auto | mtl::generators::detail::make_sigma (std::size_t p, T kappa, int mode) -> std::vector< T > |
| make_sigma with a non-deterministic engine for mode 5. | |
| template<typename T> | |
| mat::dense2D< T > | mtl::generators::detail::diagonal_matrix (std::size_t m, std::size_t n, const std::vector< T > &d) |
| An m x n matrix of zeros with d on its diagonal. | |
| template<typename T> | |
| mat::dense2D< T > | mtl::generators::detail::random_symmetric (std::size_t n, const std::vector< T > &lambda, std::mt19937_64 &gen) |
| Q * diag(lambda) * Q^T for a random orthogonal Q from gen, made exactly symmetric: the product is not bitwise symmetric, so each pair of entries is replaced by its average, a/2 + b/2, which cannot overflow where (a + b)/2 would (eigenvalues near the type's maximum). | |
| template<typename T = double> | |
| auto | mtl::generators::randsvd (std::size_t m, std::size_t n, const std::vector< T > &sigma, std::mt19937_64 &gen) |
| Construct a matrix with prescribed singular values, drawing U and V from gen. | |
| template<typename T = double> | |
| auto | mtl::generators::randsvd (std::size_t m, std::size_t n, const std::vector< T > &sigma, std::uint64_t seed) |
| Prescribed singular values, reproducibly from seed. | |
| template<typename T = double> | |
| auto | mtl::generators::randsvd (std::size_t m, std::size_t n, const std::vector< T > &sigma) |
| Prescribed singular values, non-deterministically. | |
| template<typename T = double, std::integral Mi, std::integral Ni> | |
| auto | mtl::generators::randsvd (Mi mi, Ni ni, T kappa, int mode, std::mt19937_64 &gen) |
| A rectangular matrix with condition number kappa, singular values from mode (see make_sigma), drawing from gen. | |
| template<typename T = double, std::integral Mi, std::integral Ni> | |
| auto | mtl::generators::randsvd (Mi mi, Ni ni, T kappa, int mode, std::uint64_t seed) |
| A rectangular matrix with condition number kappa, reproducibly from seed. | |
| template<typename T = double, std::integral Mi, std::integral Ni> requires (!std::integral<T>) | |
| auto | mtl::generators::randsvd (Mi mi, Ni ni, T kappa, int mode=3) |
| A rectangular matrix with condition number kappa, non-deterministically. | |
| template<typename T = double, std::integral Ni, std::integral Mode, std::integral Seed> requires (!std::integral<T>) | |
| auto | mtl::generators::randsvd (Ni ni, T kappa, Mode mode, Seed seed) |
| A square matrix with condition number kappa, reproducibly from seed. | |
| template<typename T = double> | |
| auto | mtl::generators::randsvd (std::size_t n, T kappa, int mode, std::mt19937_64 &gen) |
| A square matrix with condition number kappa, drawing from gen. | |
| template<typename T = double> | |
| auto | mtl::generators::randsvd (std::size_t n, T kappa, int mode=3) |
| A square matrix with condition number kappa, non-deterministically. | |