Main MRPT website > C++ reference
MRPT logo

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.

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 R >
 CMatrixFixedNumeric (const CMatrixTemplateNumeric< R > &M)
 Copy constructor from a matrix of any type.

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 55 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 58 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 R >
mrpt::math::CMatrixFixedNumeric< T, NROWS, NCOLS >::CMatrixFixedNumeric ( const CMatrixTemplateNumeric< R > &  M  )  [inline]

Copy constructor from a matrix of any type.

Definition at line 119 of file CMatrixFixedNumeric.h.


Member Function Documentation

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>
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 >::end (  )  const [inline]

Definition at line 84 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_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 >::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 >::rend (  )  const [inline]

Definition at line 89 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.


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 >::begin(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::CMatrixFixedNumeric(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::end(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::rbegin(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::rend().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines



Page generated by Doxygen 1.6.1 for MRPT 0.9.0 SVN: at Mon Jun 7 06:47:58 UTC 2010