MRPT logo
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS > Class Template Reference

A numeric matrix of compile-time fixed size. More...

#include <mrpt/math/CMatrixFixedNumeric.h>

Collaboration diagram for mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >:
Collaboration graph
[legend]

List of all members.

Classes

struct  mrpt_container

Public Types

typedef CArray< T, NROWS *NCOLS > array_type
 The underlying array of this matrix.
typedef T value_type
 The type of the matrix elements.
typedef T & reference
typedef const T & const_reference
typedef std::size_t size_type
typedef std::ptrdiff_t difference_type
typedef CMatrixFixedNumeric< T,
NROWS, NCOLS > 
mrpt_autotype
 See ops_containers.h.

Public Member Functions

 CMatrixFixedNumeric ()
 Default constructor, fills the whole matrix with zeros.
 CMatrixFixedNumeric (bool, 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!) Example of usage: CMatrixFixedNumeric<double,3,2> M(UNINITIALIZED_MATRIX);.
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.
void unit ()
 Make the matrix an identity matrix.
void zeros ()
 Set all elements to zero.
void zeros (size_t N, size_t M)
 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 force_symmetry ()
 Copy the upper half of the matrix into the lower half.
void multiplyColumnByScalar (size_t c, T scalar)
void swapRows (size_t i1, size_t i2)
void swapCols (size_t i1, size_t i2)
template<size_t N>
void ASSERT_ENOUGHROOM (size_t r, size_t c) const
template<size_t N, typename ReturnType >
ReturnType getVicinity (size_t c, size_t r) const
Methods common to all containers

size_t countNonZero () const
void fill (const T &val)
T maximum (size_t *maxIndex=NULL) const
T minimum (size_t *minIndex=NULL) const
void minimum_maximum (T &out_min, T &out_max, size_t *minIndex=NULL, size_t *maxIndex=NULL) const
T norm_inf (size_t *maxIndex=NULL) const
T sumAll () const
template<class CONTAINEROUT >
void cumsum (CONTAINEROUT &out) const
template<class CONTAINEROUT >
CONTAINEROUT cumsum () const
template<class CONTAINER2 >
size_t countCommonElements (const CONTAINER2 &b) const
 Counts the number of elements that appear in both containers (comparison through the == operator).
std::vector< double > histogram (double limit_min, double limit_max, size_t number_bins, bool do_normalization=false) const
 Computes the normalized or normal histogram of a sequence of numbers given the number of bins and the limits.
template<class F >
mrpt_autotype & applyToAllElements (T(*function)(T))
mrpt_autotype & Sqrt ()
mrpt_autotype & Abs ()
mrpt_autotype & Square ()
mrpt_autotype & Exp ()
mrpt_autotype & Log ()
T squareNorm () const
T norm () const
T mean () const
void adjustRange (const T min_val, const T max_val)
void normalize (const T min_val=0, const T max_val=1)
double std (bool unbiased=true) const
void meanAndStd (double &out_mean, double &out_std, bool unbiased=true)
Methods common to all matrices

