maal::boost::MatrixSvd Class Reference

#include <jrl/mal/boostmatrixsvd.hh>

Inheritance diagram for maal::boost::MatrixSvd:
[legend]
Collaboration diagram for maal::boost::MatrixSvd:
[legend]

Public Member Functions

 MatrixSvd (const unsigned int rows=0, const unsigned int cols=0)
 
 MatrixSvd (InternalMatrix *clone, const bool=false)
 
 MatrixSvd (const MatrixSvd &copy)
 
virtual MatrixpseudoInverse (Matrix &invMatrix, const FloatType threshold=1e-6, Matrix *Uref=NULL, Vector *Sref=NULL, Matrix *Vref=NULL) const
 Compute the pseudo-inverse of the matrix. More...
 
virtual MatrixdampedInverse (Matrix &invMatrix, const FloatType threshold=1e-6, Matrix *Uref=NULL, Vector *Sref=NULL, Matrix *Vref=NULL) const
 Compute the pseudo-inverse of the matrix. More...
 
virtual MatrixpseudoInverse (Matrix &invMatrix, const FloatType threshold=1e-6, Matrix *Uref=NULL, Vector *Sref=NULL, Matrix *Vref=NULL) const
 Compute the pseudo-inverse of the matrix. More...
 
Matrix pseudoInverse (const FloatType threshold=1e-6, Matrix *U=NULL, Vector *S=NULL, Matrix *V=NULL) const
 
virtual MatrixdampedInverse (Matrix &invMatrix, const FloatType threshold=1e-6, Matrix *Uref=NULL, Vector *Sref=NULL, Matrix *Vref=NULL) const
 Compute the pseudo-inverse of the matrix. More...
 
Matrix dampedInverse (const FloatType threshold=1e-6, Matrix *U=NULL, Vector *S=NULL, Matrix *V=NULL) const
 
- Public Member Functions inherited from maal::boost::Matrix
 Matrix (const unsigned int rows=0, const unsigned int cols=0)
 Classical constructor. More...
 
 Matrix (InternalMatrix *clone, const bool proprio=false)
 Build only the capsule around a already existing boost vector object. More...
 
 Matrix (const Matrix &copy)
 Build a new internal vector from existing boost vector object by copying the data. More...
 
virtual ~Matrix (void)
 
InternalMatrixaccessToMotherLib (void)
 Access to the boost internal vector. More...
 
const InternalMatrixaccessToMotherLib (void) const
 Access to the boost internal vector. More...
 
MatrixinitFromMotherLib (const InternalMatrix &bv)
 Copy the values and data of an existing boost vector. More...
 
Matrixresize (const unsigned int nbRows, const unsigned int nbCols, const bool setZero=true)
 
unsigned int nbRows (void) const
 Get the number of rows. More...
 
unsigned int nbCols (void) const
 Get the number of columns. More...
 
MatrixsetZero (void)
 
MatrixsetIdentity (void)
 
Matrixfill (const FloatType value)
 
FloatType determinant (void) const
 
FloatType trace (void) const
 Not implemented yet. More...
 
FloatType norm (void) const
 Not implemented yet. More...
 
FloatType norm1 (void) const
 Norm 1 sum( |xi| )
More...
 
FloatType normInfty (void) const
 
FloatType max (void) const
 Not implemented yet. More...
 
FloatType min (void) const
 Not implemented yet. More...
 
FloatType sumSquare (void) const
 Not implemented yet. More...
 
Matrixtranspose (Matrix &At) const
 
Matrix transpose (void) const
 
Matrixinverse (Matrix &invMatrix) const
 Compute the inverse of the matrix. More...
 
Matrix inverse (void) const
 
Matrix pseudoInverse (const FloatType threshold=1e-6, Matrix *U=NULL, Vector *S=NULL, Matrix *V=NULL) const
 
Matrix dampedInverse (const FloatType threshold=1e-6, Matrix *U=NULL, Vector *S=NULL, Matrix *V=NULL) const
 
Matrixopposite (Matrix &res) const
 Compute the opposite of the matrix -M. More...
 
Matrix opposite (void) const
 Compute the opposite of the matrix -M. More...
 
FloatTypedatablock (void)
 
const FloatTypedatablock (void) const
 
Matrixextract (const int top, const int left, const int nbrows, const int nbcols, Matrix &C) const
 
Matrix extract (const int top, const int left, const int nbrows, const int nbcols)
 
const FloatTypeelementAt (const int row, const int col) const
 
FloatTypeelementAt (const int row, const int col)
 
const FloatTypeelementAt (const int elmt) const
 
FloatTypeelementAt (const int elmt)
 
Vector getDiagonal (void) const
 
VectorgetDiagonal (Vector &vector) const
 
MatrixsetDiagonal (const Vector &vector)
 
