22template <MatrixContainer Mat>
27 using Complex = std::conditional_t<linalg::Complex<T>,
T, std::complex<Real>>;
52 constexpr void svd(
const Mat&
A) {
65 for (std::size_t
i = 0;
i <
Cols; ++
i) {
88 constexpr void sort_svd_desc() {
96 for (std::size_t
i = 0;
i <
Cols; ++
i) {
97 const auto idx =
P[
i];
Field classified by scalar_traits as complex.
Field classified by scalar_traits as real.
constexpr auto get_diag(const Mat &A)
get the diagonal of a matrix A
typename scalar_traits_t< T >::real_type real_type_t
Associated real component type registered for T.
constexpr auto as_complex_matrix(const Mat &A)
express matrix as complex one
constexpr auto conjugate_transpose(const Mat &A)
conjugate transpose of a matrix
constexpr auto transpose(const Vec &x)
tranpose of a vector
constexpr T constexpr_abs(T x)
Compute real absolute value or complex magnitude.
constexpr std::size_t mat_rows_v
Registered compile-time row count after cv/ref normalization.
constexpr auto get_col(const Mat &A, std::size_t idx)
get the column of matrix A based on given index
constexpr auto argsort_desc(const Vec &x)
Return coordinate indices sorted by descending real value.
typename mat_traits< remove_cvref_t< Mat > >::value_type matrix_scalar_t
Registered matrix scalar type after cv/ref normalization.
Computes eigenvalues and eigenvectors satisfying A V = V diag(lambda).
forward declaration for L2 norm
Owning, fixed-size, row-major matrix container over a scalar field.
Computes A = U Sigma V^* from the eigendecomposition of A^* A.
Matrix< Complex, Cols, Cols > VT
SVD member variables.
Matrix< Complex, Rows, Rows > U
left singular vectors
constexpr SVD(const Mat &A)
Compute singular triplets for A.
static constexpr std::size_t Rows
Matrix< Real, Rows, Cols > S
singular values
static constexpr std::size_t Cols