MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Public Types | Public Member Functions | Protected Attributes
mds::math::CStaticVector< T, M > Class Template Reference

Class template for a static vector. More...

#include <mdsStaticVector.h>

Inheritance diagram for mds::math::CStaticVector< T, M >:
Inheritance graph
[legend]

List of all members.

Public Types

enum  { CLASS_VECTOR }
 Templates that require members of the CStaticVector class can use this enum to check the existence. More...
enum  { SIZE = M }
 The vector size. More...
typedef CVectorBase
< CStaticVector< T, M > > 
tBase
 Base class.
typedef T tElement
 Vector element type.
typedef Eigen::Matrix
< tElement, SIZE,
1, Eigen::ColMajor > 
tStorage
 Underlying data (see the Eigen math library).
typedef CStaticVector< T, M > tVector
 Vector type.

Public Member Functions

CStaticVectorabs ()
 Absolute value of all elements.
tStorageasEigen ()
 Returns reference to the underlying data (see the Eigen math library).
const tStorageasEigen () const
T & at (tSize i)
 Returns reference to the element [i].
const T & at (tSize i) const
template<typename U >
 CStaticVector (const CStaticVector< U, M > &Vector)
template<typename Derived >
 CStaticVector (const Eigen::MatrixBase< Derived > &Vector)
 CStaticVector ()
 Declare iterator types tIterator and tConstIterator.
template<typename U >
 CStaticVector (const CStaticVector< U, M > &Vector)
 Copy constructor.
template<typename Derived >
 CStaticVector (const Eigen::MatrixBase< Derived > &Vector)
 Conversion constructor.
 CStaticVector (const CStaticVector &Vector)
 Specialization of the copy constructor.
CStaticVectorfill (const T &Value)
 Sets all elements of the vector to a given value.
template<class Function >
Function forEach (Function Func)
 Calls a function object for every vector element.
template<class Function >
Function forEach (Function Func) const
 Calls a function object for every vector element.
template<class Function >
Function forEach (Function Func)
 Calls a function object for every vector element.
template<class Function >
Function forEach (Function Func) const
 Calls a function object for every vector element.
tVectorgetImpl ()
 Returns reference to the vector implementation.
const tVectorgetImpl () const
T * getPtr ()
 Returns pointer to the vector data.
const T * getPtr () const
T * getPtr (tSize i)
 Returns pointer to a given element.
const T * getPtr (tSize i) const
tSize getSize () const
 Returns the vector size.
tSize getStride () const
 Returns stride between two neigbouring vector elements.
template<tSize K>
CStaticVectormult (const CStaticMatrix< T, M, K > &Matrix, const CStaticVector< T, K > &Vector)
 Matrix vs.
template<tSize K>
CStaticVectormult (const CStaticVector< T, K > &Vector, const CStaticMatrix< T, K, M > &Matrix)
 Row vector vs.
template<tSize K>
CStaticVector< T, M > & mult (const CStaticMatrix< T, M, K > &Matrix, const CStaticVector< T, K > &Vector)
template<tSize K>
CStaticVector< T, M > & mult (const CStaticVector< T, K > &Vector, const CStaticMatrix< T, K, M > &Matrix)
CStaticVectormultAdd (const CStaticVector &Vector, const T &Scalar)
 Provides operation this += Vector * Scalar.
CStaticVectorones ()
 The vector initialization method.
T & operator() (tSize i)
 Returns reference to the subscripted element [i].
const T & operator() (tSize i) const
template<typename U >
CStaticVector< T, M > & operator*= (const CScalar< U > &c)
CStaticVectoroperator*= (const CStaticVector &v)
 Element wise product.
template<typename U >
CStaticVectoroperator*= (const CScalar< U > &c)
 Multiplies all elements by scalar.
template<typename U >
CStaticVector< T, M > & operator+= (const CScalar< U > &c)
CStaticVectoroperator+= (const CStaticVector &v)
 Element wise addition.
template<typename U >
CStaticVectoroperator+= (const CScalar< U > &c)
 Adds scalar to all elements.
template<typename U >
CStaticVector< T, M > & operator-= (const CScalar< U > &c)
CStaticVectoroperator-= (const CStaticVector &v)
 Element wise subtraction.
template<typename U >
CStaticVectoroperator-= (const CScalar< U > &c)
 Subtracts scalar from all elements.
template<typename U >
CStaticVector< T, M > & operator/= (const CScalar< U > &c)
CStaticVectoroperator/= (const CStaticVector &v)
 Element wise addition.
template<typename U >
CStaticVectoroperator/= (const CScalar< U > &c)
 Divides all elements by scalar.
template<typename U >
CStaticVector< T, M > & operator= (const CStaticVector< U, M > &Vector)
template<typename Derived >
CStaticVector< T, M > & operator= (const Eigen::MatrixBase< Derived > &Vector)
template<typename U >
CStaticVectoroperator= (const CStaticVector< U, M > &Vector)
 Assignment operator.
