LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::boundsFunctor< T > Class Template Reference

Boudaries of a hyperbox enclosing all points of a n-dimensional space. More...

#include <ltiBoundsFunctor.h>

Inheritance diagram for lti::boundsFunctor< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::boundsFunctor< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class boundsFunctor More...

Public Member Functions

 boundsFunctor ()
 boundsFunctor (const boundsFunctor &other)
virtual ~boundsFunctor ()
virtual const char * getTypeName () const
void apply (const matrix< T > &src, vector< T > &min, vector< T > &max) const
void minOfRows (const matrix< T > &src, vector< T > &dest) const
void minOfRowVectors (const matrix< T > &src, vector< T > &dest) const
void maxOfRows (const matrix< T > &src, vector< T > &dest) const
void maxOfRowVectors (const matrix< T > &src, vector< T > &dest) const
void minOfColumns (const matrix< T > &src, vector< T > &dest) const
void minOfColumnVectors (const matrix< T > &src, vector< T > &dest) const
void maxOfColumns (const matrix< T > &src, vector< T > &dest) const
void maxOfColumnVectors (const matrix< T > &src, vector< T > &dest) const
void boundsOfRows (const matrix< T > &src, vector< T > &min, vector< T > &max) const
void boundsOfRowVectors (const matrix< T > &src, vector< T > &min, vector< T > &max) const
void boundsOfColumns (const matrix< T > &src, vector< T > &min, vector< T > &max) const
void boundsOfColumnVectors (const matrix< T > &src, vector< T > &min, vector< T > &max) const
void min (const vector< T > &a, const vector< T > &b, vector< T > &dest) const
void max (const vector< T > &a, const vector< T > &b, vector< T > &dest) const
void clip (vector< T > &a, const vector< T > &lowerBounds, const vector< T > &upperBounds) const
void clip (matrix< T > &a, const matrix< T > &lowerBounds, const matrix< T > &upperBounds) const
boundsFunctorcopy (const boundsFunctor &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

template<class T>
class lti::boundsFunctor< T >

Boudaries of a hyperbox enclosing all points of a n-dimensional space.

This functor computes for each "dimension" of points in a n-dimensional space the extrema (i.e. minimum and maximum values). This way, it computes the boundaries of a hyperbox where all points are contained.

The points are given in form of vectors. If a matrix is given, the parameter parameters::rowWise indicates if the vectors are taken from the rows (true) or from the columns (false) of the matrix.

Several methods besides the standard apply() are provided in order to clip points into a given hyperbox.


Constructor & Destructor Documentation

template<class T>
lti::boundsFunctor< T >::boundsFunctor (  ) 

default constructor

template<class T>
lti::boundsFunctor< T >::boundsFunctor ( const boundsFunctor< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T>
virtual lti::boundsFunctor< T >::~boundsFunctor (  )  [virtual]

destructor


Member Function Documentation

template<class T>
void lti::boundsFunctor< T >::apply ( const matrix< T > &  src,
vector< T > &  min,
vector< T > &  max 
) const

The result of this function depends on the value of parameters.rowWise.

If this parameter is true, the functor will compute a vector, whose elements contain each the mean of one column of the matrix (the computes the mean of the rows, where each row is a data point in n-dimensional space. if rowWise is false, the result vector contains the mean of the columns of the matrix (each column a data point).

Parameters:
src matrix<T> with the source data.
min vector<T> where the minimum vector of the matrix will be left
max vector<T> where the maximum vector of the matrix will be left
template<class T>
void lti::boundsFunctor< T >::boundsOfColumns ( const matrix< T > &  src,
vector< T > &  min,
vector< T > &  max 
) const

This function is a combination of minOfColumns and maxOfColumns.

Parameters:
src matrix<T> with the source data.
min vector<T> where the minimum will be left.
max vector<T> where the maximum will be left.

Referenced by lti::boundsFunctor< int >::boundsOfColumnVectors().

template<class T>
void lti::boundsFunctor< T >::boundsOfColumnVectors ( const matrix< T > &  src,
vector< T > &  min,
vector< T > &  max 
) const [inline]

Alias for boundsOfColumns.

Parameters:
src matrix<T> with the source data.
min vector<T> where the minimum will be left.
max vector<T> where the maximum will be left.
template<class T>
void lti::boundsFunctor< T >::boundsOfRows ( const matrix< T > &  src,
vector< T > &  min,
vector< T > &  max 
) const

This function is a combination of minOfRows and maxOfRows.

Parameters:
src matrix<T> with the source data.
min vector<T> where the minimum will be left.
max vector<T> where the maximum will be left.

Referenced by lti::boundsFunctor< int >::boundsOfRowVectors(), and lti::SOFM2DVisualizer::sammonsMapper().

template<class T>
void lti::boundsFunctor< T >::boundsOfRowVectors ( const matrix< T > &  src,
vector< T > &  min,
vector< T > &  max 
) const [inline]

Alias for boundsOfRows.

Parameters:
src matrix<T> with the source data.
min vector<T> where the minimum will be left.
max vector<T> where the maximum will be left.
template<class T>
void lti::boundsFunctor< T >::clip ( matrix< T > &  a,
const matrix< T > &  lowerBounds,
const matrix< T > &  upperBounds 
) const

Clips the values of the matrix a to lowerBounds and upperBounds.

For each matrix element a[i][j], if lowerBounds[i][j] <= a[i][j] <= higherBounds[i][j], the value of a[i][j] remains unchanged. If a[i][j] < lowerBounds[i][j], a[i][j] will be set to lowerBounds[i][j]. Analagous with upperBounds.

Parameters:
a matrix<T> to be clipped.
lowerBounds matrix<T> which contains the smallest permitted elements.
upperBounds matrix<T> which contains the largest permitted elements.
template<class T>
void lti::boundsFunctor< T >::clip ( vector< T > &  a,
const vector< T > &  lowerBounds,
const vector< T > &  upperBounds 
) const

Clips the values of the vector a to lowerBounds and upperBounds.

For each vector element a[i], if lowerBounds[i] <= a[i] <= higherBounds[i], the value of a[i] remains unchanged. If a[i] < lowerBounds[i], a[i] will be set to lowerBounds[i]. Analagous with upperBounds.

Parameters:
a vector<T> to be clipped.
lowerBounds vector<T> which contains the smallest permitted elements.
upperBounds vector<T> which contains the largest permitted elements.
template<class T>
virtual functor* lti::boundsFunctor< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Reimplemented from lti::statisticsFunctor.

template<class T>
boundsFunctor& lti::boundsFunctor< T >::copy ( const boundsFunctor< T > &  other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::statisticsFunctor.

template<class T>
const parameters& lti::boundsFunctor< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::statisticsFunctor.

template<class T>
virtual const char* lti::boundsFunctor< T >::getTypeName (  )  const [virtual]

returns the name of this type ("boundsFunctor")

Reimplemented from lti::statisticsFunctor.

template<class T>
void lti::boundsFunctor< T >::max ( const vector< T > &  a,
const vector< T > &  b,
vector< T > &  dest 
) const

Computes a vector which contains the maximum elements of a and b.

Parameters:
a vector<T> first operand
b vector<T> second operand
dest vector<T> which will receive the element-wise maximum of both operands
template<class T>
void lti::boundsFunctor< T >::maxOfColumns ( const matrix< T > &  src,
vector< T > &  dest 
) const

This function will compute a vector, whose elements contain each the maximum of one row of the matrix (this computes the n-dimensional equivalent of an upper-right corner of the bounding box of a data set, where each column is a data point in n-dimensional space).

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.

Referenced by lti::boundsFunctor< int >::maxOfColumnVectors().

template<class T>
void lti::boundsFunctor< T >::maxOfColumnVectors ( const matrix< T > &  src,
vector< T > &  dest 
) const [inline]

Alias for maxOfColumns.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
template<class T>
void lti::boundsFunctor< T >::maxOfRows ( const matrix< T > &  src,
vector< T > &  dest 
) const

This function will compute a vector, whose elements contain each the maximum of one column of the matrix (this computes the n-dimensional equivalent of an upper-right corner of the bounding box of a data set, where each row is a data point in n-dimensional space).

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.

Referenced by lti::boundsFunctor< int >::maxOfRowVectors().

template<class T>
void lti::boundsFunctor< T >::maxOfRowVectors ( const matrix< T > &  src,
vector< T > &  dest 
) const [inline]

Alias for maxOfRows.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
template<class T>
void lti::boundsFunctor< T >::min ( const vector< T > &  a,
const vector< T > &  b,
vector< T > &  dest 
) const

Computes a vector which contains the minimum elements of a and b.

Parameters:
a vector<T> first operand
b vector<T> second operand
dest vector<T> which will receive the element-wise minimum of both operands
template<class T>
void lti::boundsFunctor< T >::minOfColumns ( const matrix< T > &  src,
vector< T > &  dest 
) const

This function will compute a vector, whose elements contain each the minimum of one row of the matrix (this computes the n-dimensional equivalent of a lower-left corner of the bounding box of a data set, where each column is a data point in n-dimensional space).

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.

Referenced by lti::boundsFunctor< int >::minOfColumnVectors().

template<class T>
void lti::boundsFunctor< T >::minOfColumnVectors ( const matrix< T > &  src,
vector< T > &  dest 
) const [inline]

Alias for minOfColumns.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
template<class T>
void lti::boundsFunctor< T >::minOfRows ( const matrix< T > &  src,
vector< T > &  dest 
) const

This function will compute a vector, whose elements contain each the minimum of one column of the matrix (this computes the n-dimensional equivalent of a lower-left corner of the bounding box of a data set, where each row is a data point in n-dimensional space).

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.

Referenced by lti::boundsFunctor< int >::minOfRowVectors().

template<class T>
void lti::boundsFunctor< T >::minOfRowVectors ( const matrix< T > &  src,
vector< T > &  dest 
) const [inline]

Alias for minOfRows.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.

The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:28:10 2010 for LTI-Lib by Doxygen 1.6.1