MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class template providing basic dense vector operations. More...
#include <mdsVector.h>
Public Types | |
enum | { CLASS_OBJECT } |
Templates that require members of the CObject class can use this enum to check the existence. More... | |
enum | { CLASS_VECTOR } |
Templates that require members of the CVector class can use this enum to check the existence. More... | |
enum | { HEAP_OBJECT = 0x70616568 } |
Signature used to recognize objects on the heap. More... | |
typedef CVectorBase< CVector< T > > | tBase |
Base class. | |
typedef T | tElement |
Vector element type. | |
typedef Eigen::Matrix < tElement, Eigen::Dynamic, 1, Eigen::ColMajor|Eigen::AutoAlign > | tStorage |
Underlying data (see the Eigen math library). | |
typedef CVector< T > | tVector |
Vector type. | |
Public Member Functions | |
CVector & | abs () |
Absolute value of all elements. | |
tStorage & | asEigen () |
Returns reference to the underlying data (see the Eigen math library). | |
const tStorage & | asEigen () const |
T & | at (tSize i) |
Returns reference to the element [i]. | |
const T & | at (tSize i) const |
CVector & | concat (const CVector &Vector1, const CVector &Vector2) |
Concatenates two vectors. | |
template<typename T > | |
CVector< T > & | create (tSize Size) |
CVector & | create (tSize Size) |
Re-creates the vector of a given length. | |
template<typename T > | |
CVector< T > & | create (const CVector< T > &Vector, tSize First, tSize Size) |
CVector & | create (const CVector &Vector, tSize First, tSize Size) |
Creates a subvector of a given vector. | |
template<typename Derived > | |
CVector & | create (const CVectorBase< Derived > &Vector) |
Re-creates the vector. | |
template<typename Derived > | |
CVector & | create (const Eigen::MatrixBase< Derived > &Vector) |
Re-creates the vector. | |
template<typename Derived > | |
CVector< T > & | create (const CVectorBase< Derived > &Vector) |
template<typename Derived > | |
CVector< T > & | create (const Eigen::MatrixBase< Derived > &Vector) |
template<typename T > | |
CVector () | |
template<typename T > | |
CVector (tSize Size) | |
template<typename T > | |
CVector (const CVector< T > &Vector, tSize First, tSize Size) | |
template<typename T > | |
CVector (const CVector< T > &Vector) | |
CVector () | |
Declare iterator types tIterator and tConstIterator. | |
template<typename Derived > | |
CVector (const Eigen::MatrixBase< Derived > &Vector) | |
CVector (tSize Size) | |
Constructor. | |
CVector (const CVector &Vector, tSize First, tSize Size) | |
Constructor. | |
CVector (const CVector &Vector) | |
Copy constructor. | |
template<typename Derived > | |
CVector (const Eigen::MatrixBase< Derived > &Vector) | |
Conversion constructor. | |
CVector & | fill (const T &Value) |
Sets vector elements 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. | |
tVector & | getImpl () |
Returns reference to the vector implementation. | |
const tVector & | getImpl () 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 |
int | getReferencesCount () const |
Returns the number of references. | |
tSize | getSize () const |
Returns the vector size. | |
tSize | getStride () const |
Returns stride between two neigbouring vector elements. | |
bool | isOnHeap () const |
Returns true if the object is allocated on the heap. | |
CVector & | limit (const T &Lower, const T &Upper) |
Limit range of elements. | |
MDS_SHAREDPTR (CVector) | |
Smart pointer type. | |
CVector & | mult (const CMatrix< T > &Matrix, const CVector &Vector) |
Matrix vs. | |
CVector & | mult (const CVector &Vector, const CMatrix< T > &Matrix) |
Row vector vs. | |
CVector & | multAdd (const CVector &Vector, const T &Scalar) |
Provides operation this += Vector * Scalar. | |
CVector & | ones () |
The vector initialization method. | |
T & | operator() (tSize i) |
Returns reference to the subscripted element [i]. | |
const T & | operator() (tSize i) const |
template<typename T > | |
CVector< T > & | operator*= (const CVector< T > &Vector) |
CVector & | operator*= (const CVector &Vector) |
Element wise product. | |
template<typename U > | |
CVector & | operator*= (const CScalar< U > &c) |
Multiplies all elements by scalar. | |
template<typename U > | |
CVector< T > & | operator*= (const CScalar< U > &c) |
template<typename T > | |
CVector< T > & | operator+= (const CVector< T > &Vector) |
CVector & | operator+= (const CVector &Vector) |
Element wise addition. | |
template<typename U > | |
CVector & | operator+= (const CScalar< U > &c) |
Adds scalar to all elements. | |
template<typename U > | |
CVector< T > & | operator+= (const CScalar< U > &c) |
template<typename T > | |
CVector< T > & | operator-= (const CVector< T > &Vector) |
CVector & | operator-= (const CVector &Vector) |
Element wise subtraction. | |
template<typename U > | |
CVector & | operator-= (const CScalar< U > &c) |
Subtracts scalar from all elements. | |
template<typename U > | |
CVector< T > & | operator-= (const CScalar< U > &c) |
CVector & | operator/= (const CVector &Vector) |
Element wise addition. | |
template<typename T > | |
CVector< T > & | operator/= (const CVector< T > &Vector) |
template<typename U > | |
CVector & | operator/= (const CScalar< U > &c) |
Divides all elements by scalar. | |
template<typename U > | |
CVector< T > & | operator/= (const CScalar< U > &c) |
CVector & | operator= (const CVector &Vector) |
Assignment operator. | |
template<typename Derived > | |
CVector & | operator= (const Eigen::MatrixBase< Derived > &Vector) |
Assignment operator. | |
template<typename T > | |
CVector< T > & | operator= (const CVector< T > &Vector) |
template<typename Derived > | |
CVector< T > & | operator= (const Eigen::MatrixBase< Derived > &Vector) |
tVector & | set (tSize i, const tElement &Value) |
Sets the vector element at the position [i]. | |
CVector & | set (tSize i, const T &Value) |
Sets the vector element at the position [i]. | |
tSize | size () const |
Returns the vector size. | |
CVector & | subSample (const CVector &Vector, tSize k=2) |
Initializes this subsampling a given vector. | |
CVector & | zeros () |
The vector initialization method. | |
~CVector () | |
Destructor. | |
Static Public Member Functions | |
static void * | operator new (std::size_t Size) |
Allocates a new object on the heap. | |
Protected Member Functions | |
void | addReference () const |
Increase the reference counter. | |
bool | delReference () const |
Decrease the reference counter. | |
Protected Attributes | |
int | m_iHeapObject |
Flag initialized if the object is on the heap. | |
int | m_iReferences |
The number of references to the object. | |
tStorage | m_Vector |
Vector data. |
Class template providing basic dense vector operations.
typedef CVectorBase<CVector<T> > mds::math::CVector< T >::tBase |
Base class.
typedef T mds::math::CVector< T >::tElement |
Vector element type.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
typedef Eigen::Matrix<tElement, Eigen::Dynamic, 1, Eigen::ColMajor | Eigen::AutoAlign> mds::math::CVector< T >::tStorage |
Underlying data (see the Eigen math library).
typedef CVector< T > mds::math::CVectorBase< CVector< T > >::tVector [inherited] |
Vector type.
anonymous enum [inherited] |
Templates that require members of the CObject class can use this enum to check the existence.
anonymous enum |
Templates that require members of the CVector class can use this enum to check the existence.
mds::math::CVector< T >::CVector | ( | ) |
Declare iterator types tIterator and tConstIterator.
Default constructor.
mds::math::CVector< T >::CVector | ( | tSize | Size | ) | [explicit] |
Constructor.
mds::math::CVector< T >::CVector | ( | const CVector< T > & | Vector, |
tSize | First, | ||
tSize | Size | ||
) |
Constructor.
mds::math::CVector< T >::CVector | ( | const CVector< T > & | Vector | ) |
Copy constructor.
mds::math::CVector< T >::CVector | ( | const Eigen::MatrixBase< Derived > & | Vector | ) |
Conversion constructor.
CVector::~CVector | ( | ) |
Destructor.
mds::math::CVector< T >::CVector | ( | const CVector< T > & | Vector, |
tSize | First, | ||
tSize | Size | ||
) |
mds::math::CVector< T >::CVector | ( | const CVector< T > & | Vector | ) |
mds::math::CVector< T >::CVector | ( | const Eigen::MatrixBase< Derived > & | Vector | ) |
CVector< T > & CVector::abs | ( | ) |
Absolute value of all elements.
void mds::base::CObject::addReference | ( | ) | const [protected, inherited] |
Increase the reference counter.
tStorage& mds::math::CVector< T >::asEigen | ( | ) |
Returns reference to the underlying data (see the Eigen math library).
const tStorage& mds::math::CVector< T >::asEigen | ( | ) | const |
T& mds::math::CVector< T >::at | ( | tSize | i | ) |
Returns reference to the element [i].
Reimplemented from mds::math::CVectorBase< CVector< T > >.
const T& mds::math::CVector< T >::at | ( | tSize | i | ) | const |
Reimplemented from mds::math::CVectorBase< CVector< T > >.
CVector< T > & CVector::concat | ( | const CVector< T > & | Vector1, |
const CVector< T > & | Vector2 | ||
) |
Concatenates two vectors.
CVector<T>& mds::math::CVector< T >::create | ( | tSize | Size | ) |
CVector< T > & mds::math::CVector< T >::create | ( | tSize | Size | ) |
Re-creates the vector of a given length.
CVector<T>& mds::math::CVector< T >::create | ( | const CVector< T > & | Vector, |
tSize | First, | ||
tSize | Size | ||
) |
CVector< T > & mds::math::CVector< T >::create | ( | const CVector< T > & | Vector, |
tSize | First, | ||
tSize | Size | ||
) |
Creates a subvector of a given vector.
CVector< T > & mds::math::CVector< T >::create | ( | const CVectorBase< Derived > & | Vector | ) |
Re-creates the vector.
CVector< T > & mds::math::CVector< T >::create | ( | const Eigen::MatrixBase< Derived > & | Vector | ) |
Re-creates the vector.
CVector<T>& mds::math::CVector< T >::create | ( | const CVectorBase< Derived > & | Vector | ) |
CVector<T>& mds::math::CVector< T >::create | ( | const Eigen::MatrixBase< Derived > & | Vector | ) |
bool mds::base::CObject::delReference | ( | ) | const [protected, inherited] |
Decrease the reference counter.
CVector< T > & CVector::fill | ( | const T & | Value | ) |
Sets vector elements to a given value.
Function mds::math::CVector< T >::forEach | ( | Function | Func | ) |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
Function mds::math::CVector< T >::forEach | ( | Function | Func | ) | const |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
Function mds::math::CVector< T >::forEach | ( | Function | Func | ) |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
Function mds::math::CVector< T >::forEach | ( | Function | Func | ) | const |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
tVector& mds::math::CVectorBase< CVector< T > >::getImpl | ( | ) | [inherited] |
Returns reference to the vector implementation.
const tVector& mds::math::CVectorBase< CVector< T > >::getImpl | ( | ) | const [inherited] |
T* mds::math::CVector< T >::getPtr | ( | ) |
Returns pointer to the vector data.
const T* mds::math::CVector< T >::getPtr | ( | ) | const |
T* mds::math::CVector< T >::getPtr | ( | tSize | i | ) |
Returns pointer to a given element.
const T* mds::math::CVector< T >::getPtr | ( | tSize | i | ) | const |
int mds::base::CObject::getReferencesCount | ( | ) | const [inherited] |
Returns the number of references.
tSize mds::math::CVector< T >::getSize | ( | ) | const |
Returns the vector size.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
tSize mds::math::CVector< T >::getStride | ( | ) | const |
Returns stride between two neigbouring vector elements.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
bool mds::base::CObject::isOnHeap | ( | ) | const [inherited] |
Returns true if the object is allocated on the heap.
CVector< T > & CVector::limit | ( | const T & | Lower, |
const T & | Upper | ||
) |
Limit range of elements.
mds::math::CVector< T >::MDS_SHAREDPTR | ( | CVector< T > | ) |
Smart pointer type.
CVector< T > & mds::math::CVector< T >::mult | ( | const CMatrix< T > & | Matrix, |
const CVector< T > & | Vector | ||
) |
Matrix vs.
column vector multiplication.
CVector< T > & mds::math::CVector< T >::mult | ( | const CVector< T > & | Vector, |
const CMatrix< T > & | Matrix | ||
) |
Row vector vs.
matrix multiplication.
CVector< T > & CVector::multAdd | ( | const CVector< T > & | Vector, |
const T & | Scalar | ||
) |
Provides operation this += Vector * Scalar.
CVector< T > & CVector::ones | ( | ) |
The vector initialization method.
static void* mds::base::CObject::operator new | ( | std::size_t | Size | ) | [static, inherited] |
Allocates a new object on the heap.
T& mds::math::CVector< T >::operator() | ( | tSize | i | ) |
Returns reference to the subscripted element [i].
Reimplemented from mds::math::CVectorBase< CVector< T > >.
const T& mds::math::CVector< T >::operator() | ( | tSize | i | ) | const |
Reimplemented from mds::math::CVectorBase< CVector< T > >.
CVector<T>& mds::math::CVector< T >::operator*= | ( | const CVector< T > & | Vector | ) |
CVector< T > & mds::math::CVector< T >::operator*= | ( | const CVector< T > & | Vector | ) |
Element wise product.
CVector< T > & mds::math::CVector< T >::operator*= | ( | const CScalar< U > & | c | ) |
Multiplies all elements by scalar.
CVector<T>& mds::math::CVector< T >::operator*= | ( | const CScalar< U > & | c | ) |
CVector<T>& mds::math::CVector< T >::operator+= | ( | const CVector< T > & | Vector | ) |
CVector< T > & mds::math::CVector< T >::operator+= | ( | const CVector< T > & | Vector | ) |
Element wise addition.
CVector< T > & mds::math::CVector< T >::operator+= | ( | const CScalar< U > & | c | ) |
Adds scalar to all elements.
CVector<T>& mds::math::CVector< T >::operator+= | ( | const CScalar< U > & | c | ) |
CVector<T>& mds::math::CVector< T >::operator-= | ( | const CVector< T > & | Vector | ) |
CVector< T > & mds::math::CVector< T >::operator-= | ( | const CVector< T > & | Vector | ) |
Element wise subtraction.
CVector< T > & mds::math::CVector< T >::operator-= | ( | const CScalar< U > & | c | ) |
Subtracts scalar from all elements.
CVector<T>& mds::math::CVector< T >::operator-= | ( | const CScalar< U > & | c | ) |
CVector< T > & mds::math::CVector< T >::operator/= | ( | const CVector< T > & | Vector | ) |
Element wise addition.
CVector<T>& mds::math::CVector< T >::operator/= | ( | const CVector< T > & | Vector | ) |
CVector< T > & mds::math::CVector< T >::operator/= | ( | const CScalar< U > & | c | ) |
Divides all elements by scalar.
CVector<T>& mds::math::CVector< T >::operator/= | ( | const CScalar< U > & | c | ) |
CVector< T > & mds::math::CVector< T >::operator= | ( | const CVector< T > & | Vector | ) |
Assignment operator.
CVector< T > & mds::math::CVector< T >::operator= | ( | const Eigen::MatrixBase< Derived > & | Vector | ) |
Assignment operator.
CVector<T>& mds::math::CVector< T >::operator= | ( | const CVector< T > & | Vector | ) |
CVector<T>& mds::math::CVector< T >::operator= | ( | const Eigen::MatrixBase< Derived > & | Vector | ) |
tVector& mds::math::CVectorBase< CVector< T > >::set | ( | tSize | i, |
const tElement & | Value | ||
) | [inherited] |
Sets the vector element at the position [i].
CVector& mds::math::CVector< T >::set | ( | tSize | i, |
const T & | Value | ||
) |
Sets the vector element at the position [i].
tSize mds::math::CVector< T >::size | ( | ) | const |
Returns the vector size.
Reimplemented from mds::math::CVectorBase< CVector< T > >.
CVector< T > & CVector::subSample | ( | const CVector< T > & | Vector, |
tSize | k = 2 |
||
) |
Initializes this subsampling a given vector.
CVector< T > & CVector::zeros | ( | ) |
The vector initialization method.
int mds::base::CObject::m_iHeapObject [mutable, protected, inherited] |
Flag initialized if the object is on the heap.
int mds::base::CObject::m_iReferences [mutable, protected, inherited] |
The number of references to the object.
tStorage mds::math::CVector< T >::m_Vector [protected] |
Vector data.