mrpt_autotype operator+ ()
mrpt_autotype operator- () const
mrpt_autotype & operator+= (const T n)
mrpt_autotype & operator-= (const T n)
mrpt_autotype & operator*= (const T n)
mrpt_autotype & operator/= (const T n)
template<typename OTHERMATRIX >
OTHERMATRIX::template
mrpt_matrix_tag_templ< void >
::void_type 
operator*= (const OTHERMATRIX &m)
template<typename OTHERMATRIX >
mrpt_autotype & add_At (const OTHERMATRIX &m)
template<typename OTHERMATRIX >
mrpt_autotype & add_Ac (const OTHERMATRIX &m, const T c)
template<typename OTHERMATRIX >
mrpt_autotype & substract_At (const OTHERMATRIX &m)
template<typename OTHERMATRIX >
mrpt_autotype & substract_An (const OTHERMATRIX &m, const size_t n)
template<typename OTHERMATRIX >
mrpt_autotype & substract_Ac (const OTHERMATRIX &m, const T c)
template<typename OTHERMATRIX >
mrpt_autotype & add_AAt (const OTHERMATRIX &m)
template<typename OTHERMATRIX >
mrpt_autotype & substract_AAt (const OTHERMATRIX &m)
bool empty () const
template<class MATRIX1 , class MATRIX2 >
void multiply (const MATRIX1 &A, const MATRIX2 &B)
template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
void multiply_Ab (const OTHERVECTOR1 &vIn, OTHERVECTOR2 &vOut, bool accumToOutput=false) const
template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
void multiply_Atb (const OTHERVECTOR1 &vIn, OTHERVECTOR2 &vOut, bool accumToOutput=false) const
template<typename MAT_C , typename MAT_R >
void multiply_HCHt (const MAT_C &C, MAT_R &R, bool accumResultInOutput=false, bool allow_submatrix_mult=false) const
template<typename MAT_C >
T multiply_HCHt_scalar (const MAT_C &C) const
template<typename MAT_C >
T multiply_HtCH_scalar (const MAT_C &C) const
template<typename MAT_C , typename MAT_R >
void multiply_HtCH (const MAT_C &C, MAT_R &R, bool accumResultInOutput=false, bool allow_submatrix_mult=false) const
template<class MAT_A , class MAT_OUT >
void multiply_subMatrix (const MAT_A &A, MAT_OUT &outResult, const size_t A_cols_offset, const size_t A_rows_offset, const size_t A_col_count) const
template<class MAT_A , class MAT_B , class MAT_C >
void multiply_ABC (const MAT_A &A, const MAT_B &B, const MAT_C &C)
template<class MAT_A , class MAT_B , class MAT_C >
void multiply_ABCt (const MAT_A &A, const MAT_B &B, const MAT_C &C)
template<class MAT_A , class MAT_B >
void multiply_ABt (const MAT_A &A, const MAT_B &B)
template<class MAT_A >
void multiply_AAt (const MAT_A &A)
template<class MAT_A >
void multiply_AtA (const MAT_A &A)
template<class MAT_A , class MAT_B >
void multiply_result_is_symmetric (const MAT_A &A, const MAT_B &B)
T _E (const size_t row, const size_t col) const
T & _E (const size_t row, const size_t col)
bool IsSquare () const
bool isSquare () const
bool isSingular (const T epsilon=0) const
T trace () const
template<class MAT_OUT >
void pseudoInverse (MAT_OUT &out) const
template<class MAT_OUT >
MAT_OUT pseudoInverse () const
T det () const
template<class MATRIXOUT >
void inv (MATRIXOUT &out) const
mrpt_autotype inv () const
template<class MATRIXOUT >
void inv_fast (MATRIXOUT &out)
template<class MAT2 , class MAT3 >
void leftDivideSquare (const MAT2 &A, MAT3 &RES) const
template<class MAT2 , class MAT3 >
void rightDivideSquare (const MAT2 &B, MAT3 &RES) const
template<typename MAT2 >
void fastLeftDivideSquare (MAT2 &A)
template<typename MAT2 >
void fastRightDivideSquare (MAT2 &B)
void saveToTextFile (const std::string &file, mrpt::math::TMatrixTextFileFormat fileFormat=MATRIX_FORMAT_ENG, bool appendMRPTHeader=false, const std::string &userHeader=std::string("")) const
int pivot (const size_t row)
template<class MATRIXOUT >
bool chol (MATRIXOUT &out) const
template<class MATRIX1 , class MATRIX2 >
MATRIX1::template
mrpt_matrix_tag_templ
< typename
MATRIX2::mrpt_matrix_tag >
::void_type 
eigenVectors (MATRIX1 &eVecs, MATRIX2 &eVals) const
template<class MATRIX1 , class VECTOR1 >
void eigenVectorsVec (MATRIX1 &eVecs, VECTOR1 &eVals) const
template<class VECTOR1 >
void eigenValues (VECTOR1 &eVals) const
void setIdentity ()
void setIdentity (size_t N)
template<typename OTHERMATRIX >
mrpt_autotype & assignMatrix (const OTHERMATRIX &m)
size_t rank (T eps=1e-7) const
Constructors from poses or points

 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.
Import/export as text

void loadFromTextFile (const std::string &file)
 Load matrix from a text file, compatible with MATLAB text format.

Static Public Member Functions

static size_t getRowCount ()
 Get number of rows.
