akreon-linalg
Fixed-size linear algebra and numerical methods in C++26.
Loading...
Searching...
No Matches
linalg::SVD< Mat > Struct Template Reference

Computes A = U Sigma V^* from the eigendecomposition of A^* A. More...

#include <svd.hpp>

Public Types

using T = matrix_scalar_t< Mat >
 
using Real = real_type_t< T >
 
using Complex = std::conditional_t< linalg::Complex< T >, T, std::complex< Real > >
 

Public Member Functions

constexpr SVD (const Mat &A)
 Compute singular triplets for A.
 

Public Attributes

Matrix< Complex, Cols, Cols > VT
 SVD member variables.
 
Matrix< Complex, Rows, Rows > U
 left singular vectors
 
Matrix< Real, Rows, Cols > S
 singular values
 
bool converged
 converged
 

Static Public Attributes

static constexpr std::size_t Rows = mat_rows_v<Mat>
 
static constexpr std::size_t Cols = mat_cols_v<Mat>
 

Detailed Description

template<MatrixContainer Mat>
struct linalg::SVD< Mat >

Computes A = U Sigma V^* from the eigendecomposition of A^* A.

Right singular vectors come from A^* A; each product A*v_i yields its singular value and left singular vector. Singular triplets are sorted by decreasing singular value.

Template Parameters
MatInput matrix type with at least as many rows as columns.

Definition at line 23 of file svd.hpp.

Member Typedef Documentation

◆ Complex

template<MatrixContainer Mat>
using linalg::SVD< Mat >::Complex = std::conditional_t<linalg::Complex<T>, T, std::complex<Real> >

Definition at line 27 of file svd.hpp.

◆ Real

template<MatrixContainer Mat>
using linalg::SVD< Mat >::Real = real_type_t<T>

Definition at line 26 of file svd.hpp.

◆ T

template<MatrixContainer Mat>
using linalg::SVD< Mat >::T = matrix_scalar_t<Mat>

Definition at line 25 of file svd.hpp.

Constructor & Destructor Documentation

◆ SVD()

template<MatrixContainer Mat>
constexpr linalg::SVD< Mat >::SVD ( const Mat &  A)
inlineconstexpr

Compute singular triplets for A.

Parameters
[in]AInput matrix with Rows >= Cols.

Definition at line 38 of file svd.hpp.

References linalg::mat_rows_v.

Member Data Documentation

◆ Cols

template<MatrixContainer Mat>
constexpr std::size_t linalg::SVD< Mat >::Cols = mat_cols_v<Mat>
staticconstexpr

Definition at line 31 of file svd.hpp.

◆ converged

template<MatrixContainer Mat>
bool linalg::SVD< Mat >::converged

converged

Definition at line 44 of file svd.hpp.

◆ Rows

template<MatrixContainer Mat>
constexpr std::size_t linalg::SVD< Mat >::Rows = mat_rows_v<Mat>
staticconstexpr

Definition at line 30 of file svd.hpp.

◆ S

template<MatrixContainer Mat>
Matrix<Real, Rows, Cols> linalg::SVD< Mat >::S

singular values

Definition at line 43 of file svd.hpp.

◆ U

template<MatrixContainer Mat>
Matrix<Complex, Rows, Rows> linalg::SVD< Mat >::U

left singular vectors

Definition at line 42 of file svd.hpp.

◆ VT

template<MatrixContainer Mat>
Matrix<Complex, Cols, Cols> linalg::SVD< Mat >::VT

SVD member variables.

right singular vectors

Definition at line 41 of file svd.hpp.


The documentation for this struct was generated from the following file: