MFEM  v4.6.0
Finite element discretization library
Public Member Functions | List of all members
mfem::DenseMatrixSVD Class Reference

Class for Singular Value Decomposition of a DenseMatrix. More...

#include <densemat.hpp>

Public Member Functions

MFEM_DEPRECATED DenseMatrixSVD (DenseMatrix &M, bool left_singular_vectors=false, bool right_singular_vectors=false)
 Constructor for the DenseMatrixSVD. More...
 
MFEM_DEPRECATED DenseMatrixSVD (int h, int w, bool left_singular_vectors=false, bool right_singular_vectors=false)
 Constructor for the DenseMatrixSVD. More...
 
 DenseMatrixSVD (DenseMatrix &M, char left_singular_vectors='A', char right_singular_vectors='A')
 Constructor for the DenseMatrixSVD. More...
 
 DenseMatrixSVD (int h, int w, char left_singular_vectors='A', char right_singular_vectors='A')
 Constructor for the DenseMatrixSVD. More...
 
void Eval (DenseMatrix &M)
 Evaluate the SVD. More...
 
VectorSingularvalues ()
 Return singular values. More...
 
double Singularvalue (int i)
 Return specific singular value. More...
 
DenseMatrixLeftSingularvectors ()
 Return left singular vectors. More...
 
DenseMatrixRightSingularvectors ()
 Return right singular vectors. More...
 
 ~DenseMatrixSVD ()
 

Detailed Description

Class for Singular Value Decomposition of a DenseMatrix.

Singular Value Decomposition (SVD) of a DenseMatrix with the use of the DGESVD driver from LAPACK.

Definition at line 948 of file densemat.hpp.

Constructor & Destructor Documentation

◆ DenseMatrixSVD() [1/4]

mfem::DenseMatrixSVD::DenseMatrixSVD ( DenseMatrix M,
bool  left_singular_vectors = false,
bool  right_singular_vectors = false 
)

Constructor for the DenseMatrixSVD.

Constructor for the DenseMatrixSVD with LAPACK. The parameters for the left and right singular vectors can be choosen according to the parameters for the LAPACK DGESVD.

Parameters
[in]Mmatrix to set the size to n=M.Height(), m=M.Width()
[in]left_singular_vectorsoptional parameter to define if first left singular vectors should be computed
[in]right_singular_vectorsoptional parameter to define if first right singular vectors should be computed

Definition at line 4134 of file densemat.cpp.

◆ DenseMatrixSVD() [2/4]

mfem::DenseMatrixSVD::DenseMatrixSVD ( int  h,
int  w,
bool  left_singular_vectors = false,
bool  right_singular_vectors = false 
)

Constructor for the DenseMatrixSVD.

Constructor for the DenseMatrixSVD with LAPACK. The parameters for the left and right singular vectors can be choosen according to the parameters for the LAPACK DGESVD.

Parameters
[in]hheight of the matrix
[in]wwidth of the matrix
[in]left_singular_vectorsoptional parameter to define if first left singular vectors should be computed
[in]right_singular_vectorsoptional parameter to define if first right singular vectors should be computed

Definition at line 4145 of file densemat.cpp.

◆ DenseMatrixSVD() [3/4]

mfem::DenseMatrixSVD::DenseMatrixSVD ( DenseMatrix M,
char  left_singular_vectors = 'A',
char  right_singular_vectors = 'A' 
)

Constructor for the DenseMatrixSVD.

Constructor for the DenseMatrixSVD with LAPACK. The parameters for the left and right singular vectors can be choosen according to the parameters for the LAPACK DGESVD.

Parameters
[in]Mmatrix to set the size to n=M.Height(), m=M.Width()
[in]left_singular_vectorsoptional parameter to define which left singular vectors should be computed
[in]right_singular_vectorsoptional parameter to define which right singular vectors should be computed

Options for computation of singular vectors:

'A': All singular vectors are computed (default)

'S': The first min(n,m) singular vectors are computed

'N': No singular vectors are computed

Definition at line 4156 of file densemat.cpp.

◆ DenseMatrixSVD() [4/4]

mfem::DenseMatrixSVD::DenseMatrixSVD ( int  h,
int  w,
char  left_singular_vectors = 'A',
char  right_singular_vectors = 'A' 
)

Constructor for the DenseMatrixSVD.

Constructor for the DenseMatrixSVD with LAPACK. The parameters for the left and right singular vectors can be choosen according to the parameters for the LAPACK DGESVD.

Parameters
[in]hheight of the matrix
[in]wwidth of the matrix
[in]left_singular_vectorsoptional parameter to define which left singular vectors should be computed
[in]right_singular_vectorsoptional parameter to define which right singular vectors should be computed

Options for computation of singular vectors:

'A': All singular vectors are computed (default)

'S': The first min(n,m) singular vectors are computed

'N': No singular vectors are computed

Definition at line 4167 of file densemat.cpp.

◆ ~DenseMatrixSVD()

mfem::DenseMatrixSVD::~DenseMatrixSVD ( )

Definition at line 4231 of file densemat.cpp.

Member Function Documentation

◆ Eval()

void mfem::DenseMatrixSVD::Eval ( DenseMatrix M)

Evaluate the SVD.

Call of the DGESVD driver from LAPACK for the DenseMatrix M. The singular vectors are computed according to the setup in the call of the constructor.

Parameters
[in]MDenseMatrix the SVD should be evaluated for

Definition at line 4190 of file densemat.cpp.

◆ LeftSingularvectors()

DenseMatrix& mfem::DenseMatrixSVD::LeftSingularvectors ( )
inline

Return left singular vectors.

Returns
U DenseMatrix containing left singular vectors

Definition at line 1079 of file densemat.hpp.

◆ RightSingularvectors()

DenseMatrix& mfem::DenseMatrixSVD::RightSingularvectors ( )
inline

Return right singular vectors.

Returns
Vt DenseMatrix containing right singular vectors

Definition at line 1086 of file densemat.hpp.

◆ Singularvalue()

double mfem::DenseMatrixSVD::Singularvalue ( int  i)
inline

Return specific singular value.

Returns
sv(i) i-th singular value

Definition at line 1072 of file densemat.hpp.

◆ Singularvalues()

Vector& mfem::DenseMatrixSVD::Singularvalues ( )
inline

Return singular values.

Returns
sv Vector containing all singular values

Definition at line 1065 of file densemat.hpp.


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