#include <mrpt/math/CMatrixFixedNumeric.h>
Public Types | |
typedef T | value_type |
The type of the matrix elements. | |
Public Member Functions | |
CMatrixFixedNumeric () | |
Default constructor, fills the whole matrix with zeros. | |
CMatrixFixedNumeric (bool, bool) | |
Constructor which leaves the matrix uninitialized: it uses two bool arguments with ignored values, but they must be present to make the method signature distinctive and make sure that the user wants the matrix to be uninitialized (ie, leaving only one bool argument may lead to unintended conversions from bool values!). | |
template<typename V , size_t N> | |
CMatrixFixedNumeric (V(&theArray)[N]) | |
Constructor from a given size and a C array. | |
template<size_t N, size_t M> | |
CMatrixFixedNumeric (const CMatrixFixedNumeric< T, N, M > &B) | |
Copy constructor from another matrix of a different size: it's explicit so matrices of different sizes are not mixed by mistake. | |
template<typename R > | |
CMatrixFixedNumeric (const CMatrixFixedNumeric< R, NROWS, NCOLS > &B) | |
Copy constructor from another matrix of a different type: it's explicit so matrices of different types are not mixed by mistake. | |
template<typename R > | |
CMatrixFixedNumeric (const CMatrixTemplate< R > &B, bool clipToFixedMatrixSize=false) | |
Copy constructor from a dynamic-size matrix An exception will be raised if the sizes do not match, unless "clipToFixedMatrixSize" is true. | |
CMatrixFixedNumeric< T, NROWS, NCOLS > & | operator= (const CMatrixTemplate< T > &B) |
Conversion from a dynamic-size matrix to a fixed-size one. | |
template<typename R > | |
CMatrixFixedNumeric< T, NROWS, NCOLS > & | operator= (const CMatrixTemplate< R > &B) |
Conversion from a dynamic-size matrix of a different data type to a fixed-size one. | |
CMatrixFixedNumeric (const CPoint2D &p) | |
Assigns a pose to a 2x1 or 1x2 matrix. | |
CMatrixFixedNumeric (const CPoint3D &p) | |
Assigns a pose to a 3x1 or 1x3 matrix. | |
CMatrixFixedNumeric (const CPose2D &p) | |
Assigns a pose to a 3x1 or 1x3 matrix. | |
CMatrixFixedNumeric (const CPose3D &p) | |
Assigns a pose to a 6x1 or 1x6 matrix. | |
CMatrixFixedNumeric< T, NROWS, NCOLS > & | operator= (const CPoint2D &p) |
Assigns a pose to a 2x1 or 1x2 matrix. | |
CMatrixFixedNumeric< T, NROWS, NCOLS > & | operator= (const CPoint3D &p) |
Assigns a pose to a 3x1 or 1x3 matrix. | |
CMatrixFixedNumeric< T, NROWS, NCOLS > & | operator= (const CPose2D &p) |
Assigns a pose to a 3x1 or 1x3 matrix. | |
CMatrixFixedNumeric< T, NROWS, NCOLS > & | operator= (const CPose3D &p) |
Assigns a pose to a 6x1 or 1x6 matrix. | |
void | unit () |
Make the matrix an identity matrix. | |
void | zeros () |
Set all elements to zero. | |
T | get_unsafe (const size_t row, const size_t col) const |
Read-only access to one element (Use with caution, bounds are not checked!). | |
T & | get_unsafe (const size_t row, const size_t col) |
Reference access to one element (Use with caution, bounds are not checked!). | |
void | set_unsafe (const size_t row, const size_t col, const T val) |
Sets an element (Use with caution, bounds are not checked!). | |
T & | operator() (const size_t row, const size_t col) |
Subscript operator to get/set individual elements. | |
T | operator() (const size_t row, const size_t col) const |
Subscript operator to get/set individual elements. | |
std::string | inMatlabFormat () const |
Gets the matrix as a string in matlab format, for example: [a11 a12 a12;a21 a22 a23]. | |
bool | fromMatlabStringFormat (const std::string &s) |
Read a matrix from a string in Matlab-like format, for example "[1 0 2; 0 4 -1]" The string must start with '[' and end with ']'. | |
void | inv (CMatrixFixedNumeric< T, NROWS, NCOLS > &out_inv) const |
Returns the inverse of the matrix in "out_inv". | |
void | inv_fast (CMatrixFixedNumeric< T, NROWS, NCOLS > &out_inv) |
Returns the inverse of the matrix in "out_inv" , DESTROYING the current matrix. | |
template<size_t NC1> | |
void | multiply (const CMatrixFixedNumeric< T, NROWS, NC1 > &A, const CMatrixFixedNumeric< T, NC1, NCOLS > &B) |
this = A*B | |
template<size_t NC1> | |
void | multiply_AAt (const CMatrixFixedNumeric< T, NROWS, NC1 > &A) |
this = A * A^t | |
void | multiply_Ab (const std::vector< T > &a, std::vector< T > &out_v) const |
Computes the vector v = this * a, where "a" is a column vector of the appropriate length. | |
template<size_t N1, size_t N2> | |
void | multiply_ABC (const CMatrixFixedNumeric< T, NROWS, N1 > &A, const CMatrixFixedNumeric< T, N1, N2 > &B, const CMatrixFixedNumeric< T, N2, NCOLS > &C) |
Calculate the operation this = A*B*C. | |
template<size_t N1, size_t N2> | |
void | multiply_ABCt (const CMatrixFixedNumeric< T, NROWS, N1 > &A, const CMatrixFixedNumeric< T, N1, N2 > &B, const CMatrixFixedNumeric< T, NCOLS, N2 > &C) |
Calculate the operation this = A*B*Ct. | |
template<size_t M1> | |
void | add_AAt (const CMatrixFixedNumeric< T, M1, M1 > &A) |
Sum to this matrix A and its transpose: this = this + A + At. | |
void | add (const CMatrixFixedNumeric< T, NROWS, NCOLS > &A) |
Sum A to this matrix: this = this + A. | |
void | substract (const CMatrixFixedNumeric< T, NROWS, NCOLS > &A) |
Substract A from this matrix: this = this - A. | |
void | add_Ac (const CMatrixFixedNumeric< T, NROWS, NCOLS > &A, const T c) |
Sum A times a scalar to this matrix: this = this + A*c. | |
void | substract_Ac (const CMatrixFixedNumeric< T, NROWS, NCOLS > &A, const T c) |
Substract A times a scalar from this matrix: this = this - A*c. | |
void | operator*= (const T val) |
Multiplies all elements by a scalar. | |
void | operator/= (const T val) |
Multiplies all elements by a scalar. | |
void | operator+= (const T val) |
Sum a scalar to all elements. | |
void | operator-= (const T val) |
Substract a scalar to all elements. | |
void | operator+= (const CMatrixFixedNumeric< T, NROWS, NCOLS > &m) |
Sum a matrix to this one. | |
void | operator-= (const CMatrixFixedNumeric< T, NROWS, NCOLS > &m) |
Substract a matrix to this one. | |
T | sumAll () const |
Returns the sum of all the elements. | |
T | minimum () const |
Returns the minimum of all the elements. | |
T | maximum () const |
Returns the maximum of all the elements. | |
void | minimumAndMaximum (T &val_min, T &val_max) const |
Returns the minimum & maximum of all the elements. | |
T | det () const |
Returns the determinant of the matrix. | |
void | Sqrt () |
Applies the sqrt to all the elements. | |
void | eigenVectors (CMatrixFixedNumeric< T, NROWS, NROWS > &Z, CMatrixFixedNumeric< T, NROWS, NROWS > &D) const |
Computes the eigenvalues/eigenvector decomposition of a symmetric matrix. | |
void | force_symmetry () |
Copy the upper half of the matrix into the lower half. | |
Import/export as text | |
void | saveToTextFile (const std::string &file, TMatrixTextFileFormat fileFormat=MATRIX_FORMAT_ENG, bool appendMRPTHeader=false, const std::string &userHeader=std::string("")) const |
Save matrix to a text file, compatible with MATLAB text format. | |
void | multiply_HCHt (const CMatrixFixedNumeric< T, NCOLS, NCOLS > &C, CMatrixFixedNumeric< T, NROWS, NROWS > &R, bool accumResultInOutput=false) const |
This executes the operation ![]() ![]() ![]() | |
T | multiply_HCHt_scalar (const CMatrixFixedNumeric< T, NCOLS, NCOLS > &C) const |
Like multiply_HCHt but for resulting matrices of size 1x1, which is returned as a scalar. | |
void | multiply_HtCH (const CMatrixFixedNumeric< T, NROWS, NROWS > &C, CMatrixFixedNumeric< T, NCOLS, NCOLS > &R, bool accumResultInOutput=false) const |
Like CMatrixFixedNumeric::multiply_HCHt but for Ht being given transpose. | |
T | multiply_HtCH_scalar (const CMatrixFixedNumeric< T, NROWS, NROWS > &C) const |
Like multiply_HtCH but for resulting matrices of size 1x1, which is returned as a scalar. | |
int | pivot (const size_t row) |
Used for "det". | |
void | swap_rows (size_t i1, size_t i2) |
T | _E (const size_t row, const size_t col) const |
auxiliary member to get element (i,j), starting at (1,1) instead of (0,0) | |
T & | _E (const size_t row, const size_t col) |
auxiliary member to get element (i,j), starting at (1,1) instead of (0,0) | |
Static Public Member Functions | |
static size_t | getRowCount () |
Get number of rows. | |
static size_t | getColCount () |
Get number of columns. | |
Public Attributes | |
T | m_Val [NROWS *NCOLS] |
The stored data of the matrix: elements are saved by rows, left to right, from top to bottom. |
The template can be instanced for data types "float" or "double" Virtually all methods have specializations and/or SSE2 optimized implementations, so use this class when time is critical.
Definition at line 83 of file CMatrixFixedNumeric.h.
typedef T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::value_type |
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | ) | [inline] |
Default constructor, fills the whole matrix with zeros.
Definition at line 96 of file CMatrixFixedNumeric.h.
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | bool | , | |
bool | ||||
) | [inline] |
Constructor which leaves the matrix uninitialized: it uses two bool arguments with ignored values, but they must be present to make the method signature distinctive and make sure that the user wants the matrix to be uninitialized (ie, leaving only one bool argument may lead to unintended conversions from bool values!).
Definition at line 105 of file CMatrixFixedNumeric.h.
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | 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 }; CMatrixFixedNumeric<double,3,2> M(numbers);
Definition at line 117 of file CMatrixFixedNumeric.h.
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CMatrixFixedNumeric< T, N, M > & | B | ) | [inline, explicit] |
Copy constructor from another matrix of a different size: it's explicit so matrices of different sizes are not mixed by mistake.
Definition at line 131 of file CMatrixFixedNumeric.h.
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CMatrixFixedNumeric< R, NROWS, NCOLS > & | B | ) | [inline, explicit] |
Copy constructor from another matrix of a different type: it's explicit so matrices of different types are not mixed by mistake.
Definition at line 143 of file CMatrixFixedNumeric.h.
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CMatrixTemplate< R > & | B, | |
bool | clipToFixedMatrixSize = false | |||
) | [inline, explicit] |
Copy constructor from a dynamic-size matrix An exception will be raised if the sizes do not match, unless "clipToFixedMatrixSize" is true.
Definition at line 154 of file CMatrixFixedNumeric.h.
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CPoint2D & | p | ) | [inline] |
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CPoint3D & | p | ) | [inline] |
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CPose2D & | p | ) | [inline] |
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric | ( | const CPose3D & | p | ) | [inline] |
T& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::_E | ( | const size_t | row, | |
const size_t | col | |||
) | [inline] |
auxiliary member to get element (i,j), starting at (1,1) instead of (0,0)
Definition at line 663 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::_E | ( | const size_t | row, | |
const size_t | col | |||
) | const [inline] |
auxiliary member to get element (i,j), starting at (1,1) instead of (0,0)
Definition at line 659 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::detMatrix(), and mrpt::math::invMatrix().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::add | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | A | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::add_AAt | ( | const CMatrixFixedNumeric< T, M1, M1 > & | A | ) | [inline] |
Sum to this matrix A and its transpose: this = this + A + At.
Definition at line 399 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::add_Ac | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | A, | |
const T | c | |||
) | [inline] |
Sum A times a scalar to this matrix: this = this + A*c.
Definition at line 428 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::det | ( | ) | const [inline] |
Returns the determinant of the matrix.
Definition at line 530 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::invMatrix(), and mrpt::math::normalPDF().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::eigenVectors | ( | CMatrixFixedNumeric< T, NROWS, NROWS > & | Z, | |
CMatrixFixedNumeric< T, NROWS, NROWS > & | D | |||
) | const [inline] |
Computes the eigenvalues/eigenvector decomposition of a symmetric matrix.
The decomposition is: M = Z · D · ZT, where columns in Z are the eigenvectors and the diagonal matrix D contains the eigenvalues as diagonal elements, sorted in ascending order. The algorithm is taken from "Numerical recipes in C", freely available online.
Definition at line 545 of file CMatrixFixedNumeric.h.
Referenced by mrpt::random::CRandomGenerator::drawGaussianMultivariate(), and mrpt::random::CRandomGenerator::drawGaussianMultivariateMany().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::force_symmetry | ( | ) | [inline] |
Copy the upper half of the matrix into the lower half.
Definition at line 550 of file CMatrixFixedNumeric.h.
bool mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::fromMatlabStringFormat | ( | const std::string & | s | ) | [inline] |
Read a matrix from a string in Matlab-like format, for example "[1 0 2; 0 4 -1]" The string must start with '[' and end with ']'.
Rows are separated by semicolons ';' and columns in each row by one or more whitespaces ' ' or tabs.
This format is also used for CConfigFile::read_matrix.
This template method can be instantiated for matrices of the types: int, long, unsinged int, unsigned long, float, double, long double
Definition at line 309 of file CMatrixFixedNumeric.h.
T& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::get_unsafe | ( | const size_t | row, | |
const size_t | col | |||
) | [inline] |
Reference access to one element (Use with caution, bounds are not checked!).
Definition at line 249 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::get_unsafe | ( | const size_t | row, | |
const size_t | col | |||
) | const [inline] |
Read-only access to one element (Use with caution, bounds are not checked!).
Definition at line 244 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::add_AAt(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::CMatrixFixedNumeric(), mrpt::math::covariancesAndMean(), mrpt::math::detMatrix(), mrpt::random::CRandomGenerator::drawGaussianMultivariate(), mrpt::random::CRandomGenerator::drawGaussianMultivariateMany(), mrpt::math::eigenVectorsMatrix(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::force_symmetry(), mrpt::poses::CPoint3D::getHomogeneousMatrix(), mrpt::poses::CPoint2D::getHomogeneousMatrix(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::inMatlabFormat(), mrpt::math::insertMatrixFixTransposeIntoDyn(), mrpt::math::invMatrix_destroySrc(), mrpt::math::multiply(), mrpt::math::multiply_AAt(), mrpt::math::multiply_Ab(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_ABC(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_ABCt(), mrpt::math::multiply_HCHt(), mrpt::math::multiply_HtCH(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator=(), mrpt::math::operator==(), mrpt::math::operator~(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::pivot().
static size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::getColCount | ( | ) | [inline, static] |
static size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::getRowCount | ( | ) | [inline, static] |
std::string mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::inMatlabFormat | ( | ) | const [inline] |
Gets the matrix as a string in matlab format, for example: [a11 a12 a12;a21 a22 a23].
Definition at line 283 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::inv | ( | CMatrixFixedNumeric< T, NROWS, NCOLS > & | out_inv | ) | const [inline] |
Returns the inverse of the matrix in "out_inv".
Definition at line 322 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::normalPDF(), and mrpt::math::operator!().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::inv_fast | ( | CMatrixFixedNumeric< T, NROWS, NCOLS > & | out_inv | ) | [inline] |
Returns the inverse of the matrix in "out_inv" , DESTROYING the current matrix.
Definition at line 328 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::maximum | ( | ) | const [inline] |
Returns the maximum of all the elements.
Definition at line 512 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::minimum | ( | ) | const [inline] |
Returns the minimum of all the elements.
Definition at line 503 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::minimumAndMaximum | ( | T & | val_min, | |
T & | val_max | |||
) | const [inline] |
Returns the minimum & maximum of all the elements.
Definition at line 521 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply | ( | const CMatrixFixedNumeric< T, NROWS, NC1 > & | A, | |
const CMatrixFixedNumeric< T, NC1, NCOLS > & | B | |||
) | [inline] |
this = A*B
Definition at line 334 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator*=(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator/=().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_AAt | ( | const CMatrixFixedNumeric< T, NROWS, NC1 > & | A | ) | [inline] |
this = A * A^t
Definition at line 344 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_AAt().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_Ab | ( | const std::vector< T > & | a, | |
std::vector< T > & | out_v | |||
) | const [inline] |
Computes the vector v = this * a, where "a" is a column vector of the appropriate length.
Definition at line 350 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_Ab().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_ABC | ( | const CMatrixFixedNumeric< T, NROWS, N1 > & | A, | |
const CMatrixFixedNumeric< T, N1, N2 > & | B, | |||
const CMatrixFixedNumeric< T, N2, NCOLS > & | C | |||
) | [inline] |
Calculate the operation this = A*B*C.
Definition at line 358 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_ABCt | ( | const CMatrixFixedNumeric< T, NROWS, N1 > & | A, | |
const CMatrixFixedNumeric< T, N1, N2 > & | B, | |||
const CMatrixFixedNumeric< T, NCOLS, N2 > & | C | |||
) | [inline] |
Calculate the operation this = A*B*Ct.
Definition at line 379 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HCHt | ( | const CMatrixFixedNumeric< T, NCOLS, NCOLS > & | C, | |
CMatrixFixedNumeric< T, NROWS, NROWS > & | R, | |||
bool | accumResultInOutput = false | |||
) | const [inline] |
This executes the operation , where 'this' matrix is
and
is symmetric, in an efficient and numerically stable way.
If 'this' matrix is , then
must be
, and the result matrix
will be
. The result from this method is assured to be symmetric (if
is symmetric), whereas executing:
R = H * C * (~H);
If accumResultInOutput=true, the contents of the output matrix will not be cleared, but added to the result of the operations. In this case it must have the correct size before calling or an exception will be raised since this probably is a bug.
Definition at line 591 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_HCHt(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_HCHt_scalar().
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HCHt_scalar | ( | const CMatrixFixedNumeric< T, NCOLS, NCOLS > & | C | ) | const [inline] |
Like multiply_HCHt but for resulting matrices of size 1x1, which is returned as a scalar.
Definition at line 600 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HtCH | ( | const CMatrixFixedNumeric< T, NROWS, NROWS > & | C, | |
CMatrixFixedNumeric< T, NCOLS, NCOLS > & | R, | |||
bool | accumResultInOutput = false | |||
) | const [inline] |
Like CMatrixFixedNumeric::multiply_HCHt but for Ht being given transpose.
Definition at line 609 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_HtCH(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_HtCH_scalar().
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HtCH_scalar | ( | const CMatrixFixedNumeric< T, NROWS, NROWS > & | C | ) | const [inline] |
Like multiply_HtCH but for resulting matrices of size 1x1, which is returned as a scalar.
Definition at line 618 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator() | ( | const size_t | row, | |
const size_t | col | |||
) | const [inline] |
Subscript operator to get/set individual elements.
Definition at line 271 of file CMatrixFixedNumeric.h.
T& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator() | ( | const size_t | row, | |
const size_t | col | |||
) | [inline] |
Subscript operator to get/set individual elements.
Definition at line 260 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator*= | ( | const T | val | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator+= | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | m | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator+= | ( | const T | val | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator-= | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | m | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator-= | ( | const T | val | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator/= | ( | const T | val | ) | [inline] |
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= | ( | const CPose3D & | p | ) | [inline] |
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= | ( | const CPose2D & | p | ) | [inline] |
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= | ( | const CPoint3D & | p | ) | [inline] |
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= | ( | const CPoint2D & | p | ) | [inline] |
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= | ( | const CMatrixTemplate< R > & | B | ) | [inline] |
Conversion from a dynamic-size matrix of a different data type to a fixed-size one.
std::exception | On wrong sizes |
Definition at line 186 of file CMatrixFixedNumeric.h.
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= | ( | const CMatrixTemplate< T > & | B | ) | [inline] |
Conversion from a dynamic-size matrix to a fixed-size one.
std::exception | On wrong sizes |
Definition at line 173 of file CMatrixFixedNumeric.h.
int mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::pivot | ( | const size_t | row | ) | [inline] |
Used for "det".
Definition at line 627 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::detMatrix(), and mrpt::math::invMatrix_destroySrc().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::saveToTextFile | ( | const std::string & | file, | |
TMatrixTextFileFormat | fileFormat = MATRIX_FORMAT_ENG , |
|||
bool | appendMRPTHeader = false , |
|||
const std::string & | userHeader = std::string("") | |||
) | const [inline] |
Save matrix to a text file, compatible with MATLAB text format.
file | The target filename. | |
fileFormat | See TMatrixTextFileFormat. The format of the numbers in the text file. | |
appendMRPTHeader | Insert this header to the file "% File generated by MRPT. Load with MATLAB with: VAR=load(FILENAME);" | |
userHeader | Additional text to be written at the head of the file. Typically MALAB comments "% This file blah blah". Final end-of-line is not needed. |
Definition at line 566 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::set_unsafe | ( | const size_t | row, | |
const size_t | col, | |||
const T | val | |||
) | [inline] |
Sets an element (Use with caution, bounds are not checked!).
Definition at line 254 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::Sqrt | ( | ) | [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::substract | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | A | ) | [inline] |
Substract A from this matrix: this = this - A.
Definition at line 421 of file CMatrixFixedNumeric.h.
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::substract_Ac | ( | const CMatrixFixedNumeric< T, NROWS, NCOLS > & | A, | |
const T | c | |||
) | [inline] |
Substract A times a scalar from this matrix: this = this - A*c.
Definition at line 435 of file CMatrixFixedNumeric.h.
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::sumAll | ( | ) | const [inline] |
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::swap_rows | ( | size_t | i1, | |
size_t | i2 | |||
) | [inline] |
Definition at line 650 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::invMatrix_destroySrc(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::pivot().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::unit | ( | ) | [inline] |
Make the matrix an identity matrix.
Definition at line 232 of file CMatrixFixedNumeric.h.
Referenced by mrpt::poses::CPoint3D::getHomogeneousMatrix(), mrpt::poses::CPoint2D::getHomogeneousMatrix(), and mrpt::math::invMatrix_destroySrc().
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::zeros | ( | ) | [inline] |
Set all elements to zero.
Definition at line 239 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_ABC(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_ABCt().
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::m_Val[NROWS *NCOLS] |
The stored data of the matrix: elements are saved by rows, left to right, from top to bottom.
Definition at line 92 of file CMatrixFixedNumeric.h.
Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::_E(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::add(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::add_Ac(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::CMatrixFixedNumeric(), mrpt::math::detMatrix(), mrpt::math::extractFixMatrixFromDynMatrix(), mrpt::math::fixedToDynMatrix(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::get_unsafe(), mrpt::math::insertMatrixFixIntoDyn(), mrpt::math::invMatrix(), mrpt::math::maximumMatrix(), mrpt::math::minimumAndMaximumMatrix(), mrpt::math::minimumMatrix(), mrpt::math::multiply(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_HCHt_scalar(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiply_HtCH_scalar(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator()(), mrpt::math::operator-(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator=(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::set_unsafe(), mrpt::math::sqrtMatrix(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::substract(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::substract_Ac(), mrpt::math::substractInPlace(), mrpt::math::sumInPlace(), mrpt::math::sumMatrixAllElements(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::swap_rows(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::unit(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::zeros().
Page generated by Doxygen 1.5.9 for MRPT 0.7.1 SVN: at Mon Aug 17 22:20:53 EDT 2009 |