template<typename Derived >
CStaticVectoroperator= (const Eigen::MatrixBase< Derived > &Vector)
 Assignment operator.
CStaticVectoroperator= (const CStaticVector &Vector)
 Specialization of the assignment operator.
tVectorset (tSize i, const tElement &Value)
 Sets the vector element at the position [i].
CStaticVectorset (tSize i, const T &Value)
 Sets the vector element at the position [i].
tSize size () const
 Returns the vector size.
CStaticVectorzeros ()
 The vector initialization method.
 ~CStaticVector ()
 Destructor.

Protected Attributes

tStorage m_Vector
 Underlying vector data (see the Eigen library).

Detailed Description

template<typename T, tSize M>
class mds::math::CStaticVector< T, M >

Class template for a static vector.


Member Typedef Documentation

template<typename T, tSize M>
typedef CVectorBase<CStaticVector<T,M> > mds::math::CStaticVector< T, M >::tBase
template<typename T, tSize M>
typedef T mds::math::CStaticVector< T, M >::tElement

Vector element type.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
typedef Eigen::Matrix<tElement, SIZE, 1, Eigen::ColMajor> mds::math::CStaticVector< T, M >::tStorage

Underlying data (see the Eigen math library).

typedef CStaticVector< T, M > mds::math::CVectorBase< CStaticVector< T, M > >::tVector [inherited]

Vector type.

Reimplemented in mds::img::CFeatureVector< T, Size >.


Member Enumeration Documentation

template<typename T, tSize M>
anonymous enum

Templates that require members of the CStaticVector class can use this enum to check the existence.

Enumerator:
CLASS_VECTOR 
template<typename T, tSize M>
anonymous enum

The vector size.

Enumerator:
SIZE 

Constructor & Destructor Documentation

template<typename T , tSize M>
CStaticVector::CStaticVector ( )

Declare iterator types tIterator and tConstIterator.

Constructor.

template<typename T , tSize M>
template<typename U >
mds::math::CStaticVector< T, M >::CStaticVector ( const CStaticVector< U, M > &  Vector)

Copy constructor.

template<typename T , tSize M>
template<typename Derived >
mds::math::CStaticVector< T, M >::CStaticVector ( const Eigen::MatrixBase< Derived > &  Vector)

Conversion constructor.

template<typename T , tSize M>
mds::math::CStaticVector< T, M >::CStaticVector ( const CStaticVector< T, M > &  Vector)

Specialization of the copy constructor.

template<typename T, tSize M>
mds::math::CStaticVector< T, M >::~CStaticVector ( )

Destructor.

template<typename T, tSize M>
template<typename U >
mds::math::CStaticVector< T, M >::CStaticVector ( const CStaticVector< U, M > &  Vector)
template<typename T, tSize M>
template<typename Derived >
mds::math::CStaticVector< T, M >::CStaticVector ( const Eigen::MatrixBase< Derived > &  Vector)

Member Function Documentation

template<typename T , tSize M>
CStaticVector< T, M > & CStaticVector::abs ( )

Absolute value of all elements.

  • Returns reference to this.
template<typename T, tSize M>
tStorage& mds::math::CStaticVector< T, M >::asEigen ( )

Returns reference to the underlying data (see the Eigen math library).

template<typename T, tSize M>
const tStorage& mds::math::CStaticVector< T, M >::asEigen ( ) const
template<typename T, tSize M>
T& mds::math::CStaticVector< T, M >::at ( tSize  i)

Returns reference to the element [i].

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
const T& mds::math::CStaticVector< T, M >::at ( tSize  i) const
template<typename T, tSize M>
CStaticVector< T, M > & CStaticVector::fill ( const T &  Value)

Sets all elements of the vector to a given value.

  • Returns reference to this.
template<typename T , tSize M>
template<class Function >
Function mds::math::CStaticVector< T, M >::forEach ( Function  Func)

Calls a function object for every vector element.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T , tSize M>
template<class Function >
Function mds::math::CStaticVector< T, M >::forEach ( Function  Func) const

Calls a function object for every vector element.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
template<class Function >
Function mds::math::CStaticVector< T, M >::forEach ( Function  Func)

Calls a function object for every vector element.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
template<class Function >
Function mds::math::CStaticVector< T, M >::forEach ( Function  Func) const

Calls a function object for every vector element.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

tVector& mds::math::CVectorBase< CStaticVector< T, M > >::getImpl ( ) [inherited]

Returns reference to the vector implementation.

const tVector& mds::math::CVectorBase< CStaticVector< T, M > >::getImpl ( ) const [inherited]
template<typename T, tSize M>
T* mds::math::CStaticVector< T, M >::getPtr ( )

Returns pointer to the vector data.

template<typename T, tSize M>
const T* mds::math::CStaticVector< T, M >::getPtr ( ) const
template<typename T, tSize M>
T* mds::math::CStaticVector< T, M >::getPtr ( tSize  i)