MatrixstackMatrix (const Matrix &, Matrix &C) const
 
Matrix stackMatrix (const Matrix &B) const
 
MatrixjuxtaposeMatrix (const Matrix &, Matrix &C) const
 
Matrix juxtaposeMatrix (const Matrix &B) const
 
Matrixoperator+= (const Matrix &m1)
 
Matrixoperator-= (const Matrix &m1)
 
Matrixoperator*= (const Matrix &m1)
 
Matrixoperator*= (const FloatType x)
 
const FloatTypeoperator() (const int i, const int j) const
 
FloatTypeoperator() (const int i, const int j)
 
const FloatTypeoperator() (const int n) const
 
FloatTypeoperator() (const int n)
 
Matrixoperator= (const Matrix &m1)
 
Matrix multiply (const Matrix &B) const
 
Matrixmultiply (const Matrix &B, Matrix &C) const
 
Vector multiply (const Vector &v) const
 
Vectormultiply (const Vector &v, Vector &res) const
 
Matrix addition (const Matrix &B) const
 
Matrixaddition (const Matrix &B, Matrix &C) const
 
Matrix substraction (const Matrix &B) const
 
Matrixsubstraction (const Matrix &B, Matrix &C) const
 
Matrix multiply (const FloatType x) const
 
Matrixmultiply (const FloatType x, Matrix &C) const
 
Matrix addition (const FloatType x) const
 
Matrixaddition (const FloatType x, Matrix &C) const
 
Matrix substraction (const FloatType x) const
 
Matrixsubstraction (const FloatType x, Matrix &C) const
 
Matrix division (const FloatType x) const
 
Matrixdivision (const FloatType x, Matrix &C) const
 
bool autoresize (void)
 

Protected Member Functions

bool reviseMemory (void) const
 
void initSvdMemory (void) const
 

Protected Attributes

size_t nbrows
 
size_t nbcols
 
size_t nmajor
 
size_t nminor
 
bool toTranspose
 
mutable ::boost::numeric::ublas::matrix< FloatType,::boost::numeric::ublas::column_major > McolMajor
 
mutable ::boost::numeric::ublas::matrix< FloatType,::boost::numeric::ublas::column_major > U
 
mutable ::boost::numeric::ublas::matrix< FloatType,::boost::numeric::ublas::column_major > VT
 
mutable ::boost::numeric::ublas::vector< FloatTypes
 
mutable ::boost::numeric::ublas::vector< double > w
 
mutable ::boost::numeric::ublas::vector< FloatTypesp
 
int lw
 
int lda
 
int lu
 
int lvt
 
unsigned int rankJ
 

Additional Inherited Members

- Public Types inherited from maal::boost::Matrix
typedef ::boost::numeric::ublas::matrix< FloatTypeInternalMatrix
 
- Public Attributes inherited from maal::boost::Matrix
InternalMatrix staticMatrix
 
InternalMatrixdynamicMatrix
 
InternalMatrixmatrix
 
bool proprio
 
- Static Public Attributes inherited from maal::boost::Matrix
static const bool AUTORESIZE = true
 
static const bool CHECKRESIZE = true
 
- Static Protected Member Functions inherited from maal::boost::Matrix
static void _resize (InternalMatrix &mat1, const InternalMatrix &mat2)
 
static bool _checksize (const InternalMatrix &mat1, const InternalMatrix &mat2)
 
static bool _checksizeVerb (const InternalMatrix &mat1, const InternalMatrix &mat2)
 
static bool _checksize (const InternalMatrix &mat1, const unsigned int s1, const unsigned int s2)
 
static bool _checksizeVerb (const InternalMatrix &mat1, const unsigned int s1, const unsigned int s2)
 
static bool _checksizeProd (const InternalMatrix &mat1, const InternalMatrix &mat2)
 
static bool _checksizeProdVerb (const InternalMatrix &mat1, const InternalMatrix &mat2)
 
static void _resizeProd (InternalMatrix &res, const InternalMatrix &mat1, const InternalMatrix &mat2)
 
static bool _checksizeProd (const InternalMatrix &mat1, const Vector::InternalVector &vct)
 
static bool _checksizeProdVerb (const InternalMatrix &mat1, const Vector::InternalVector &vct)
 
static void _resizeProd (Vector::InternalVector &res, const InternalMatrix &mat1)
 
static void _resizeInv (InternalMatrix &res, const InternalMatrix &mat2)
 
static bool _checksizeSquare (const InternalMatrix &mat1)
 
static bool _checksizeSquareVerb (const InternalMatrix &mat1)
 

Constructor & Destructor Documentation

◆ MatrixSvd() [1/3]

maal::boost::MatrixSvd::MatrixSvd ( const unsigned int  rows = 0,
const unsigned int  cols = 0 
)
inline

