MRPT logo

mrpt::math::CVectorTemplate< T > Class Template Reference

This template class provides the basic functionality for a general 1D any-size, resizable container of numerical or non-numerical elements. More...

#include <mrpt/math/CVectorTemplate.h>

Inheritance diagram for mrpt::math::CVectorTemplate< T >:

mrpt::math::CQuaternion< T >

List of all members.

Public Member Functions

 CVectorTemplate (size_t creationSize=0)
 Construct the vector with a given initial size.
 CVectorTemplate (size_t creationSize, const T &initVal)
 Construct the vector with a given initial size and initial filling value.
virtual ~CVectorTemplate ()
void extract_vector (const size_t &index, CVectorTemplate< T > &out)
 This function extract a part of a vector.
CVectorTemplate< T > extract_vector (const size_t index, const unsigned int length)
 This function extract a part of a vector.
void insert_vector (const size_t &index, const CVectorTemplate< T > &in)
 This function insert the vector "in" into in the vector from an index.
void operator+= (const CMatrixTemplateNumeric< T > &M)
 Adds a row or column matrix of the correct length to the vector.
void concatenate (const CVectorTemplate &first, const CVectorTemplate &second)
 This function join two vectors in a new vector.
void deconcatenate (CVectorTemplate &first, CVectorTemplate &second, const size_t &index)
 This function split a vectors in a two new vector.
void find_max (size_t &index, T &val)
 This function find the maximun value of a vector and return this value and his index.
void find_min (size_t &index, T &val)
 This function find the minimun value of a vector and return this value and his index.
void find_min_max (size_t &index_min, size_t &index_max, T &min, T &max)
 This function find the maximun and minimun value of a vector and return this value and his index.
void abs ()
 This function make the vector absolute value for each element.
void loadFromTextFile (const std::string &file)
 This function is a fast solution to read a vector from text, but isn't optimum.
void saveToTextFile (const std::string &file)
 This function is a fast solution to write a vector into a text file, but isn't optimum.
mean ()
 Calculate the mean value of a vector.
CMatrixTemplateNumeric< T > likeMatrix ()
 Return the vector like a matrix with dimension [1 , vector-size].
CVectorTemplate< T > operator+ (CVectorTemplate &b)
 A template function for adding std::vector's having the same number of elements.
CVectorTemplate< T > operator- (CVectorTemplate &b)
 A template function for substracting std::vector's having the same number of elements.