static size_t getColCount ()
 Get number of columns.
static const CMatrixTemplateSize & size ()
 Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x)).
static void setSize (const size_t nRows, const size_t nCols)
 This method has no effects in this class, but raises an exception if the expected size does not match.
static void resize (const size_t nRows_times_nCols)
 This method has no effects in this class, but raises an exception if the expected size does not match.

Public Attributes

array_type m_Val
 The stored data of the matrix: elements are saved by rows, left to right, from top to bottom.

Iterator-related stuff



typedef array_type::iterator iterator
 Iterator.
typedef array_type::const_iterator const_iterator
 Const iterator.
typedef
array_type::reverse_iterator 
reverse_iterator
 Reverse iterator.
typedef
array_type::const_reverse_iterator 
const_reverse_iterator
 Const reverse iterator.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const

Detailed Description

template<typename T, size_t NROWS, size_t NCOLS>
class mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >

A numeric matrix of compile-time fixed size.

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.

These matrices have iterators and reverse iterators to access all the elements in the matrix as a sequence, starting from the element (0,0), then row by row, from left to right.

Note:
To enable SSE2 optimizations, add the definition "#define MRPT_USE_SSE2" BEFORE including MRPT headers in your code. This is because these optimizations are only applicable to static matrix objects, but not when they are created in dynamic memory.
See also:
CMatrixTemplateNumeric (for dynamic-size matrices)

Definition at line 54 of file CMatrixFixedNumeric.h.


Member Typedef Documentation

template<typename T, size_t NROWS, size_t NCOLS>
typedef CArray<T,NROWS*NCOLS> mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::array_type

The underlying array of this matrix.

Definition at line 57 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef array_type::const_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::const_iterator

Const iterator.

Definition at line 77 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef const T& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::const_reference

Definition at line 62 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef array_type::const_reverse_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::const_reverse_iterator

Const reverse iterator.

Definition at line 79 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef std::ptrdiff_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::difference_type

Definition at line 64 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef array_type::iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::iterator

Iterator.

Definition at line 76 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef CMatrixFixedNumeric<T,NROWS,NCOLS> mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::mrpt_autotype

See ops_containers.h.

Definition at line 67 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef T& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::reference

Definition at line 61 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef array_type::reverse_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::reverse_iterator

Reverse iterator.

Definition at line 78 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef std::size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::size_type

Definition at line 63 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
typedef T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::value_type

The type of the matrix elements.

Definition at line 60 of file CMatrixFixedNumeric.h.


Constructor & Destructor Documentation

template<typename T, size_t NROWS, size_t NCOLS>
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric (  )  [inline]

Default constructor, fills the whole matrix with zeros.

Definition at line 102 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric ( bool  ,
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!) Example of usage: CMatrixFixedNumeric<double,3,2> M(UNINITIALIZED_MATRIX);.

Definition at line 113 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename V , size_t N>
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 125 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<size_t N, size_t M>
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 139 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename R >
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 151 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename R >
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 162 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric ( const CPoint2D &  p  )  [inline]

Assigns a pose to a 2x1 or 1x2 matrix.

Definition at line 232 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric ( const CPoint3D &  p  )  [inline]

Assigns a pose to a 3x1 or 1x3 matrix.

Definition at line 234 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric ( const CPose2D &  p  )  [inline]

Assigns a pose to a 3x1 or 1x3 matrix.

Definition at line 236 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric ( const CPose3D &  p  )  [inline]

Assigns a pose to a 6x1 or 1x6 matrix.

Definition at line 238 of file CMatrixFixedNumeric.h.


Member Function Documentation

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::_E ( const size_t  row,
const size_t  col 
) const [inline]

Alternative access to element (i,j) with first index being (1,1) instead of (0,0)

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::_E ( const size_t  row,
const size_t  col 
) [inline]

