A wrapper around an existing matrix (of any kind) that allows operating on a subrange of the elements. More...
#include <mrpt/math/CMatrixViews.h>


Classes | |
| struct | mrpt_container |
Public Types | |
| enum | dummy_enum { mrpt_matrix_type_ncols = -1, mrpt_matrix_type_nrows = -1 } |
| typedef CSubmatrixView < MATRIXTYPE, NR, NC > | mrpt_autotype |
Public Member Functions | |
Methods common to all containers | |
| size_t | countNonZero () const |
| void | fill (const value_type &val) |
| value_type | maximum (size_t *maxIndex=NULL) const |
| value_type | minimum (size_t *minIndex=NULL) const |
| void | minimum_maximum (value_type &out_min, value_type &out_max, size_t *minIndex=NULL, size_t *maxIndex=NULL) const |
| value_type | norm_inf (size_t *maxIndex=NULL) const |
| value_type | 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 (value_type(*function)(value_type)) |
| mrpt_autotype & | Sqrt () |
| mrpt_autotype & | Abs () |
| mrpt_autotype & | Square () |
| mrpt_autotype & | Exp () |
| mrpt_autotype & | Log () |
| value_type | squareNorm () const |
| value_type | norm () const |
| value_type | mean () const |
| void | adjustRange (const value_type min_val, const value_type max_val) |
| void | normalize (const value_type min_val=0, const value_type max_val=1) |
| double | std (bool unbiased=true) const |
| void | meanAndStd (double &out_mean, double &out_std, bool unbiased=true) |
Protected Attributes | |
| MATRIXTYPE & | base |
| size_t | firstRow |
| size_t | firstCol |
Methods common to all matrices | |
|
| |
| mrpt_autotype | operator+ () |
| mrpt_autotype | operator- () const |
| mrpt_autotype & | operator+= (const value_type n) |
| mrpt_autotype & | operator-= (const value_type n) |
| mrpt_autotype & | operator*= (const value_type n) |
| mrpt_autotype & | operator/= (const value_type n) |
| template<typename OTHERMATRIX > | |
| RET_VOID_ASSERT_MRPTMATRIX (OTHERMATRIX) operator* | |
| firstRow (r1) | |
| firstCol (c1) | |
| value_type & | get_unsafe (size_t r, size_t c) |
| value_type | get_unsafe (size_t r, size_t c) const |
| void | set_unsafe (size_t r, size_t c, value_type v) |
| value_type & | operator() (const size_t r, const size_t c) |
| value_type | operator() (const size_t r, const size_t c) const |
| template<typename OTHERMATRIX > | |
| mrpt_autotype & | operator= (const OTHERMATRIX &m) |
| static size_t | getRowCount () |
| static size_t | getColCount () |
| static CMatrixTemplateSize | size () |
| static void | setSize (size_t r, size_t c) |
| static void | resize (size_t rtc) |
A wrapper around an existing matrix (of any kind) that allows operating on a subrange of the elements.
Example of usage:
CMatrixDouble C(10,10); CSubmatrixView<CMatrixDouble,3,2> Csub(C,5,6); // Csub is C([5,6,7],[6,7])
Definition at line 168 of file CMatrixViews.h.
| typedef CSubmatrixView<MATRIXTYPE,NR,NC> mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::mrpt_autotype |
Definition at line 174 of file CMatrixViews.h.
| enum mrpt::math::CSubmatrixView::dummy_enum |
Definition at line 177 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::Abs | ( | ) | [inline] |
Definition at line 179 of file CMatrixViews.h.
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::adjustRange | ( | const value_type | min_val, | |
| const value_type | max_val | |||
| ) | [inline] |
| max_val | Normalize all the elements such as they are in the given range |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::applyToAllElements | ( | value_type(*)(value_type) | function | ) | [inline] |
Applies a generic operation "T func(T val)" to all the elements.
Definition at line 179 of file CMatrixViews.h.
| size_t mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::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 179 of file CMatrixViews.h.
| size_t mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::countNonZero | ( | ) | const [inline] |
Count how many elements in a container are non-zero.
Definition at line 179 of file CMatrixViews.h.
| CONTAINEROUT mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::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 179 of file CMatrixViews.h.
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::cumsum | ( | CONTAINEROUT & | out | ) | const [inline] |
Cumsum of all the elements, saving in an output container
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::Exp | ( | ) | [inline] |
Definition at line 179 of file CMatrixViews.h.
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::fill | ( | const value_type & | val | ) | [inline] |
Fill all the elements with a given value
Definition at line 179 of file CMatrixViews.h.
| mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol | ( | c1 | ) | [inline] |
Definition at line 180 of file CMatrixViews.h.
| mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow | ( | r1 | ) |
| value_type& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::get_unsafe | ( | size_t | r, | |
| size_t | c | |||
| ) | [inline] |
Definition at line 187 of file CMatrixViews.h.
References mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol, and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::get_unsafe | ( | size_t | r, | |
| size_t | c | |||
| ) | const [inline] |
Definition at line 190 of file CMatrixViews.h.
References mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol, and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow.
| static size_t mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::getColCount | ( | ) | [inline, static] |
Definition at line 184 of file CMatrixViews.h.
| static size_t mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::getRowCount | ( | ) | [inline, static] |
Definition at line 181 of file CMatrixViews.h.
| std::vector<double> mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::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 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::Log | ( | ) | [inline] |
Definition at line 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::maximum | ( | size_t * | maxIndex = NULL |
) | const [inline] |
Finds the maximum value (and the corresponding zero-based index).
Definition at line 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::mean | ( | ) | const [inline] |
Return the mean of the container (for matrices, as if it were a vector with all its elements).
Definition at line 179 of file CMatrixViews.h.
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::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 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::minimum | ( | size_t * | minIndex = NULL |
) | const [inline] |
Finds the minimum value (and the corresponding zero-based index).
Definition at line 179 of file CMatrixViews.h.
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::minimum_maximum | ( | value_type & | out_min, | |
| value_type & | out_max, | |||
| size_t * | minIndex = NULL, |
|||
| size_t * | maxIndex = NULL | |||
| ) | const [inline] |
Minimum and maximum of a vector at once
Definition at line 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::norm | ( | ) | const [inline] |
Return the norm of the container (for matrices, as if it were a vector with all its elements).
Definition at line 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::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 179 of file CMatrixViews.h.
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::normalize | ( | const value_type | min_val = 0, |
|
| const value_type | max_val = 1 | |||
| ) | [inline] |
| max_val | Normalize all the elements such as they are in the given range |
Definition at line 179 of file CMatrixViews.h.
| value_type& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator() | ( | const size_t | r, | |
| const size_t | c | |||
| ) | [inline] |
Definition at line 196 of file CMatrixViews.h.
References mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol, and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator() | ( | const size_t | r, | |
| const size_t | c | |||
| ) | const [inline] |
Definition at line 199 of file CMatrixViews.h.
References mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol, and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator*= | ( | const value_type | n | ) | [inline] |
| n | Multiply by scalar |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator+ | ( | ) | [inline] |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator+= | ( | const value_type | n | ) | [inline] |
| n | Sum a scalar |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator- | ( | ) | const [inline] |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator-= | ( | const value_type | n | ) | [inline] |
| n | Substract a scalar |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator/= | ( | const value_type | n | ) | [inline] |
| n | Divide by scalar |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator= | ( | const OTHERMATRIX & | m | ) | [inline] |
Definition at line 202 of file CMatrixViews.h.
References ASSERT_, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol, and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow.
| static void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::resize | ( | size_t | rtc | ) | [inline, static] |
Definition at line 216 of file CMatrixViews.h.
| mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::RET_VOID_ASSERT_MRPTMATRIX | ( | OTHERMATRIX | ) | [inline] |
this = A * B R = this * C * thisT
| void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::set_unsafe | ( | size_t | r, | |
| size_t | c, | |||
| value_type | v | |||
| ) | [inline] |
Definition at line 193 of file CMatrixViews.h.
References mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base, mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol, and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow.
| static void mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::setSize | ( | size_t | r, | |
| size_t | c | |||
| ) | [inline, static] |
Definition at line 213 of file CMatrixViews.h.
| static CMatrixTemplateSize mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::size | ( | ) | [inline, static] |
Definition at line 208 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::Sqrt | ( | ) | [inline] |
Definition at line 179 of file CMatrixViews.h.
| mrpt_autotype& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::Square | ( | ) | [inline] |
Definition at line 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::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 179 of file CMatrixViews.h.
| double mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::std | ( | bool | unbiased = true |
) | const [inline] |
Return the standard deviation of all the elements in the container.
Definition at line 179 of file CMatrixViews.h.
| value_type mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::sumAll | ( | ) | const [inline] |
Sum all the elements
Definition at line 179 of file CMatrixViews.h.
MATRIXTYPE& mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::base [protected] |
Definition at line 170 of file CMatrixViews.h.
Referenced by mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::get_unsafe(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator()(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator=(), and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::set_unsafe().
size_t mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstCol [protected] |
Definition at line 172 of file CMatrixViews.h.
Referenced by mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::get_unsafe(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator()(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator=(), and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::set_unsafe().
size_t mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::firstRow [protected] |
Definition at line 171 of file CMatrixViews.h.
Referenced by mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::get_unsafe(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator()(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator=(), and mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::set_unsafe().
| Page generated by Doxygen 1.7.1 for MRPT 0.8.1 SVN:exported at Sun Sep 19 14:53:45 UTC 2010 |