RTT::MultiVector< S, T > Struct Template Reference

A static allocated Vector. More...

#include <rtt/MultiVector.hpp>

List of all members.

Public Types

enum  Size { size = S }
 

The size of this MultiVector is stored in this enum.


typedef T DataType [S]
 You can use DataType if you want to refer to a pointer holding S elements.

Public Member Functions

 operator const T * () const
 Returns a pointer to the data.
 operator T & ()
 Returns a reference to the data.
 MultiVector (const T d)
 Creates a vector with all elements initialized to d.
 MultiVector ()
 Creates a vector with all elements initialized to zero.
template<class Alloc >
 MultiVector (const std::vector< T, Alloc > &vect)
 Creates a vector from a std::vector.
MultiVectoroperator+= (const MultiVector &d)
 Adds another MultiVector to this MultiVector.
MultiVectoroperator*= (const MultiVector &d)
 Vector product of another MultiVector with this MultiVector.
MultiVectoroperator*= (const T d)
 Scalar product of a scalar with this MultiVector.
MultiVector operator- (const MultiVector &d) const
 Returns the difference between this and another MultiVector.
MultiVector operator- () const
MultiVector operator+ (const MultiVector &d) const
 Returns the addition of this and another MultiVector.
MultiVector operator* (const MultiVector &d) const
 Returns the vector product of this and another MultiVector.
MultiVector operator/ (const T d) const
MultiVector operator* (const T d) const
 Returns the scalar product of this and a scalar value.
MultiVectoroperator= (const MultiVector &d)
 Assigns all elements of this MultiVector to all elements of another MultiVector.
bool operator== (const MultiVector &d)
 Compares all elements of this MultiVector to all elements of another MultiVector.
bool operator!= (const MultiVector &d)
 Compares elements of this MultiVector are different from elements of another MultiVector.
template<class Alloc >
void getVector (std::vector< T, Alloc > &vect) const
 Return the contents of this MultiVector as an std::vector Resizes vect to the size of this MultiVector.
template<class Alloc >
bool setVector (const std::vector< T, Alloc > &vect)
 Set the contents of this MultiVector from an std::vector.
MultiVectoroperator= (const T d)
 Assigns a scalar value to all elements of this Multivector and returns a reference of the result.
T & operator[] (unsigned int i)
 Not checked index operator to the internal data.

Public Attributes

DataType data
 The data contained in the MultiVector.

Detailed Description

template<unsigned S = 6, class T = double>
struct RTT::MultiVector< S, T >

A static allocated Vector.

The MultiVector is an n (defaults to 6) dimensional vector of any type T, mostly used for holding primitive types. Most common casting and operators are defined on this class.

Parameters:
S The number of elements in the vector
T The type of all elements in the vector

Definition at line 71 of file MultiVector.hpp.


Constructor & Destructor Documentation

template<unsigned S = 6, class T = double>
RTT::MultiVector< S, T >::MultiVector ( const T  d  )  [inline]

Creates a vector with all elements initialized to d.

Parameters:
d The value to be used for initialisation of all elements

Definition at line 112 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
template<class Alloc >
RTT::MultiVector< S, T >::MultiVector ( const std::vector< T, Alloc > &  vect  )  [inline]

Creates a vector from a std::vector.

If there are more items in vect than the size of this Multivector, they are ignored, if there are less items in vect, the remainder is filled with zeros.

Definition at line 134 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.


Member Function Documentation

template<unsigned S = 6, class T = double>
bool RTT::MultiVector< S, T >::operator!= ( const MultiVector< S, T > &  d  )  [inline]

Compares elements of this MultiVector are different from elements of another MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 306 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector RTT::MultiVector< S, T >::operator* ( const T  d  )  const [inline]

Returns the scalar product of this and a scalar value.

Parameters:
d The scalar

Definition at line 259 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector RTT::MultiVector< S, T >::operator* ( const MultiVector< S, T > &  d  )  const [inline]

Returns the vector product of this and another MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 233 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector& RTT::MultiVector< S, T >::operator*= ( const T  d  )  [inline]

Scalar product of a scalar with this MultiVector.

Parameters:
d The scalar

Definition at line 177 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector& RTT::MultiVector< S, T >::operator*= ( const MultiVector< S, T > &  d  )  [inline]

Vector product of another MultiVector with this MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 163 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector RTT::MultiVector< S, T >::operator+ ( const MultiVector< S, T > &  d  )  const [inline]

Returns the addition of this and another MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 217 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector& RTT::MultiVector< S, T >::operator+= ( const MultiVector< S, T > &  d  )  [inline]

Adds another MultiVector to this MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 149 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector RTT::MultiVector< S, T >::operator- ( const MultiVector< S, T > &  d  )  const [inline]

Returns the difference between this and another MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 191 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector& RTT::MultiVector< S, T >::operator= ( const T  d  )  [inline]

Assigns a scalar value to all elements of this Multivector and returns a reference of the result.

Parameters:
d The scalar

Definition at line 363 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
MultiVector& RTT::MultiVector< S, T >::operator= ( const MultiVector< S, T > &  d  )  [inline]

Assigns all elements of this MultiVector to all elements of another MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 276 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
bool RTT::MultiVector< S, T >::operator== ( const MultiVector< S, T > &  d  )  [inline]

Compares all elements of this MultiVector to all elements of another MultiVector.

Parameters:
d The other MultiVector to be used.

Definition at line 291 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
T& RTT::MultiVector< S, T >::operator[] ( unsigned int  i  )  [inline]

Not checked index operator to the internal data.

Parameters:
i The element to be accessed starting from zero.

Definition at line 378 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.

template<unsigned S = 6, class T = double>
template<class Alloc >
bool RTT::MultiVector< S, T >::setVector ( const std::vector< T, Alloc > &  vect  )  [inline]

Set the contents of this MultiVector from an std::vector.

Returns:
false if vect has wrong size.

Definition at line 331 of file MultiVector.hpp.

References RTT::MultiVector< S, T >::data.


Member Data Documentation

template<unsigned S = 6, class T = double>
DataType RTT::MultiVector< S, T >::data

The documentation for this struct was generated from the following file:
Generated on Thu Dec 23 13:22:43 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3