Returns pointer to a given element.

template<typename T, tSize M>
const T* mds::math::CStaticVector< T, M >::getPtr ( tSize  i) const
template<typename T, tSize M>
tSize mds::math::CStaticVector< T, M >::getSize ( ) const

Returns the vector size.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
tSize mds::math::CStaticVector< T, M >::getStride ( ) const

Returns stride between two neigbouring vector elements.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
template<tSize K>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::mult ( const CStaticMatrix< T, M, K > &  Matrix,
const CStaticVector< T, K > &  Vector 
)

Matrix vs.

column vector multiplication.

  • Returns reference to this.
template<typename T, tSize M>
template<tSize K>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::mult ( const CStaticVector< T, K > &  Vector,
const CStaticMatrix< T, K, M > &  Matrix 
)

Row vector vs.

matrix multiplication.

  • Returns reference to this.
template<typename T, tSize M>
template<tSize K>
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::mult ( const CStaticMatrix< T, M, K > &  Matrix,
const CStaticVector< T, K > &  Vector 
)
template<typename T, tSize M>
template<tSize K>
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::mult ( const CStaticVector< T, K > &  Vector,
const CStaticMatrix< T, K, M > &  Matrix 
)
template<typename T, tSize M>
CStaticVector< T, M > & CStaticVector::multAdd ( const CStaticVector< T, M > &  Vector,
const T &  Scalar 
)

Provides operation this += Vector * Scalar.

  • Returns reference to this.
template<typename T , tSize M>
CStaticVector< T, M > & CStaticVector::ones ( )

The vector initialization method.

  • Returns reference to this.
template<typename T, tSize M>
T& mds::math::CStaticVector< T, M >::operator() ( tSize  i)

Returns reference to the subscripted element [i].

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T, tSize M>
const T& mds::math::CStaticVector< T, M >::operator() ( tSize  i) const
template<typename T, tSize M>
template<typename U >
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::operator*= ( const CScalar< U > &  c)
template<typename T , tSize M>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator*= ( const CStaticVector< T, M > &  v)

Element wise product.

template<typename T , tSize M>
template<typename U >
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator*= ( const CScalar< U > &  c)

Multiplies all elements by scalar.

template<typename T, tSize M>
template<typename U >
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::operator+= ( const CScalar< U > &  c)
template<typename T , tSize M>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator+= ( const CStaticVector< T, M > &  v)

Element wise addition.

template<typename T , tSize M>
template<typename U >
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator+= ( const CScalar< U > &  c)

Adds scalar to all elements.

template<typename T, tSize M>
template<typename U >
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::operator-= ( const CScalar< U > &  c)
template<typename T , tSize M>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator-= ( const CStaticVector< T, M > &  v)

Element wise subtraction.

template<typename T , tSize M>
template<typename U >
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator-= ( const CScalar< U > &  c)

Subtracts scalar from all elements.

template<typename T, tSize M>
template<typename U >
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::operator/= ( const CScalar< U > &  c)
template<typename T , tSize M>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator/= ( const CStaticVector< T, M > &  v)

Element wise addition.

template<typename T , tSize M>
template<typename U >
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator/= ( const CScalar< U > &  c)

Divides all elements by scalar.

template<typename T, tSize M>
template<typename U >
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::operator= ( const CStaticVector< U, M > &  Vector)
template<typename T, tSize M>
template<typename Derived >
CStaticVector<T,M>& mds::math::CStaticVector< T, M >::operator= ( const Eigen::MatrixBase< Derived > &  Vector)
template<typename T , tSize M>
template<typename U >
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator= ( const CStaticVector< U, M > &  Vector)

Assignment operator.

template<typename T , tSize M>
template<typename Derived >
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator= ( const Eigen::MatrixBase< Derived > &  Vector)

Assignment operator.

template<typename T , tSize M>
CStaticVector< T, M > & mds::math::CStaticVector< T, M >::operator= ( const CStaticVector< T, M > &  Vector)

Specialization of the assignment operator.

tVector& mds::math::CVectorBase< CStaticVector< T, M > >::set ( tSize  i,
const tElement Value 
) [inherited]

Sets the vector element at the position [i].

template<typename T, tSize M>
CStaticVector& mds::math::CStaticVector< T, M >::set ( tSize  i,
const T &  Value 
)

Sets the vector element at the position [i].

template<typename T, tSize M>
tSize mds::math::CStaticVector< T, M >::size ( ) const

Returns the vector size.

Reimplemented from mds::math::CVectorBase< CStaticVector< T, M > >.

template<typename T , tSize M>
CStaticVector< T, M > & CStaticVector::zeros ( )

The vector initialization method.

  • Returns reference to this.

Member Data Documentation

template<typename T, tSize M>
tStorage mds::math::CStaticVector< T, M >::m_Vector [protected]

Underlying vector data (see the Eigen library).


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