yat  0.20.3pre
Public Types | Public Member Functions | List of all members
theplu::yat::utility::SVD Class Reference

Singular Value Decomposition. More...

#include <yat/utility/SVD.h>

Public Types

enum  SVDalgorithm { GolubReinsch, ModifiedGolubReinsch, Jacobi }
 

Public Member Functions

 SVD (const MatrixBase &Ain)
 Constructs an SVD object using the matrix Ain as only input. The input matrix is copied for further use in the object. More...
 
 SVD (MatrixMutable &&Ain)
 
 ~SVD (void)
 The destructor.
 
void decompose (SVDalgorithm algo=GolubReinsch)
 This function will perform SVD with the method specified by algo. More...
 
const Vectors (void) const
 Access to the s vector. More...
 
void solve (const VectorBase &b, Vector &x)
 Solve the system $ Ax=b $ using the decomposition of A. More...
 
const MatrixU (void) const
 Access to the U matrix. More...
 
const MatrixV (void) const
 Access to the V matrix. More...
 

Detailed Description

Singular Value Decomposition.

Class encapsulating GSL methods for singular value decomposition, SVD.

A = U S V' = (MxN)(NxN)(NxN) = (MxN)
A = Matrix to be decomposed, size MxN
U = Orthogonal matrix, size MxN
S = Diagonal matrix of singular values, size NxN
V = Orthogonal matrix, size NxN

Member Enumeration Documentation

◆ SVDalgorithm

A number of SVD algorithms are implemented in GSL. They have their strengths and weaknesses.

See also
GSL's SVD documentation.

Constructor & Destructor Documentation

◆ SVD() [1/2]

theplu::yat::utility::SVD::SVD ( const MatrixBase Ain)
explicit

Constructs an SVD object using the matrix Ain as only input. The input matrix is copied for further use in the object.

Note
Number of rows must be equal or larger than number of columns.

◆ SVD() [2/2]

theplu::yat::utility::SVD::SVD ( MatrixMutable &&  Ain)
explicit

Same behaviour as const& constructor, but Ain is moved rather than copied.

Since
new in yat 0.16

Member Function Documentation

◆ decompose()

void theplu::yat::utility::SVD::decompose ( SVDalgorithm  algo = GolubReinsch)

This function will perform SVD with the method specified by algo.

Exceptions
GSL_errorif the underlying GSL function fails.

◆ s()

const Vector& theplu::yat::utility::SVD::s ( void  ) const

Access to the s vector.

Returns
A copy of the s vector.
Note
If decompose() has not been run the outcome of the call is undefined.

◆ solve()

void theplu::yat::utility::SVD::solve ( const VectorBase b,
Vector x 
)

Solve the system $ Ax=b $ using the decomposition of A.

Note
If decompose() has not been run the outcome of the call is undefined.
Exceptions
GSL_errorif the underlying GSL function fails.

◆ U()

const Matrix& theplu::yat::utility::SVD::U ( void  ) const

Access to the U matrix.

Returns
A copy of the U matrix.
Note
If decompose() has not been run the outcome of the call is undefined.

◆ V()

const Matrix& theplu::yat::utility::SVD::V ( void  ) const

Access to the V matrix.

Returns
A copy of the V matrix.
Note
If decompose() has not been run the outcome of the call is undefined.

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

Generated on Sat Feb 18 2023 03:31:45 for yat by  doxygen 1.8.14