◆ MatrixSvd() [2/3]

maal::boost::MatrixSvd::MatrixSvd ( InternalMatrix clone,
const bool  = false 
)
inline

◆ MatrixSvd() [3/3]

maal::boost::MatrixSvd::MatrixSvd ( const MatrixSvd copy)
inline

Member Function Documentation

◆ dampedInverse() [1/3]

Matrix maal::boost::Matrix::dampedInverse
inline

◆ dampedInverse() [2/3]

virtual Matrix& maal::boost::Matrix::dampedInverse
inline

Compute the pseudo-inverse of the matrix.

By default, the function uses the dgesvd_ fortran routine. It should be provided by the host software.

◆ dampedInverse() [3/3]

virtual Matrix& maal::boost::MatrixSvd::dampedInverse ( Matrix invMatrix,
const FloatType  threshold = 1e-6,
Matrix Uref = NULL,
Vector Sref = NULL,
Matrix Vref = NULL 
) const
inlinevirtual

Compute the pseudo-inverse of the matrix.

By default, the function uses the dgesvd_ fortran routine. It should be provided by the host software.

Reimplemented from maal::boost::Matrix.

References maal::boost::Matrix::_resizeInv(), dgesvd_(), initSvdMemory(), lda, lu, lvt, lw, maal::boost::Matrix::matrix, McolMajor, MRAWDATA, nbcols, nbrows, nminor, rankJ, s, sp, toTranspose, U, VRAWDATA, VT, and w.

◆ initSvdMemory()

void maal::boost::MatrixSvd::initSvdMemory ( void  ) const
inlineprotected

◆ pseudoInverse() [1/3]

Matrix maal::boost::Matrix::pseudoInverse
inline

◆ pseudoInverse() [2/3]

virtual Matrix& maal::boost::Matrix::pseudoInverse
inline

Compute the pseudo-inverse of the matrix.

By default, the function uses the dgesvd_ fortran routine. It should be provided by the host software.

◆ pseudoInverse() [3/3]

virtual Matrix& maal::boost::MatrixSvd::pseudoInverse ( Matrix invMatrix,
const FloatType  threshold = 1e-6,
Matrix Uref = NULL,
Vector Sref = NULL,
Matrix Vref = NULL 
) const
inlinevirtual

Compute the pseudo-inverse of the matrix.

By default, the function uses the dgesvd_ fortran routine. It should be provided by the host software.

Reimplemented from maal::boost::Matrix.

References maal::boost::Matrix::_resizeInv(), dgesvd_(), initSvdMemory(), lda, lu, lvt, lw, maal::boost::Matrix::matrix, McolMajor, MRAWDATA, nbcols, nbrows, nminor, rankJ, s, sp, toTranspose, U, VRAWDATA, VT, and w.

◆ reviseMemory()

bool maal::boost::MatrixSvd::reviseMemory ( void  ) const
inlineprotected

Member Data Documentation

◆ lda

int maal::boost::MatrixSvd::lda
mutableprotected

◆ lu

int maal::boost::MatrixSvd::lu
protected

Referenced by dampedInverse(), and pseudoInverse().

◆ lvt

int maal::boost::MatrixSvd::lvt
protected

Referenced by dampedInverse(), and pseudoInverse().

◆ lw

int maal::boost::MatrixSvd::lw
mutableprotected

◆ McolMajor

mutable ::boost::numeric::ublas::matrix<FloatType,::boost::numeric::ublas::column_major> maal::boost::MatrixSvd::McolMajor
protected

◆ nbcols

size_t maal::boost::MatrixSvd::nbcols
protected

◆ nbrows

size_t maal::boost::MatrixSvd::nbrows
mutableprotected

◆ nmajor

size_t maal::boost::MatrixSvd::nmajor
protected

Referenced by initSvdMemory().

◆ nminor

size_t maal::boost::MatrixSvd::nminor
protected

◆ rankJ

unsigned int maal::boost::MatrixSvd::rankJ
mutableprotected

Referenced by dampedInverse(), and pseudoInverse().

◆ s

mutable ::boost::numeric::ublas::vector<FloatType> maal::boost::MatrixSvd::s
protected

◆ sp

mutable ::boost::numeric::ublas::vector<FloatType> maal::boost::MatrixSvd::sp
protected

◆ toTranspose

bool maal::boost::MatrixSvd::toTranspose
mutableprotected

◆ U

mutable ::boost::numeric::ublas::matrix<FloatType,::boost::numeric::ublas::column_major> maal::boost::MatrixSvd::U
protected

◆ VT

mutable ::boost::numeric::ublas::matrix<FloatType,::boost::numeric::ublas::column_major> maal::boost::MatrixSvd::VT
protected

◆ w

mutable ::boost::numeric::ublas::vector<double> maal::boost::MatrixSvd::w
protected