Matrix class that include the boost::ublas::matrix. More...
#include <jrl/mal/boostmatrix.hh>
Public Types | |
typedef ::boost::numeric::ublas::matrix< FloatType > | InternalMatrix |
Public Member Functions | |
Constructors | |
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 ©) | |
Build a new internal vector from existing boost vector object by copying the data. More... | |
virtual | ~Matrix (void) |
InternalMatrix & | accessToMotherLib (void) |
Access to the boost internal vector. More... | |
const InternalMatrix & | accessToMotherLib (void) const |
Access to the boost internal vector. More... | |
Matrix & | initFromMotherLib (const InternalMatrix &bv) |
Copy the values and data of an existing boost vector. More... | |
Modifiors | |
Matrix & | resize (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... | |
Matrix & | setZero (void) |
Matrix & | setIdentity (void) |
Matrix & | fill (const FloatType value) |
Scalar Operator E->R | |
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... | |
Inverse | |
Matrix & | transpose (Matrix &At) const |
Matrix | transpose (void) const |
Matrix & | inverse (Matrix &invMatrix) const |
Compute the inverse of the matrix. More... | |
Matrix | inverse (void) const |
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. More... | |
Matrix | pseudoInverse (const FloatType threshold=1e-6, Matrix *U=NULL, Vector *S=NULL, Matrix *V=NULL) const |
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. More... | |
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. More... | |
Matrix | opposite (void) const |
Compute the opposite of the matrix -M. More... | |
Accessors | |
Access to an element, a block of element or the hidden double-array matrix. | |
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) |
Bonus | |
Additional functions, not implemented yet. | |
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 |
Public Attributes | |
InternalMatrix | staticMatrix |
InternalMatrix * | dynamicMatrix |
InternalMatrix & | matrix |
bool | proprio |
Static Public Attributes | |
static const bool | AUTORESIZE = true |
static const bool | CHECKRESIZE = true |
Operators | |
Classical operators: use v1 + v2 for addition, v1(i) for i-th element... | |
class | Vector |
Matrix | operator+ (const Matrix &m1, const Matrix &m2) |
Matrix | operator- (const Matrix &m1, const Matrix &m2) |
Matrix | operator* (const Matrix &m1, const Matrix &m2) |
Matrix | operator- (const Matrix &m) |
Vector | operator* (const Matrix &M, const Vector &v1) |
Vector | operator* (const Vector &v1, const Matrix &M) |
Matrix | operator+ (const FloatType x, const Matrix &m1) |
Matrix | operator- (const FloatType x, const Matrix &m1) |
Matrix | operator* (const FloatType x, const Matrix &m1) |
Matrix | operator/ (const FloatType x, const Matrix &m1) |
Matrix | operator+ (const Matrix &m1, const FloatType x) |
Matrix | operator- (const Matrix &m1, const FloatType x) |
Matrix | operator* (const Matrix &m1, const FloatType x) |
Matrix | operator/ (const Matrix &m1, const FloatType x) |
std::ostream & | operator<< (std::ostream &os, const Matrix &m1) |
std::istream & | operator>> (std::istream &is, Matrix &v1) |
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) |
Autoresize internal | |
bool | autoresize (void) |
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) |
Matrix class that include the boost::ublas::matrix.
The class encapsulates the ublas::matrix object, and implement a set of standard functions. When the maal::boost::Matrix object is constructed, it automatically builds the internal ublas::matrix object. The internal object can be access through accessToMotherLib. Finally, it is possible to build the capsule around an existing boost ublas::matrix through the appropriate constructor.
typedef ::boost::numeric::ublas::matrix<FloatType> maal::boost::Matrix::InternalMatrix |
|
inline |
|
inline |
Build only the capsule around a already existing boost vector object.
|
inline |
Build a new internal vector from existing boost vector object by copying the data.
|
inlinevirtual |
References dynamicMatrix, and proprio.
|
inlinestaticprotected |
References CHECKRESIZE.
Referenced by addition(), elementAt(), extract(), and substraction().
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References CHECKRESIZE.
Referenced by multiply().
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References CHECKRESIZE.
Referenced by determinant().
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References CHECKRESIZE.
|
inlinestaticprotected |
References AUTORESIZE.
Referenced by dampedInverse().
|
inlinestaticprotected |
References AUTORESIZE.
Referenced by dampedInverse(), maal::boost::MatrixSvd::dampedInverse(), inverse(), pseudoInverse(), and maal::boost::MatrixSvd::pseudoInverse().
|
inlinestaticprotected |
References AUTORESIZE.
Referenced by multiply().
|
inlinestaticprotected |
References AUTORESIZE.
|
inline |
Access to the boost internal vector.
References matrix.
|
inline |
Access to the boost internal vector.
References matrix.
References _checksize(), MAAL_CHECKVERBOSE, and matrix.
|
inline |
References AUTORESIZE.
|
inline |
References dampedInverse(), nbCols(), and nbRows().
|
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 in maal::boost::MatrixSvd.
References _resize(), _resizeInv(), dgesvd_(), matrix, MRAWDATA, nbCols(), nbRows(), and VRAWDATA.
Referenced by dampedInverse().
|
inline |
|
inline |
References _checksizeSquareVerb(), and matrix.
|
inline |
References elementAt(), and nbRows().
|
inline |
References elementAt(), and nbRows().
|
inline |
References _checksize(), MAAL_CHECKVERBOSE, and matrix.
|
inline |
References _checksize(), MAAL_CHECKVERBOSE, and matrix.
Referenced by elementAt(), and operator()().
|
inline |
References extract().
|
inline |
References _checksize(), MAAL_CHECKVERBOSE, and matrix.
Referenced by extract().
References matrix.
Referenced by setDiagonal().
References matrix, nbCols(), nbRows(), and maal::boost::Vector::resize().
|
inline |
|
inline |
Copy the values and data of an existing boost vector.
References matrix.
Compute the inverse of the matrix.
The matrix has to be invertible. By default, the function uses the dgesvd_ fortran routine. It should be provided by the host software (i.e. lapack).
References _resizeInv(), and matrix.
References ML_NOT_IMPLEMENTED.
Referenced by juxtaposeMatrix().
References juxtaposeMatrix().
|
inline |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
|
inline |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
References matrix.
References _checksizeProd(), _resizeProd(), MAAL_CHECKVERBOSE, and matrix.
References _checksizeProd(), MAAL_CHECKVERBOSE, matrix, and maal::boost::Vector::vector.
|
inline |
Get the number of columns.
References matrix.
Referenced by addition(), dampedInverse(), division(), getDiagonal(), inverse(), multiply(), pseudoInverse(), resize(), substraction(), and transpose().
|
inline |
Get the number of rows.
References matrix.
Referenced by addition(), dampedInverse(), division(), elementAt(), getDiagonal(), inverse(), multiply(), pseudoInverse(), resize(), substraction(), and transpose().
|
inline |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
|
inline |
References matrix.
|
inline |
References elementAt().
|
inline |
References elementAt().
Compute the opposite of the matrix -M.
References matrix.
|
inline |
Compute the opposite of the matrix -M.
|
inline |
References nbCols(), nbRows(), and pseudoInverse().
|
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 in maal::boost::MatrixSvd.
References _resizeInv(), dgesvd_(), matrix, MRAWDATA, nbCols(), nbRows(), and VRAWDATA.
Referenced by pseudoInverse().
|
inline |
References fill(), matrix, and maal::boost::Vector::size().
References ML_NOT_IMPLEMENTED.
Referenced by stackMatrix().
References stackMatrix().
References nbCols(), nbRows(), and substraction.
References nbCols(), nbRows(), and substraction.
References _checksize(), MAAL_CHECKVERBOSE, and matrix.
|
inline |
Not implemented yet.
References ML_NOT_IMPLEMENTED.
|
inline |
Not implemented yet.
Referenced by addition().
Referenced by division().
Referenced by multiply(), and operator*=().
|
friend |
|
friend |
Referenced by substraction().
|
friend |
|
static |
Referenced by _resize(), _resizeInv(), _resizeProd(), and autoresize().
|
static |
Referenced by _checksize(), _checksizeProd(), _checksizeProdVerb(), _checksizeSquare(), _checksizeSquareVerb(), and _checksizeVerb().
InternalMatrix* maal::boost::Matrix::dynamicMatrix |
Referenced by ~Matrix().
InternalMatrix& maal::boost::Matrix::matrix |
Referenced by accessToMotherLib(), addition(), dampedInverse(), maal::boost::MatrixSvd::dampedInverse(), datablock(), determinant(), division(), elementAt(), extract(), fill(), getDiagonal(), initFromMotherLib(), maal::boost::MatrixSvd::initSvdMemory(), inverse(), multiply(), nbCols(), nbRows(), norm1(), normInfty(), operator()(), operator*=(), operator+=(), operator-=(), operator=(), opposite(), pseudoInverse(), maal::boost::MatrixSvd::pseudoInverse(), resize(), maal::boost::MatrixSvd::reviseMemory(), setDiagonal(), setIdentity(), setZero(), substraction(), and transpose().
bool maal::boost::Matrix::proprio |
Referenced by ~Matrix().
InternalMatrix maal::boost::Matrix::staticMatrix |
Referenced by Matrix().