MRPT logo
Classes | Public Types | Protected Attributes

mrpt::math::CConstMatrixColumnAccessorExtended< MAT > Class Template Reference

A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] operator, with offset and custom spacing. More...

#include <mrpt/math/CMatrixViews.h>

List of all members.

Classes

struct  mrpt_container

Public Types

typedef MAT::value_type value_type
typedef
CMatrixColumnAccessorExtended
< MAT > 
mrpt_autotype

Protected Attributes

const MAT * m_mat
size_t m_colInd
size_t m_rowOffset
size_t m_elementsSpace
size_t howMany

Methods common to all containers



typedef
detail::AccessorIterator
< const
CConstMatrixColumnAccessorExtended
< MAT >, const value_type > 
const_iterator
typedef
detail::ReverseAccessorIterator
< const
CConstMatrixColumnAccessorExtended
< MAT >, const value_type > 
const_reverse_iterator
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)
 CConstMatrixColumnAccessorExtended (const MAT &mat, size_t col, size_t offset, size_t space)
 CConstMatrixColumnAccessorExtended ()
value_type operator[] (size_t i) const
const_iterator begin () const
const_iterator end () const
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
size_t size () const
void resize (size_t N)

Detailed Description

template<typename MAT>
class mrpt::math::CConstMatrixColumnAccessorExtended< MAT >

A vector-like wrapper for a const Matrix for accessing the elements of a given column with a [] operator, with offset and custom spacing.

See also:
CConstMatrixRowAccessorExtended,CMatrixColumnAccessor,CConstMatrixColumnAccessor,CMatrixColumnAccessorExtended

Definition at line 776 of file CMatrixViews.h.


Member Typedef Documentation

Definition at line 797 of file CMatrixViews.h.

Definition at line 798 of file CMatrixViews.h.

Definition at line 785 of file CMatrixViews.h.

template<typename MAT>
typedef MAT::value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::value_type

Definition at line 784 of file CMatrixViews.h.


Constructor & Destructor Documentation

template<typename MAT>
mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::CConstMatrixColumnAccessorExtended ( const MAT &  mat,
size_t  col,
size_t  offset,
size_t  space 
) [inline]

Definition at line 789 of file CMatrixViews.h.

References ASSERT_.

Definition at line 793 of file CMatrixViews.h.


Member Function Documentation

template<typename MAT>
mrpt_autotype& mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::Abs (  )  [inline]

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
void mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::adjustRange ( const value_type  min_val,
const value_type  max_val 
) [inline]
Parameters:
max_val Normalize all the elements such as they are in the given range

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
template<class F >
mrpt_autotype& mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::applyToAllElements ( value_type(*)(value_type)  function  )  [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
const_iterator mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::begin (  )  const [inline]

Definition at line 799 of file CMatrixViews.h.

template<typename MAT>
template<class CONTAINER2 >
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

template<typename MAT>
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::countNonZero (  )  const [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
template<class CONTAINEROUT >
CONTAINEROUT mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

template<typename MAT>
template<class CONTAINEROUT >
void mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::cumsum ( CONTAINEROUT &  out  )  const [inline]

Cumsum of all the elements, saving in an output container

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
const_iterator mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::end (  )  const [inline]

Definition at line 802 of file CMatrixViews.h.

template<typename MAT>
mrpt_autotype& mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::Exp (  )  [inline]

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
void mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::fill ( const value_type &  val  )  [inline]

Fill all the elements with a given value

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
std::vector<double> mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

template<typename MAT>
mrpt_autotype& mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::Log (  )  [inline]

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::maximum ( size_t *  maxIndex = NULL  )  const [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::mean (  )  const [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
void mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::minimum ( size_t *  minIndex = NULL  )  const [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
void mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::norm (  )  const [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::operator[] ( size_t  i  )  const [inline]
template<typename MAT>
const_reverse_iterator mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::rbegin (  )  const [inline]

Definition at line 805 of file CMatrixViews.h.

template<typename MAT>
const_reverse_iterator mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::rend (  )  const [inline]

Definition at line 808 of file CMatrixViews.h.

template<typename MAT>
void mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::resize ( size_t  N  )  [inline]

Definition at line 814 of file CMatrixViews.h.

References mrpt::math::CMatrixColumnAccessor< MAT >::size().

template<typename MAT>
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::size (  )  const [inline]

Definition at line 811 of file CMatrixViews.h.

template<typename MAT>
mrpt_autotype& mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::Sqrt (  )  [inline]

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
mrpt_autotype& mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::Square (  )  [inline]

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::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 788 of file CMatrixViews.h.

template<typename MAT>
double mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::std ( bool  unbiased = true  )  const [inline]

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

Definition at line 788 of file CMatrixViews.h.

template<typename MAT>
value_type mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::sumAll (  )  const [inline]

Sum all the elements

Definition at line 788 of file CMatrixViews.h.


Member Data Documentation

template<typename MAT>
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::howMany [protected]

Definition at line 782 of file CMatrixViews.h.

template<typename MAT>
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::m_colInd [protected]

Definition at line 779 of file CMatrixViews.h.

template<typename MAT>
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::m_elementsSpace [protected]

Definition at line 781 of file CMatrixViews.h.

template<typename MAT>
const MAT* mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::m_mat [protected]

Definition at line 778 of file CMatrixViews.h.

template<typename MAT>
size_t mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::m_rowOffset [protected]

Definition at line 780 of file CMatrixViews.h.




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