Loading...
Searching...
No Matches
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 Matrix & pseudoInverse (Matrix &invMatrix, const FloatType threshold=1e-6, Matrix *Uref=NULL, Vector *Sref=NULL, Matrix *Vref=NULL) const
 Compute the pseudo-inverse of the matrix.
 
virtual Matrix & dampedInverse (Matrix &invMatrix, const FloatType threshold=1e-6, Matrix *Uref=NULL, Vector *Sref=NULL, Matrix *Vref=NULL) const
 Compute the pseudo-inverse of the matrix.
 
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
 
- Public Member Functions inherited from maal::boost::Matrix
 Matrix (const unsigned int rows=0, const unsigned int cols=0)
 Classical constructor.
 
 Matrix (InternalMatrix *clone, const bool proprio=false)
 Build only the capsule around a already existing boost vector object.
 
 Matrix (const Matrix &copy)
 Build a new internal vector from existing boost vector object by copying the data.
 
virtual ~Matrix (void)
 
InternalMatrix & accessToMotherLib (void)
 Access to the boost internal vector.
 
const InternalMatrix & accessToMotherLib (void) const
 Access to the boost internal vector.
 
Matrix & initFromMotherLib (const InternalMatrix &bv)
 Copy the values and data of an existing boost vector.
 
Matrix & resize (const unsigned int nbRows, const unsigned int nbCols, const bool setZero=true)
 
unsigned int nbRows (void) const
 Get the number of rows.
 
unsigned int nbCols (void) const
 Get the number of columns.
 
Matrix & setZero (void)
 
Matrix & setIdentity (void)
 
Matrix & fill (const FloatType value)
 
FloatType determinant (void) const
 
FloatType trace (void) const
 Not implemented yet.
 
FloatType norm (void) const
 Not implemented yet.
 
FloatType norm1 (void) const
 Norm 1 sum( |xi| )
 
FloatType normInfty (void) const
 
FloatType max (void) const
 Not implemented yet.
 
FloatType min (void) const
 Not implemented yet.
 
FloatType sumSquare (void) const
 Not implemented yet.
 
Matrix & transpose (Matrix &At) const
 
Matrix transpose (void) const
 
Matrix & inverse (Matrix &invMatrix) const
 Compute the inverse of the matrix.
 
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
 
Matrix & opposite (Matrix &res) const
 Compute the opposite of the matrix -M.
 
Matrix opposite (void) const
 Compute the opposite of the matrix -M.
 
FloatType * datablock (void)
 
const FloatType * datablock (void) const
 
Matrix & extract (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 FloatType & elementAt (const int row, const int col) const
 
FloatType & elementAt (const int row, const int col)
 
const FloatType & elementAt (const int elmt) const
 
FloatType & elementAt (const int elmt)
 
Vector getDiagonal (void) const
 
Vector & getDiagonal (Vector &vector) const
 
Matrix & setDiagonal (const Vector &vector)
 
Matrix & stackMatrix (const Matrix &, Matrix &C) const
 
Matrix stackMatrix (const Matrix &B) const
 
Matrix & juxtaposeMatrix (const Matrix &, Matrix &C) const
 
Matrix juxtaposeMatrix (const Matrix &B) const
 
Matrix & operator+= (const Matrix &m1)
 
Matrix & operator-= (const Matrix &m1)
 
Matrix & operator*= (const Matrix &m1)
 
Matrix & operator*= (const FloatType x)
 
const FloatType & operator() (const int i, const int j) const
 
FloatType & operator() (const int i, const int j)
 
const FloatType & operator() (const int n) const
 
FloatType & operator() (const int n)
 
Matrix & operator= (const Matrix &m1)
 
Matrix multiply (const Matrix &B) const
 
Matrix & multiply (const Matrix &B, Matrix &C) const
 
Vector multiply (const Vector &v) const
 
Vector & multiply (const Vector &v, Vector &res) const
 
Matrix addition (const Matrix &B) const
 
Matrix & addition (const Matrix &B, Matrix &C) const
 
Matrix substraction (const Matrix &B) const
 
Matrix & substraction (const Matrix &B, Matrix &C) const
 
Matrix multiply (const FloatType x) const
 
Matrix & multiply (const FloatType x, Matrix &C) const
 
Matrix addition (const FloatType x) const
 
Matrix & addition (const FloatType x, Matrix &C) const
 
Matrix substraction (const FloatType x) const
 
Matrix & substraction (const FloatType x, Matrix &C) const
 
Matrix division (const FloatType x) const
 
Matrix & division (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< FloatType > s
 
mutable ::boost::numeric::ublas::vector< double > w
 
mutable ::boost::numeric::ublas::vector< FloatType > sp
 
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< FloatType > InternalMatrix
 
- Public Attributes inherited from maal::boost::Matrix
InternalMatrix staticMatrix
 
InternalMatrix * dynamicMatrix
 
InternalMatrix & matrix
 
bool proprio
 
- Static Public Attributes inherited from maal::boost::Matrix
static const bool AUTORESIZE = true
 
static const bool CHECKRESIZE = true
 
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/2]

Matrix maal::boost::Matrix::dampedInverse ( const FloatType threshold = 1e-6,
Matrix * U = NULL,
Vector * S = NULL,
Matrix * V = NULL ) const
inline

◆ dampedInverse() [2/2]

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(), initSvdMemory(), lda, lu, lvt, lw, maal::boost::Matrix::Matrix(), maal::boost::Matrix::matrix, McolMajor, MRAWDATA, nbcols, nbrows, nminor, rankJ, s, sp, toTranspose, U, maal::boost::Matrix::Vector, VRAWDATA, VT, and w.

◆ initSvdMemory()

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

◆ pseudoInverse() [1/2]

Matrix maal::boost::Matrix::pseudoInverse ( const FloatType threshold = 1e-6,
Matrix * U = NULL,
Vector * S = NULL,
Matrix * V = NULL ) const
inline

◆ pseudoInverse() [2/2]

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(), initSvdMemory(), lda, lu, lvt, lw, maal::boost::Matrix::Matrix(), maal::boost::Matrix::matrix, McolMajor, MRAWDATA, nbcols, nbrows, nminor, rankJ, s, sp, toTranspose, U, maal::boost::Matrix::Vector, 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