CVectorTemplate< T > operator* (CVectorTemplate &b)
 A template function for scalar product (element by element, like .
CVectorTemplate< T > operator/ (CVectorTemplate &b)
 A template function for scalar division (element by element, like .
CVectorTemplate< T > operator+ (T b)
 A template function for adding a scalar to a std::vector.
CVectorTemplate< T > operator- (T b)
 A template function for subtracting a scalar to a std::vector.
CVectorTemplate< T > operator* (T b)
 A template function for multiplying a scalar to a std::vector.
CVectorTemplate< T > operator/ (T b)
 A template function for adding a scalar to a std::vector.
CMatrixTemplateNumeric< T > operator~ ()
 unary transpose operator

Private Types

typedef std::vector< T > base_class


Detailed Description

template<class T>
class mrpt::math::CVectorTemplate< T >

This template class provides the basic functionality for a general 1D any-size, resizable container of numerical or non-numerical elements.

NOTES:

Definition at line 50 of file CVectorTemplate.h.


Member Typedef Documentation

template<class T >
typedef std::vector<T> mrpt::math::CVectorTemplate< T >::base_class [private]

Definition at line 56 of file CVectorTemplate.h.


Constructor & Destructor Documentation

template<class T >
mrpt::math::CVectorTemplate< T >::CVectorTemplate ( size_t  creationSize = 0  )  [inline]

Construct the vector with a given initial size.

Definition at line 63 of file CVectorTemplate.h.

template<class T >
mrpt::math::CVectorTemplate< T >::CVectorTemplate ( size_t  creationSize,
const T &  initVal 
) [inline]

Construct the vector with a given initial size and initial filling value.

Definition at line 69 of file CVectorTemplate.h.

template<class T >
virtual mrpt::math::CVectorTemplate< T >::~CVectorTemplate (  )  [inline, virtual]

Definition at line 73 of file CVectorTemplate.h.


Member Function Documentation

template<class T >
void mrpt::math::CVectorTemplate< T >::abs (  )  [inline]

This function make the vector absolute value for each element.

Definition at line 256 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::concatenate ( const CVectorTemplate< T > &  first,
const CVectorTemplate< T > &  second 
) [inline]

This function join two vectors in a new vector.

Definition at line 155 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::deconcatenate ( CVectorTemplate< T > &  first,
CVectorTemplate< T > &  second,
const size_t &  index 
) [inline]

This function split a vectors in a two new vector.

Definition at line 169 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::extract_vector ( const size_t  index,
const unsigned int  length 
) [inline]

This function extract a part of a vector.

It's necessary initialize the output vector to desired size.

Definition at line 92 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::extract_vector ( const size_t &  index,
CVectorTemplate< T > &  out 
) [inline]

This function extract a part of a vector.

It's necessary initialize the output vector to desired size.

Definition at line 78 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::find_max ( size_t &  index,
T &  val 
) [inline]

This function find the maximun value of a vector and return this value and his index.

Definition at line 188 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::find_min ( size_t &  index,
T &  val 
) [inline]

This function find the minimun value of a vector and return this value and his index.

Definition at line 208 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::find_min_max ( size_t &  index_min,
size_t &  index_max,
T &  min,
T &  max 
) [inline]

This function find the maximun and minimun value of a vector and return this value and his index.

Definition at line 229 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::insert_vector ( const size_t &  index,
const CVectorTemplate< T > &  in 
) [inline]

This function insert the vector "in" into in the vector from an index.

Definition at line 110 of file CVectorTemplate.h.

template<class T >
CMatrixTemplateNumeric<T> mrpt::math::CVectorTemplate< T >::likeMatrix (  )  [inline]

Return the vector like a matrix with dimension [1 , vector-size].

Definition at line 316 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::loadFromTextFile ( const std::string &  file  )  [inline]

This function is a fast solution to read a vector from text, but isn't optimum.

Definition at line 267 of file CVectorTemplate.h.

template<class T >
T mrpt::math::CVectorTemplate< T >::mean (  )  [inline]

Calculate the mean value of a vector.

Definition at line 305 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator* ( b  )  [inline]

A template function for multiplying a scalar to a std::vector.

Definition at line 413 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator* ( CVectorTemplate< T > &  b  )  [inline]

A template function for scalar product (element by element, like .

* in MATLAB) of std::vector's having the same number of elements.

Definition at line 357 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator+ ( b  )  [inline]

A template function for adding a scalar to a std::vector.

Definition at line 387 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator+ ( CVectorTemplate< T > &  b  )  [inline]

A template function for adding std::vector's having the same number of elements.

Definition at line 327 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::operator+= ( const CMatrixTemplateNumeric< T > &  M  )  [inline]

Adds a row or column matrix of the correct length to the vector.

Definition at line 124 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator- ( b  )  [inline]

A template function for subtracting a scalar to a std::vector.

Definition at line 400 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator- ( CVectorTemplate< T > &  b  )  [inline]

A template function for substracting std::vector's having the same number of elements.

Definition at line 342 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator/ ( b  )  [inline]

A template function for adding a scalar to a std::vector.

Definition at line 426 of file CVectorTemplate.h.

template<class T >
CVectorTemplate<T> mrpt::math::CVectorTemplate< T >::operator/ ( CVectorTemplate< T > &  b  )  [inline]

A template function for scalar division (element by element, like .

/ in MATLAB) of std::vector's having the same number of elements.

Definition at line 372 of file CVectorTemplate.h.

template<class T >
CMatrixTemplateNumeric<T> mrpt::math::CVectorTemplate< T >::operator~ (  )  [inline]

unary transpose operator

Definition at line 439 of file CVectorTemplate.h.

template<class T >
void mrpt::math::CVectorTemplate< T >::saveToTextFile ( const std::string &  file  )  [inline]

This function is a fast solution to write a vector into a text file, but isn't optimum.

Definition at line 294 of file CVectorTemplate.h.




Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 23:10:56 EDT 2009