Alternative access to element (i,j) with first index being (1,1) instead of (0,0)

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::Abs (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::add_AAt ( const OTHERMATRIX &  m  )  [inline]

this += A + AT

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::add_Ac ( const OTHERMATRIX &  m,
const T  c 
) [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::add_At ( const OTHERMATRIX &  m  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::adjustRange ( const T  min_val,
const T  max_val 
) [inline]
Parameters:
max_val Normalize all the elements such as they are in the given range

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class F >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::applyToAllElements ( T(*)(T)  function  )  [inline]

Applies a generic operation "T func(T val)" to all the elements.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<size_t N>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::ASSERT_ENOUGHROOM ( size_t  r,
size_t  c 
) const [inline]

Definition at line 482 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::assignMatrix ( const OTHERMATRIX &  m  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::begin (  )  [inline]

Definition at line 81 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
const_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::begin (  )  const [inline]

Definition at line 83 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MATRIXOUT >
bool mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::chol ( MATRIXOUT &  out  )  const [inline]

Cholesky factorization: in = out' * out

Returns:
True on success, false on singular matrix
See also:
mrpt::math::chol

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class CONTAINER2 >
size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::countCommonElements ( const CONTAINER2 &  b  )  const [inline]

Counts the number of elements that appear in both containers (comparison through the == operator).

It is assumed that no repeated elements appear within each of the containers.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::countNonZero (  )  const [inline]

Count how many elements in a container are non-zero.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class CONTAINEROUT >
CONTAINEROUT mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::cumsum (  )  const [inline]

Cumsum of all the elements, returning a container of the given type, for example: CMatrixDouble m = mat.cumsum<CMatrixDouble>();

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class CONTAINEROUT >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::cumsum ( CONTAINEROUT &  out  )  const [inline]

Cumsum of all the elements, saving in an output container

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::det (  )  const [inline]

< Returns the determinant of the matrix

Definition at line 71 of file CMatrixFixedNumeric.h.

Referenced by mrpt::math::normalPDF(), and mrpt::math::productIntegralTwoGaussians().

template<typename T, size_t NROWS, size_t NCOLS>
template<class VECTOR1 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::eigenValues ( VECTOR1 &  eVals  )  const [inline]

Return the eigenvalues of the matrix in an ordered vector.

See also:
eigenVectors

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MATRIX1 , class MATRIX2 >
MATRIX1 ::template mrpt_matrix_tag_templ<typename MATRIX2 ::mrpt_matrix_tag>::void_type mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::eigenVectors ( MATRIX1 &  eVecs,
MATRIX2 &  eVals 
) const [inline]

Eigenvalues and eigenvector of symmetric matrix: M = eVecs * eVals * eVecsT, with eigenvectors in columns in eVecs, eigenvalues in ascending order in diagonal of eVals

See also:
eigenVectorsVec, eigenValues

Definition at line 71 of file CMatrixFixedNumeric.h.

Referenced by mrpt::random::CRandomGenerator::drawGaussianMultivariate(), and mrpt::random::CRandomGenerator::drawGaussianMultivariateMany().

template<typename T, size_t NROWS, size_t NCOLS>
template<class MATRIX1 , class VECTOR1 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::eigenVectorsVec ( MATRIX1 &  eVecs,
VECTOR1 &  eVals 
) const [inline]

Like eigenVectors, but eigenvalues are returned in a vector instead of a matrix's diagonal.

See also:
eigenVectors,eigenValues

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
bool mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::empty (  )  const [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::end (  )  [inline]

Definition at line 82 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
const_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::end (  )  const [inline]

Definition at line 84 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::Exp (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename MAT2 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::fastLeftDivideSquare ( MAT2 &  A  )  [inline]

Matrix left divide: this = A-1 &#183; this (A must be a square matrix, and will be modified on return).

See also:
leftDivideSquare,fastRightDivideSquare

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename MAT2 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::fastRightDivideSquare ( MAT2 &  B  )  [inline]

Matrix right divide: this = this &#183; B-1 (B must be a square matrix, and will be modified on return).

See also:
leftDivideSquare,fastRightDivideSquare

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::fill ( const T &  val  )  [inline]

Fill all the elements with a given value

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::force_symmetry (  )  [inline]

Copy the upper half of the matrix into the lower half.

Definition at line 365 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
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

Returns:
true on success. false if the string is malformed, or it is of the wrong size.
See also:
inMatlabFormat, CConfigFile::read_matrix

Definition at line 355 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::get_unsafe ( const size_t  row,
const size_t  col 
) const [inline]
template<typename T, size_t NROWS, size_t NCOLS>
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 287 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
static size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::getColCount (  )  [inline, static]

Get number of columns.

Definition at line 208 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
static size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::getRowCount (  )  [inline, static]

Get number of rows.

Definition at line 205 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<size_t N, typename ReturnType >
ReturnType mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::getVicinity ( size_t  c,
size_t  r 
) const [inline]

Definition at line 488 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
std::vector<double> mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::histogram ( double  limit_min,
double  limit_max,
size_t  number_bins,
bool  do_normalization = false 
) const [inline]

Computes the normalized or normal histogram of a sequence of numbers given the number of bins and the limits.

In any case this is a "linear" histogram, i.e. for matrices, all the elements are taken as if they were a plain sequence, not taking into account they were in columns or rows.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
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].

See also:
fromMatlabStringFormat

Definition at line 329 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::inv (  )  const [inline]

< mrpt_autotype out = inv(this)

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MATRIXOUT >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::inv ( MATRIXOUT &  out  )  const [inline]

< out = inv(this)

Definition at line 71 of file CMatrixFixedNumeric.h.

Referenced by mrpt::math::normalPDF().

template<typename T, size_t NROWS, size_t NCOLS>
template<class MATRIXOUT >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::inv_fast ( MATRIXOUT &  out  )  [inline]
Parameters:
out out = inv(this), overwriting contents of this

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
bool mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::isSingular ( const T  epsilon = 0  )  const [inline]

Checks for the absolute value of the determinant of the matrix being equal or below a given threshold (by default, exactly zero).

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
bool mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::isSquare (  )  const [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
bool mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::IsSquare (  )  const [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT2 , class MAT3 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::leftDivideSquare ( const MAT2 &  A,
MAT3 &  RES 
) const [inline]

Matrix left divide: RES = A-1 &#183; this (A must be a square matrix).

See also:
rightDivideSquare,fastLeftDivideSquare

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::loadFromTextFile ( const std::string &  file  )  [inline]

Load matrix from a text file, compatible with MATLAB text format.

Lines starting with '' or '#' are interpreted as comments and ignored.

See also:
saveToTextFile, fromMatlabStringFormat

Definition at line 378 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::Log (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::maximum ( size_t *  maxIndex = NULL  )  const [inline]

Finds the maximum value (and the corresponding zero-based index).

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::mean (  )  const [inline]

Return the mean of the container (for matrices, as if it were a vector with all its elements).

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::meanAndStd ( double &  out_mean,
double &  out_std,
bool  unbiased = true 
) [inline]

Return the mean and standard deviation of all the elements in the container.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::minimum ( size_t *  minIndex = NULL  )  const [inline]

Finds the minimum value (and the corresponding zero-based index).

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::minimum_maximum ( T &  out_min,
T &  out_max,
size_t *  minIndex = NULL,
size_t *  maxIndex = NULL 
) const [inline]

Minimum and maximum of a vector at once

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MATRIX1 , class MATRIX2 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply ( const MATRIX1 &  A,
const MATRIX2 &  B 
) [inline]
Parameters:
B this = A * B

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_AAt ( const MAT_A &  A  )  [inline]
Parameters:
A this = A * AT

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_Ab ( const OTHERVECTOR1 &  vIn,
OTHERVECTOR2 &  vOut,
bool  accumToOutput = false 
) const [inline]

Computes the vector vOut = this * vIn, where "vIn" is a column vector of the appropriate length.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A , class MAT_B , class MAT_C >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_ABC ( const MAT_A &  A,
const MAT_B &  B,
const MAT_C &  C 
) [inline]
Parameters:
C this = A*B*C

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A , class MAT_B , class MAT_C >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_ABCt ( const MAT_A &  A,
const MAT_B &  B,
const MAT_C &  C 
) [inline]
Parameters:
C this = A*B*(CT)

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A , class MAT_B >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_ABt ( const MAT_A &  A,
const MAT_B &  B 
) [inline]
Parameters:
B this = A * BT

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_AtA ( const MAT_A &  A  )  [inline]
Parameters:
A this = AT * A

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERVECTOR1 , typename OTHERVECTOR2 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_Atb ( const OTHERVECTOR1 &  vIn,
OTHERVECTOR2 &  vOut,
bool  accumToOutput = false 
) const [inline]

Computes the vector vOut = thisT * vIn, where "vIn" is a column vector of the appropriate length.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename MAT_C , typename MAT_R >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HCHt ( const MAT_C &  C,
MAT_R &  R,
bool  accumResultInOutput = false,
bool  allow_submatrix_mult = false 
) const [inline]

< R = this * C * thisT

See also:
detail::multiply_HCHt

Definition at line 71 of file CMatrixFixedNumeric.h.

Referenced by mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration().

template<typename T, size_t NROWS, size_t NCOLS>
template<typename MAT_C >
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HCHt_scalar ( const MAT_C &  C  )  const [inline]

R = H * C * HT (with a vector H and a symmetric matrix C) In fact when H is a vector, multiply_HCHt_scalar and multiply_HtCH_scalar are exactly equivalent

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename MAT_C , typename MAT_R >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HtCH ( const MAT_C &  C,
MAT_R &  R,
bool  accumResultInOutput = false,
bool  allow_submatrix_mult = false 
) const [inline]

R = HT * C * H (with a symmetric matrix C)

< R = thisT * C * this

See also:
detail::multiply_HtCH

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename MAT_C >
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_HtCH_scalar ( const MAT_C &  C  )  const [inline]

R = HT * C * H (with a vector H and a symmetric matrix C) In fact when H is a vector, multiply_HCHt_scalar and multiply_HtCH_scalar are exactly equivalent

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A , class MAT_B >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_result_is_symmetric ( const MAT_A &  A,
const MAT_B &  B 
) [inline]
Parameters:
B this = A * B (result is symmetric)

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_A , class MAT_OUT >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiply_subMatrix ( const MAT_A &  A,
MAT_OUT &  outResult,
const size_t  A_cols_offset,
const size_t  A_rows_offset,
const size_t  A_col_count 
) const [inline]

< outResult = this * A

Definition at line 71 of file CMatrixFixedNumeric.h.

Referenced by mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration().

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::multiplyColumnByScalar ( size_t  c,
T  scalar 
) [inline]

Definition at line 444 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::norm (  )  const [inline]

Return the norm of the container (for matrices, as if it were a vector with all its elements).

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::norm_inf ( size_t *  maxIndex = NULL  )  const [inline]

Compute the norm-infinite of a vector ($f[ ||{v}||_ $f]), ie the maximum absolute value of the elements.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::normalize ( const T  min_val = 0,
const T  max_val = 1 
) [inline]
Parameters:
max_val Normalize all the elements such as they are in the given range

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
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 317 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
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 306 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator*= ( const T  n  )  [inline]
Parameters:
n Multiply by scalar

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
OTHERMATRIX ::template mrpt_matrix_tag_templ<void>::void_type mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator*= ( const OTHERMATRIX &  m  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator+ (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator+= ( const T  n  )  [inline]
Parameters:
n Sum a scalar

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator- (  )  const [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator-= ( const T  n  )  [inline]
Parameters:
n Substract a scalar

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator/= ( const T  n  )  [inline]
Parameters:
n Divide by scalar

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= ( const CPoint3D &  p  )  [inline]

Assigns a pose to a 3x1 or 1x3 matrix.

Definition at line 245 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= ( const CPose3D &  p  )  [inline]

Assigns a pose to a 6x1 or 1x6 matrix.

Definition at line 253 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= ( const CPoint2D &  p  )  [inline]

Assigns a pose to a 2x1 or 1x2 matrix.

Definition at line 241 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename R >
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.

Exceptions:
std::exception On wrong sizes

Definition at line 194 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
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.

Exceptions:
std::exception On wrong sizes

Definition at line 181 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
CMatrixFixedNumeric<T,NROWS,NCOLS>& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::operator= ( const CPose2D &  p  )  [inline]

Assigns a pose to a 3x1 or 1x3 matrix.

Definition at line 249 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
int mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::pivot ( const size_t  row  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_OUT >
MAT_OUT mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::pseudoInverse (  )  const [inline]

< Pseudo inverse of this matrix M: return (MT * M)^-1 * MT. Invoke with template argument for desired return matrix type: m.pseudoInverse<CMatrixDouble>()

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT_OUT >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::pseudoInverse ( MAT_OUT &  out  )  const [inline]

< Pseudo inverse of this matrix M: out = (MT * M)^-1 * MT

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
size_t mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::rank ( T  eps = 1e-7  )  const [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
reverse_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::rbegin (  )  [inline]

Definition at line 86 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
const_reverse_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::rbegin (  )  const [inline]

Definition at line 88 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
reverse_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::rend (  )  [inline]

Definition at line 87 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
const_reverse_iterator mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::rend (  )  const [inline]

Definition at line 89 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
static void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::resize ( const size_t  nRows_times_nCols  )  [inline, static]

This method has no effects in this class, but raises an exception if the expected size does not match.

Definition at line 223 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<class MAT2 , class MAT3 >
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::rightDivideSquare ( const MAT2 &  B,
MAT3 &  RES 
) const [inline]

Matrix right divide: RES = this &#183; B-1 (B must be a square matrix).

See also:
leftDivideSquare,fastRightDivideSquare

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::saveToTextFile ( const std::string &  file,
mrpt::math::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.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
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 296 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::setIdentity (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::setIdentity ( size_t  N  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
static void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::setSize ( const size_t  nRows,
const size_t  nCols 
) [inline, static]

This method has no effects in this class, but raises an exception if the expected size does not match.

Definition at line 218 of file CMatrixFixedNumeric.h.

Referenced by mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration().

template<typename T, size_t NROWS, size_t NCOLS>
static const CMatrixTemplateSize& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::size (  )  [inline, static]

Get a 2-vector with [NROWS NCOLS] (as in MATLAB command size(x)).

Definition at line 211 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::Sqrt (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::Square (  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::squareNorm (  )  const [inline]

Return the square norm of the container (for matrices, as if it were a vector with all its elements).

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
double mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::std ( bool  unbiased = true  )  const [inline]

Return the standard deviation of all the elements in the container.

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::substract_AAt ( const OTHERMATRIX &  m  )  [inline]

this -= A + AT

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::substract_Ac ( const OTHERMATRIX &  m,
const T  c 
) [inline]

Substract c (scalar) times A to this matrix: this -= A * c

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::substract_An ( const OTHERMATRIX &  m,
const size_t  n 
) [inline]

Substract n (integer) times A to this matrix: this -= A * n

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
template<typename OTHERMATRIX >
mrpt_autotype& mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::substract_At ( const OTHERMATRIX &  m  )  [inline]

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::sumAll (  )  const [inline]

Sum all the elements

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::swapCols ( size_t  i1,
size_t  i2 
) [inline]

Definition at line 466 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::swapRows ( size_t  i1,
size_t  i2 
) [inline]

Definition at line 457 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
T mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::trace (  )  const [inline]

The trace of this square matrix

Definition at line 71 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::unit (  )  [inline]

Make the matrix an identity matrix.

Definition at line 260 of file CMatrixFixedNumeric.h.

Referenced by mrpt::poses::CPoint3D::getHomogeneousMatrix(), and mrpt::poses::CPoint2D::getHomogeneousMatrix().

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::zeros (  )  [inline]

Set all elements to zero.

Definition at line 267 of file CMatrixFixedNumeric.h.

template<typename T, size_t NROWS, size_t NCOLS>
void mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::zeros ( size_t  N,
size_t  M 
) [inline]

Set all elements to zero.

Definition at line 272 of file CMatrixFixedNumeric.h.


Member Data Documentation

template<typename T, size_t NROWS, size_t NCOLS>
array_type mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::m_Val

The stored data of the matrix: elements are saved by rows, left to right, from top to bottom.

(We use a CArray wrapper instead of a plain array so it handles the cases of 0-length arrays without problems.)

Definition at line 98 of file CMatrixFixedNumeric.h.

Referenced by mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::CMatrixFixedNumeric(), mrpt::math::detail::extractFixMatrixFromDynMatrix(), mrpt::math::detail::fixedToDynMatrix(), and mrpt::math::detail::insertMatrixFixIntoDyn().




Page generated by Doxygen 1.7.1 for MRPT 0.8.1 SVN:exported at Sun Sep 19 14:53:45 UTC 2010