MRPT logo
Classes | Public Types | Protected Attributes

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

A wrapper around an existing const matrix (of any kind) that allows operating on the transposed matrix. More...

#include <mrpt/math/CMatrixViews.h>

Inheritance diagram for mrpt::math::CConstMatrixViewTranspose< MAT >:
Inheritance graph
[legend]
Collaboration diagram for mrpt::math::CConstMatrixViewTranspose< MAT >:
Collaboration graph
[legend]

List of all members.

Classes

struct  mrpt_container

Public Types

enum  dummy_enum { mrpt_matrix_type_ncols = -1, mrpt_matrix_type_nrows = -1 }
typedef
CConstMatrixViewTranspose< MAT > 
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)
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*
 CConstMatrixViewTranspose (const MAT &m)
size_t getRowCount () const
size_t getColCount () const
value_type get_unsafe (size_t r, size_t c) const
value_type operator() (size_t r, size_t c) const
CMatrixTemplateSize size () const
void setSize (size_t r, size_t c)
void resize (size_t rc)

Protected Attributes

const MAT & base

Detailed Description

template<class MAT>
class mrpt::math::CConstMatrixViewTranspose< MAT >

A wrapper around an existing const matrix (of any kind) that allows operating on the transposed matrix.

Example of usage:

  const CMatrixDouble  C(4,2);
  CConstMatrixViewTranspose<CMatrixDouble>  Ct(C);  // Transpose view of C

Definition at line 120 of file CMatrixViews.h.


Member Typedef Documentation

Definition at line 124 of file CMatrixViews.h.


Member Enumeration Documentation

Enumerator:
mrpt_matrix_type_ncols 
mrpt_matrix_type_nrows 

Definition at line 127 of file CMatrixViews.h.


Constructor & Destructor Documentation

template<class MAT >
mrpt::math::CConstMatrixViewTranspose< MAT >::CConstMatrixViewTranspose ( const MAT &  m  )  [inline]

Definition at line 130 of file CMatrixViews.h.


Member Function Documentation

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::Abs (  )  [inline]

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
void mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

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

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

Definition at line 129 of file CMatrixViews.h.

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

template<class MAT >
size_t mrpt::math::CConstMatrixViewTranspose< MAT >::countNonZero (  )  const [inline]

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

Definition at line 129 of file CMatrixViews.h.

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

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

Cumsum of all the elements, saving in an output container

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::Exp (  )  [inline]

Definition at line 129 of file CMatrixViews.h.

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

Fill all the elements with a given value

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< MAT >::get_unsafe ( size_t  r,
size_t  c 
) const [inline]
template<class MAT >
size_t mrpt::math::CConstMatrixViewTranspose< MAT >::getColCount (  )  const [inline]
template<class MAT >
size_t mrpt::math::CConstMatrixViewTranspose< MAT >::getRowCount (  )  const [inline]
template<class MAT >
std::vector<double> mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::Log (  )  [inline]

Definition at line 129 of file CMatrixViews.h.

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

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

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

template<class MAT >
void mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

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

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

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
void mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

template<class MAT >
void mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< MAT >::operator() ( size_t  r,
size_t  c 
) const [inline]
template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::operator*= ( const value_type  n  )  [inline]
Parameters:
n Multiply by scalar

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype mrpt::math::CConstMatrixViewTranspose< MAT >::operator+ (  )  [inline]

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::operator+= ( const value_type  n  )  [inline]
Parameters:
n Sum a scalar

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype mrpt::math::CConstMatrixViewTranspose< MAT >::operator- (  )  const [inline]

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::operator-= ( const value_type  n  )  [inline]
Parameters:
n Substract a scalar

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::operator/= ( const value_type  n  )  [inline]
Parameters:
n Divide by scalar

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
void mrpt::math::CConstMatrixViewTranspose< MAT >::resize ( size_t  rc  )  [inline]
template<class MAT >
template<typename OTHERMATRIX >
mrpt::math::CConstMatrixViewTranspose< MAT >::RET_VOID_ASSERT_MRPTMATRIX ( OTHERMATRIX   )  [inline]

this = A * B R = this * C * thisT

See also:
detail::multiply_HCHt R = thisT * C * this
detail::multiply_HtCH outResult = this * A this = A*B*C this = A*B*(CT) this = A * BT this = A * AT this = AT * A this = A * B (result is symmetric) Pseudo inverse of this matrix M: out = (MT * M)^-1 * MT Pseudo inverse of this matrix M: return (MT * M)^-1 * MT. Invoke with template argument for desired return matrix type: m.pseudoInverse<CMatrixDouble>() Returns the determinant of the matrix out = inv(this) mrpt_autotype out = inv(this) out = inv(this), overwriting contents of this
template<class MAT >
void mrpt::math::CConstMatrixViewTranspose< MAT >::setSize ( size_t  r,
size_t  c 
) [inline]
template<class MAT >
CMatrixTemplateSize mrpt::math::CConstMatrixViewTranspose< MAT >::size (  )  const [inline]
template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::Sqrt (  )  [inline]

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
mrpt_autotype& mrpt::math::CConstMatrixViewTranspose< MAT >::Square (  )  [inline]

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< 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 129 of file CMatrixViews.h.

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

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

Definition at line 129 of file CMatrixViews.h.

template<class MAT >
value_type mrpt::math::CConstMatrixViewTranspose< MAT >::sumAll (  )  const [inline]

Sum all the elements

Definition at line 129 of file CMatrixViews.h.


Member Data Documentation

template<class MAT >
const MAT& mrpt::math::CConstMatrixViewTranspose< MAT >::base [protected]



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