This template class extends the class "CMatrixTemplate" with many common operations with numerical matrixes. More...
#include <mrpt/math/CMatrixTemplateNumeric.h>


Public Types | |
| typedef CMatrixTemplate< T > | BASE |
| typedef CMatrixTemplateNumeric< T > | mrpt_autotype |
Public Member Functions | |
| DECLARE_MRPT_CONTAINER_TYPES DECLARE_MRPT_CONTAINER_IS_MATRIX DECLARE_MRPT_MATRIX_ITERATORS | CMatrixTemplateNumeric (const TPose2D &p) |
| CMatrixTemplateNumeric (const TPose3D &p) | |
| CMatrixTemplateNumeric (const TPose3DQuat &p) | |
| CMatrixTemplateNumeric (const TPoint2D &p) | |
| CMatrixTemplateNumeric (const TPoint3D &p) | |
| CMatrixTemplateNumeric (const mrpt::poses::CPose2D &p) | |
| CMatrixTemplateNumeric (const mrpt::poses::CPose3D &p) | |
| CMatrixTemplateNumeric (const mrpt::poses::CPose3DQuat &p) | |
| CMatrixTemplateNumeric (const mrpt::poses::CPoint2D &p) | |
| CMatrixTemplateNumeric (const mrpt::poses::CPoint3D &p) | |
| CMatrixTemplateNumeric () | |
| Default constructor, builds a 1x1 matrix. | |
| CMatrixTemplateNumeric (bool, bool, bool) | |
| Default constructor, builds a 0x0 matrix, with a signature identical to that of the fixed matrix constructor for uninitialized matrix constructor. | |
| CMatrixTemplateNumeric (size_t row, size_t col) | |
| Constructor. | |
| CMatrixTemplateNumeric (const CMatrixTemplate< T > &m, const size_t cropRowCount, const size_t cropColCount) | |
| Copy & crop constructor, which copies the given matrix but only up to the given size. | |
| template<size_t NROWS, size_t NCOLS> | |
| CMatrixTemplateNumeric (const CMatrixFixedNumeric< T, NROWS, NCOLS > &M) | |
| Copy constructor from a fixed-size matrix. | |
| template<size_t NROWS, size_t NCOLS> | |
| CMatrixTemplateNumeric & | operator= (const CMatrixFixedNumeric< T, NROWS, NCOLS > &M) |
| Copy operator from a fixed-size matrix. | |
| template<class R > | |
| CMatrixTemplateNumeric< T > & | operator= (const CMatrixTemplate< R > &m) |
| Assignment operator of other types. | |
| template<class R > | |
| CMatrixTemplateNumeric (const CMatrixTemplate< R > &m) | |
| Copy constructor from a matrix of any type. | |
| template<typename V , size_t N> | |
| CMatrixTemplateNumeric (size_t row, size_t col, V(&theArray)[N]) | |
| Constructor from a given size and a C array. | |
| template<typename V > | |
| CMatrixTemplateNumeric (size_t row, size_t col, const V &theVector) | |
| Constructor from a given size and a STL container (std::vector, std::list,. | |
| virtual | ~CMatrixTemplateNumeric () |
| Destructor. | |
| template<typename V , size_t N> | |
| CMatrixTemplateNumeric & | operator= (V(&theArray)[N]) |
| Assignment operator for initializing from a C array (The matrix must be set to the correct size before invoking this asignament). | |
| void | setSize (size_t row, size_t col) |
| Changes the size of matrix, maintaining its previous content as possible and padding with zeros where applicable. | |
| void | resize (size_t row, size_t col) |
| Changes the size of matrix, maintaining its previous content as possible and padding with zeros where applicable. | |
| void | resize (const CMatrixTemplateSize &siz) |
| This method just checks has no effects in this class, but raises an exception if the expected size does not match. | |
| void | laplacian (CMatrixTemplateNumeric< T > &ret) const |
| Computes the laplacian of the matrix, useful for graph matrixes. | |
| void | svd (CMatrixTemplateNumeric< T > &U, std::vector< T > &W, CMatrixTemplateNumeric< T > &V) const |
| Computes the SVD (Singular Value Decomposition) of the matrix. | |
| CMatrixTemplateNumeric< T > | largestEigenvector (T resolution=0.01f, size_t maxIterations=6, int *out_Iterations=NULL, float *out_estimatedResolution=NULL) const |
| Efficiently computes only the biggest eigenvector of the matrix using the Power Method, and returns it as a column vector. | |
| CMatrixTemplateNumeric< T > & | operator^= (const unsigned int &pow) |
| combined power and assignment operator | |
| void | scalarPow (T s) |
| Scalar power of all elements to a given power, this is diferent of ^ operator. | |
| void | zeros (const size_t row, const size_t col) |
| Set all elements to zero. | |
| void | zeros () |
| Set all elements to zero. | |
| void | ones (const size_t row, const size_t col) |
| Set all elements to one. | |
| void | ones () |
| Set all elements to one. | |
| void | unit (const size_t row) |
| Build an unit matrix. | |
| void | eye (const size_t size) |
| Build an unit matrix - this is a shortcut for unit(). | |
| void | unit () |
| Build an unit matrix. | |
| void | eye () |
| Build an unit matrix - this is a shortcut for unit(). | |
| CMatrixTemplateNumeric< T > | solve (const CMatrixTemplateNumeric< T > &v) const |
| Solve the matrix as linear equations system. | |
| CMatrixTemplateNumeric< T > | adj () const |
| Computes the adjunt of matrix. | |
| T | cofact (size_t row, size_t col) const |
| Computes the rank of the matrix using a slight variation of Gauss method. | |
| T | cond () |
| Computes the cond. | |
| bool | isDiagonal () const |
| Checks for matrix type. | |
| bool | isScalar () const |
| Checks for matrix type. | |
| bool | isUnit () const |
| Checks for matrix type. | |
| bool | isNull () const |
| Checks for matrix type. | |
| bool | isSymmetric () const |
| Checks for matrix type. | |
| bool | isSkewSymmetric () const |
| Checks for matrix type. | |
| bool | isUpperTriangular () const |
| Checks for matrix type. | |
| bool | isLowerTriangular () const |
| Checks for matrix type. | |
| void | matrix_floor () |
| Round towards minus infinity modifying the matrix (by AJOGD @ JAN-2007). | |
| void | matrix_floor (CMatrixTemplateNumeric< T > &out) |
| Round towards minus infinity (by AJOGD @ JAN-2007). | |
| void | matrix_ceil () |
| Round towards plus infinity (by AJOGD @ JAN-2007). | |
| void | find_index_max_value (size_t &umax, size_t &vmax, T &max_val) const |
| Finds the maximum value in the matrix, and returns its position. | |
| T | maximumDiagonal () const |
| Finds the maximum value in the diagonal of the matrix. | |
| void | find_index_min_value (size_t &umin, size_t &vmin, T &min_val) const |
| Finds the minimum value in the matrix, and returns its position. | |
| void | force_symmetry () |
| Force symmetry in the matrix (by AJOGD @ JAN-2007). | |
| void | mean (std::vector< T > &outMeanVector) const |
| Computes a row with the mean values of each column in the matrix. | |
| void | meanAndStd (std::vector< T > &outMeanVector, std::vector< T > &outStdVector) const |
| Computes a row with the mean values of each column in the matrix and the associated vector with the standard deviation of each column. | |
| void | meanAndStdAll (T &outMean, T &outStd) const |
| Computes the mean and standard deviation of all the elements in the matrix as a whole. | |
| void | asCol (CMatrixTemplateNumeric< T > &aux) const |
| void | asRow (CMatrixTemplateNumeric< T > &aux) const |
| void | findElementsPassingMahalanobisThreshold (double stdTimes, std::vector< size_t > &rowIndexes, std::vector< size_t > &colIndexes, bool below=false) const |
| Finds elements whose values are a given number of times above (or below) the mean, in 1D Mahalanobis distance. | |
| T | sum (size_t firstRow=0, size_t firstCol=0, size_t lastRow=std::numeric_limits< size_t >::max(), size_t lastCol=std::numeric_limits< size_t >::max()) const |
| Returns the sum of a given part of the matrix. | |
| void | multiplyByMatrixAndByTransposeNonSymmetric (const CMatrixTemplateNumeric< T > &C, CMatrixTemplateNumeric< T > &R, bool accumOnOutput=false, bool substractInsteadOfSum=false) const |
| Computes: R = H * C * H^t , where H is this matrix. | |
This template class extends the class "CMatrixTemplate" with many common operations with numerical matrixes.
The template can be instanced for data types: float, double, long double
The following operators have been implemented:
Implemented Operators | |
x=M(i,j) | This () operator is used to access/change the element at i'th row, j'th column. First index is 0. |
!M | The matrix inverse M-1 |
~M | The matrix transpose MT |
(M^n) | Power of a matrix: (M*M*M*...M) n times. Use parenthesis with this operator. Use "scalarPow" for the power of individual elements in the matrix. |
M1 = M2 | Assignment operator: Copy matrix M2 to M1 |
M1 == M2 | Logical comparison: Returns true or false if all elements are identical. |
x * M | Scalar multiplication |
M1 * M2 | Matrix multiplication, with the usual mathematical meaning |
M1 + M2 | Matrixes addition and substraction. |
M / x | Scalar division |
M1 / M2 | Equivalent to (M1 * M2-1) |
stream << M; | Write to a binary CStream, since this class is CSerializable |
stream >> M; | Read from a binary CStream, since this class is CSerializable |
See also this useful methods:
Definition at line 111 of file CMatrixTemplateNumeric.h.
| typedef CMatrixTemplate<T> mrpt::math::CMatrixTemplateNumeric< T >::BASE |
Definition at line 114 of file CMatrixTemplateNumeric.h.
| typedef CMatrixTemplateNumeric<T> mrpt::math::CMatrixTemplateNumeric< T >::mrpt_autotype |
Definition at line 115 of file CMatrixTemplateNumeric.h.
| DECLARE_MRPT_CONTAINER_TYPES DECLARE_MRPT_CONTAINER_IS_MATRIX DECLARE_MRPT_MATRIX_ITERATORS mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const TPose2D & | p | ) | [inline] |
Definition at line 122 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const TPose3D & | p | ) | [inline] |
Definition at line 123 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const TPose3DQuat & | p | ) | [inline] |
Definition at line 124 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const TPoint2D & | p | ) | [inline] |
Definition at line 125 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const TPoint3D & | p | ) | [inline] |
Definition at line 126 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const mrpt::poses::CPose2D & | p | ) | [inline] |
Definition at line 128 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const mrpt::poses::CPose3D & | p | ) | [inline] |
Definition at line 129 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const mrpt::poses::CPose3DQuat & | p | ) | [inline] |
Definition at line 130 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const mrpt::poses::CPoint2D & | p | ) | [inline] |
Definition at line 131 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const mrpt::poses::CPoint3D & | p | ) | [inline] |
Definition at line 132 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | ) |
Default constructor, builds a 1x1 matrix.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | bool | , | |
| bool | , | |||
| bool | ||||
| ) | [inline] |
Default constructor, builds a 0x0 matrix, with a signature identical to that of the fixed matrix constructor for uninitialized matrix constructor.
Definition at line 138 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | size_t | row, | |
| size_t | col | |||
| ) |
Constructor.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const CMatrixTemplate< T > & | m, | |
| const size_t | cropRowCount, | |||
| const size_t | cropColCount | |||
| ) | [inline] |
Copy & crop constructor, which copies the given matrix but only up to the given size.
Definition at line 146 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | M | ) | [inline, explicit] |
Copy constructor from a fixed-size matrix.
Definition at line 151 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | const CMatrixTemplate< R > & | m | ) | [inline] |
Copy constructor from a matrix of any type.
Definition at line 176 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | size_t | row, | |
| size_t | col, | |||
| V(&) | theArray[N] | |||
| ) | [inline] |
Constructor from a given size and a C array.
The array length must match cols x row.
const double numbers[] = { 1,2,3, 4,5,6 }; CMatrixDouble M(3,2, numbers);
Definition at line 189 of file CMatrixTemplateNumeric.h.
| mrpt::math::CMatrixTemplateNumeric< T >::CMatrixTemplateNumeric | ( | size_t | row, | |
| size_t | col, | |||
| const V & | theVector | |||
| ) | [inline] |
Constructor from a given size and a STL container (std::vector, std::list,.
..) with the initial values. The vector length must match cols x row.
Definition at line 195 of file CMatrixTemplateNumeric.h.
| virtual mrpt::math::CMatrixTemplateNumeric< T >::~CMatrixTemplateNumeric | ( | ) | [inline, virtual] |
Destructor.
Definition at line 200 of file CMatrixTemplateNumeric.h.
| CMatrixTemplateNumeric<T> mrpt::math::CMatrixTemplateNumeric< T >::adj | ( | ) | const |
Computes the adjunt of matrix.
| void mrpt::math::CMatrixTemplateNumeric< T >::asCol | ( | CMatrixTemplateNumeric< T > & | aux | ) | const |
| void mrpt::math::CMatrixTemplateNumeric< T >::asRow | ( | CMatrixTemplateNumeric< T > & | aux | ) | const |
| T mrpt::math::CMatrixTemplateNumeric< T >::cofact | ( | size_t | row, | |
| size_t | col | |||
| ) | const |
Computes the rank of the matrix using a slight variation of Gauss method.
Computes the cofact.
| T mrpt::math::CMatrixTemplateNumeric< T >::cond | ( | ) |
Computes the cond.
| void mrpt::math::CMatrixTemplateNumeric< T >::eye | ( | ) | [inline] |
Build an unit matrix - this is a shortcut for unit().
Definition at line 298 of file CMatrixTemplateNumeric.h.
| void mrpt::math::CMatrixTemplateNumeric< T >::eye | ( | const size_t | size | ) | [inline] |
Build an unit matrix - this is a shortcut for unit().
Definition at line 291 of file CMatrixTemplateNumeric.h.
| void mrpt::math::CMatrixTemplateNumeric< T >::find_index_max_value | ( | size_t & | umax, | |
| size_t & | vmax, | |||
| T & | max_val | |||
| ) | const |
Finds the maximum value in the matrix, and returns its position.
(by AJOGD @ JAN-2007)
| void mrpt::math::CMatrixTemplateNumeric< T >::find_index_min_value | ( | size_t & | umin, | |
| size_t & | vmin, | |||
| T & | min_val | |||
| ) | const |
Finds the minimum value in the matrix, and returns its position.
(by AJOGD @ JAN-2007)
| void mrpt::math::CMatrixTemplateNumeric< T >::findElementsPassingMahalanobisThreshold | ( | double | stdTimes, | |
| std::vector< size_t > & | rowIndexes, | |||
| std::vector< size_t > & | colIndexes, | |||
| bool | below = false | |||
| ) | const |
Finds elements whose values are a given number of times above (or below) the mean, in 1D Mahalanobis distance.
This returns two lists with the "row" and "column" indexes (i,j) of those elements m[i][j] such as: m[i][j] > mean(matrix) + stdTimes·std(matrix) The elements below the threshold mean(matrix) - stdTimes·std(matrix) can also be obtained setting "below" to "true".
| void mrpt::math::CMatrixTemplateNumeric< T >::force_symmetry | ( | ) |
Force symmetry in the matrix (by AJOGD @ JAN-2007).
Referenced by mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().
| bool mrpt::math::CMatrixTemplateNumeric< T >::isDiagonal | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isLowerTriangular | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isNull | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isScalar | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isSkewSymmetric | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isSymmetric | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isUnit | ( | ) | const |
Checks for matrix type.
| bool mrpt::math::CMatrixTemplateNumeric< T >::isUpperTriangular | ( | ) | const |
Checks for matrix type.
| void mrpt::math::CMatrixTemplateNumeric< T >::laplacian | ( | CMatrixTemplateNumeric< T > & | ret | ) | const |
Computes the laplacian of the matrix, useful for graph matrixes.
| CMatrixTemplateNumeric<T> mrpt::math::CMatrixTemplateNumeric< T >::largestEigenvector | ( | T | resolution = 0.01f, |
|
| size_t | maxIterations = 6, |
|||
| int * | out_Iterations = NULL, |
|||
| float * | out_estimatedResolution = NULL | |||
| ) | const |
Efficiently computes only the biggest eigenvector of the matrix using the Power Method, and returns it as a column vector.
The computation time for this method, in a Pentium 4 1.4Ghz is:
T = 7.0867e-008*n2 + 1.9191e-005*n + 0.0017494 seconds
where N is the matrix size.
| void mrpt::math::CMatrixTemplateNumeric< T >::matrix_ceil | ( | ) |
Round towards plus infinity (by AJOGD @ JAN-2007).
| void mrpt::math::CMatrixTemplateNumeric< T >::matrix_floor | ( | CMatrixTemplateNumeric< T > & | out | ) |
Round towards minus infinity (by AJOGD @ JAN-2007).
| void mrpt::math::CMatrixTemplateNumeric< T >::matrix_floor | ( | ) |
Round towards minus infinity modifying the matrix (by AJOGD @ JAN-2007).
| T mrpt::math::CMatrixTemplateNumeric< T >::maximumDiagonal | ( | ) | const |
Finds the maximum value in the diagonal of the matrix.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute().
| void mrpt::math::CMatrixTemplateNumeric< T >::mean | ( | std::vector< T > & | outMeanVector | ) | const |
Computes a row with the mean values of each column in the matrix.
| void mrpt::math::CMatrixTemplateNumeric< T >::meanAndStd | ( | std::vector< T > & | outMeanVector, | |
| std::vector< T > & | outStdVector | |||
| ) | const |
Computes a row with the mean values of each column in the matrix and the associated vector with the standard deviation of each column.
| void mrpt::math::CMatrixTemplateNumeric< T >::meanAndStdAll | ( | T & | outMean, | |
| T & | outStd | |||
| ) | const |
Computes the mean and standard deviation of all the elements in the matrix as a whole.
| void mrpt::math::CMatrixTemplateNumeric< T >::multiplyByMatrixAndByTransposeNonSymmetric | ( | const CMatrixTemplateNumeric< T > & | C, | |
| CMatrixTemplateNumeric< T > & | R, | |||
| bool | accumOnOutput = false, |
|||
| bool | substractInsteadOfSum = false | |||
| ) | const |
Computes: R = H * C * H^t , where H is this matrix.
Referenced by mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().
| void mrpt::math::CMatrixTemplateNumeric< T >::ones | ( | ) |
Set all elements to one.
| void mrpt::math::CMatrixTemplateNumeric< T >::ones | ( | const size_t | row, | |
| const size_t | col | |||
| ) |
Set all elements to one.
| CMatrixTemplateNumeric& mrpt::math::CMatrixTemplateNumeric< T >::operator= | ( | V(&) | theArray[N] | ) | [inline] |
Assignment operator for initializing from a C array (The matrix must be set to the correct size before invoking this asignament).
CMatrixDouble M(3,2); const double numbers[] = { 1,2,3, 4,5,6 }; M = numbers;
Refer also to the constructor with initialization data CMatrixTemplate::CMatrixTemplate
Reimplemented from mrpt::math::CMatrixTemplate< T >.
Definition at line 215 of file CMatrixTemplateNumeric.h.
| CMatrixTemplateNumeric<T>& mrpt::math::CMatrixTemplateNumeric< T >::operator= | ( | const CMatrixTemplate< R > & | m | ) | [inline] |
Assignment operator of other types.
Definition at line 164 of file CMatrixTemplateNumeric.h.
| CMatrixTemplateNumeric& mrpt::math::CMatrixTemplateNumeric< T >::operator= | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | M | ) | [inline] |
Copy operator from a fixed-size matrix.
Definition at line 157 of file CMatrixTemplateNumeric.h.
| CMatrixTemplateNumeric<T>& mrpt::math::CMatrixTemplateNumeric< T >::operator^= | ( | const unsigned int & | pow | ) |
combined power and assignment operator
| void mrpt::math::CMatrixTemplateNumeric< T >::resize | ( | const CMatrixTemplateSize & | siz | ) | [inline] |
This method just checks has no effects in this class, but raises an exception if the expected size does not match.
Definition at line 232 of file CMatrixTemplateNumeric.h.
| void mrpt::math::CMatrixTemplateNumeric< T >::resize | ( | size_t | row, | |
| size_t | col | |||
| ) |
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where applicable.
setSize and resize are exactly equivalent methods.
| void mrpt::math::CMatrixTemplateNumeric< T >::scalarPow | ( | T | s | ) |
Scalar power of all elements to a given power, this is diferent of ^ operator.
| void mrpt::math::CMatrixTemplateNumeric< T >::setSize | ( | size_t | row, | |
| size_t | col | |||
| ) |
Changes the size of matrix, maintaining its previous content as possible and padding with zeros where applicable.
setSize and resize are exactly equivalent methods.
Referenced by mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), mrpt::math::detail::VicinityTraits< CMatrixTemplateNumeric< T > >::initialize(), mrpt::math::CVectorTemplate< KFTYPE >::likeMatrix(), and mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().
| CMatrixTemplateNumeric<T> mrpt::math::CMatrixTemplateNumeric< T >::solve | ( | const CMatrixTemplateNumeric< T > & | v | ) | const |
Solve the matrix as linear equations system.
| T mrpt::math::CMatrixTemplateNumeric< T >::sum | ( | size_t | firstRow = 0, |
|
| size_t | firstCol = 0, |
|||
| size_t | lastRow = std::numeric_limits< size_t >::max(), |
|||
| size_t | lastCol = std::numeric_limits< size_t >::max() | |||
| ) | const |
Returns the sum of a given part of the matrix.
The default value (std::numeric_limits<size_t>::max()) for the last column/row means to sum up to the last column/row.
| void mrpt::math::CMatrixTemplateNumeric< T >::svd | ( | CMatrixTemplateNumeric< T > & | U, | |
| std::vector< T > & | W, | |||
| CMatrixTemplateNumeric< T > & | V | |||
| ) | const |
Computes the SVD (Singular Value Decomposition) of the matrix.
If "this" matrix is named A with dimensions M x N, this method computes:
A = U * W * V'
, where U is a M x N column orthogonal matrix, W is a diagonal matrix containing the singular values, and V is a NxN matrix.
This method returns the U matrix, the N elements in the diagonal of W as a vector, and the matrix V, NOT TRANSPOSED.
| void mrpt::math::CMatrixTemplateNumeric< T >::unit | ( | ) |
Build an unit matrix.
| void mrpt::math::CMatrixTemplateNumeric< T >::unit | ( | const size_t | row | ) |
Build an unit matrix.
| void mrpt::math::CMatrixTemplateNumeric< T >::zeros | ( | ) |
Set all elements to zero.
| void mrpt::math::CMatrixTemplateNumeric< T >::zeros | ( | const size_t | row, | |
| const size_t | col | |||
| ) |
Set all elements to zero.
Referenced by mrpt::bayes::CKalmanFilterCapable< 7, 3, 3, 7 >::runOneKalmanIteration().
| Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010 |