![]() |
MDSTk Libraries
1.1.0
Medical Data Segmentation Toolkit
|
Class template providing basic vector operations. More...
#include <mdsArray.h>

Public Types | |
| enum | { CLASS_VECTOR } |
| Templates that require members of the CArray class can use this enum to check the existence. More... | |
| enum | { CLASS_OBJECT } |
| Templates that require members of the CObject class can use this enum to check the existence. More... | |
| enum | { HEAP_OBJECT = 0x70616568 } |
| Signature used to recognize objects on the heap. More... | |
| typedef mds::math::CVectorBase < CArray< T > > | tBase |
| Base class. | |
| typedef mds::base::CRefData< T > | tDataStorage |
| Array data. | |
| typedef T | tElement |
| Array element type. | |
| typedef CArray< T > | tVector |
| Vector type. | |
Public Member Functions | |
| CArray & | abs () |
| Absolute value of all elements. | |
| T & | at (tSize i) |
| Returns reference to the element [i]. | |
| const T & | at (tSize i) const |
| CArray () | |
| Declare iterator types tIterator and tConstIterator. | |
| CArray (tSize Size) | |
| Constructor. | |
| CArray (const CArray &Vector, tSize First, tSize Size) | |
| Constructor. | |
| CArray (const CArray &Vector, tSize First, tSize Size, EMakeRef) | |
| Constructor. | |
| CArray (const CArray &Vector) | |
| Copy constructor. | |
| CArray (const CArray &Vector, EMakeRef) | |
| Copy constructor. | |
| CArray & | concat (const CArray &Vector1, const CArray &Vector2) |
| Concatenates two vectors. | |
| template<typename Derived > | |
| CArray & | convert (const mds::math::CVectorBase< Derived > &Vector) |
| Conversion between vectors of different type. | |
| template<typename Derived > | |
| CArray< T > & | convert (const mds::math::CVectorBase< Derived > &Vector) |
| CArray & | create (tSize Size) |
| Resizes the vector. | |
| CArray & | create (const CArray &Vector, tSize First, tSize Size) |
| Re-creates the vector. | |
| CArray & | create (const CArray &Vector, tSize First, tSize Size, EMakeRef) |
| Re-creates the vector as a reference to specified data. | |
| CArray & | create (const CArray &Vector) |
| Re-creates the vector. | |
| CArray & | create (const CArray &Vector, EMakeRef) |
| Re-creates the vector. | |
| CArray & | 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 the subscripted 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. | |
| CArray & | limit (const T &Lower, const T &Upper) |
| Limit range of elements. | |
| MDS_SHAREDPTR (CArray) | |
| Smart pointer type. | |
| CArray & | mult (const mds::math::CMatrix< T > &Matrix, const CArray &Vector) |
| Matrix vs. | |
| CArray & | mult (const CArray &Vector, const mds::math::CMatrix< T > &Matrix) |
| Row vector vs. | |
| CArray & | multAdd (const CArray &Vector, const T &Scalar) |
| Provides operation this += Vector * Scalar. | |
| CArray & | ones () |
| The vector initialization method. | |
| T & | operator() (tSize i) |
| Returns reference to the subscripted element [i]. | |
| const T & | operator() (tSize i) const |
| template<class Derived > | |
| CArray & | operator*= (const mds::math::CVectorBase< Derived > &Vector) |
| Element wise product. | |
| template<typename U > | |
| CArray & | operator*= (const CScalar< U > &c) |
| Multiplies all elements by scalar. | |
| template<class Derived > | |
| CArray< T > & | operator*= (const mds::math::CVectorBase< Derived > &Vector) |
| template<typename U > | |
| CArray< T > & | operator*= (const CScalar< U > &c) |
| template<class Derived > | |
| CArray & | operator+= (const mds::math::CVectorBase< Derived > &Vector) |
| Element wise addition. | |
| template<typename U > | |
| CArray & | operator+= (const CScalar< U > &c) |
| Adds scalar to all elements. | |
| template<class Derived > | |
| CArray< T > & | operator+= (const mds::math::CVectorBase< Derived > &Vector) |
| template<typename U > | |
| CArray< T > & | operator+= (const CScalar< U > &c) |
| template<class Derived > | |
| CArray & | operator-= (const mds::math::CVectorBase< Derived > &Vector) |
| Element wise subtraction. | |
| template<typename U > | |
| CArray & | operator-= (const CScalar< U > &c) |
| Subtracts scalar from all elements. | |
| template<class Derived > | |
| CArray< T > & | operator-= (const mds::math::CVectorBase< Derived > &Vector) |
| template<typename U > | |
| CArray< T > & | operator-= (const CScalar< U > &c) |
| template<class Derived > | |
| CArray & | operator/= (const mds::math::CVectorBase< Derived > &Vector) |
| Element wise addition. | |
| template<typename U > | |
| CArray & | operator/= (const CScalar< U > &c) |
| Divides all elements by scalar. | |
| template<class Derived > | |
| CArray< T > & | operator/= (const mds::math::CVectorBase< Derived > &Vector) |
| template<typename U > | |
| CArray< T > & | operator/= (const CScalar< U > &c) |
| CArray & | operator= (const CArray &Vector) |
| Assignment operator. | |
| template<class Function > | |
| Function | pforEach (Function Func) |
| Calls a function object for every vector element. | |
| template<class Function > | |
| Function | pforEach (Function Func) const |
| Calls a function object for every vector element. | |
| template<class Function > | |
| Function | pforEach (Function Func) |
| template<class Function > | |
| Function | pforEach (Function Func) const |
| tVector & | set (tSize i, const tElement &Value) |
| Sets the vector element at the position [i]. | |
| CArray & | set (tSize i, const T &Value) |
| Sets the vector element at the position [i]. | |
| tSize | size () const |
| Returns the vector size. | |
| CArray & | subSample (const CArray &Vector, tSize k=2) |
| Initializes this subsampling a given vector. | |
| CArray & | zeros () |
| The vector initialization method. | |
| ~CArray () | |
| 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 | |
| tDataStorage | m_DataStorage |
| Vector data. | |
| int | m_iHeapObject |
| Flag initialized if the object is on the heap. | |
| int | m_iReferences |
| The number of references to the object. | |
| T * | m_pData |
| Direct pointer to the data. | |
| tSize | m_Size |
| Vector dimension. | |
| tSize | m_Stride |
| Stride between two neighbouring vector values. | |
Class template providing basic vector operations.
| typedef mds::math::CVectorBase<CArray<T> > mds::img::CArray< T >::tBase |
Base class.
| typedef mds::base::CRefData<T> mds::img::CArray< T >::tDataStorage |
Array data.
| typedef T mds::img::CArray< T >::tElement |
Array element type.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
typedef CArray< T > mds::math::CVectorBase< CArray< T > >::tVector [inherited] |
Vector type.
| anonymous enum |
Templates that require members of the CArray class can use this enum to check the existence.
anonymous enum [inherited] |
Templates that require members of the CObject class can use this enum to check the existence.
| CArray::CArray | ( | ) |
Declare iterator types tIterator and tConstIterator.
Default constructor.
| CArray::CArray | ( | tSize | Size | ) | [explicit] |
Constructor.
| mds::img::CArray< T >::CArray | ( | const CArray< T > & | Vector, |
| tSize | First, | ||
| tSize | Size | ||
| ) |
Constructor.
| mds::img::CArray< T >::CArray | ( | const CArray< T > & | Vector, |
| tSize | First, | ||
| tSize | Size, | ||
| EMakeRef | |||
| ) |
Constructor.
| mds::img::CArray< T >::CArray | ( | const CArray< T > & | Vector | ) |
Copy constructor.
| mds::img::CArray< T >::CArray | ( | const CArray< T > & | Vector, |
| EMakeRef | |||
| ) |
Copy constructor.
| CArray::~CArray | ( | ) |
Destructor.
| CArray< T > & CArray::abs | ( | ) |
Absolute value of all elements.
| void mds::base::CObject::addReference | ( | ) | const [protected, inherited] |
Increase the reference counter.
| T& mds::img::CArray< T >::at | ( | tSize | i | ) |
Returns reference to the element [i].
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| const T& mds::img::CArray< T >::at | ( | tSize | i | ) | const |
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| CArray< T > & CArray::concat | ( | const CArray< T > & | Vector1, |
| const CArray< T > & | Vector2 | ||
| ) |
Concatenates two vectors.
| CArray< T > & mds::img::CArray< T >::convert | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
Conversion between vectors of different type.
| CArray<T>& mds::img::CArray< T >::convert | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
| CArray< T > & CArray::create | ( | tSize | Size | ) |
Resizes the vector.
| CArray< T > & mds::img::CArray< T >::create | ( | const CArray< T > & | Vector, |
| tSize | First, | ||
| tSize | Size | ||
| ) |
Re-creates the vector.
| CArray< T > & mds::img::CArray< T >::create | ( | const CArray< T > & | Vector, |
| tSize | First, | ||
| tSize | Size, | ||
| EMakeRef | |||
| ) |
Re-creates the vector as a reference to specified data.
| CArray< T > & mds::img::CArray< T >::create | ( | const CArray< T > & | Vector | ) |
Re-creates the vector.
| CArray< T > & mds::img::CArray< T >::create | ( | const CArray< T > & | Vector, |
| EMakeRef | |||
| ) |
Re-creates the vector.
| bool mds::base::CObject::delReference | ( | ) | const [protected, inherited] |
Decrease the reference counter.
| CArray< T > & CArray::fill | ( | const T & | Value | ) |
Sets vector elements to a given value.
| Function mds::img::CArray< T >::forEach | ( | Function | Func | ) |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| Function mds::img::CArray< T >::forEach | ( | Function | Func | ) | const |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| Function mds::img::CArray< T >::forEach | ( | Function | Func | ) |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| Function mds::img::CArray< T >::forEach | ( | Function | Func | ) | const |
Calls a function object for every vector element.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| tVector& mds::math::CVectorBase< CArray< T > >::getImpl | ( | ) | [inherited] |
Returns reference to the vector implementation.
| const tVector& mds::math::CVectorBase< CArray< T > >::getImpl | ( | ) | const [inherited] |
| T* mds::img::CArray< T >::getPtr | ( | ) |
Returns pointer to the vector data.
| const T* mds::img::CArray< T >::getPtr | ( | ) | const |
| T* mds::img::CArray< T >::getPtr | ( | tSize | i | ) |
Returns pointer to the subscripted element.
| const T* mds::img::CArray< T >::getPtr | ( | tSize | i | ) | const |
| int mds::base::CObject::getReferencesCount | ( | ) | const [inherited] |
Returns the number of references.
| tSize mds::img::CArray< T >::getSize | ( | ) | const |
Returns the vector size.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| tSize mds::img::CArray< T >::getStride | ( | ) | const |
Returns stride between two neigbouring vector elements.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| bool mds::base::CObject::isOnHeap | ( | ) | const [inherited] |
Returns true if the object is allocated on the heap.
| CArray< T > & CArray::limit | ( | const T & | Lower, |
| const T & | Upper | ||
| ) |
Limit range of elements.
| mds::img::CArray< T >::MDS_SHAREDPTR | ( | CArray< T > | ) |
Smart pointer type.
| CArray< T > & mds::img::CArray< T >::mult | ( | const mds::math::CMatrix< T > & | Matrix, |
| const CArray< T > & | Vector | ||
| ) |
Matrix vs.
column vector multiplication.
| CArray< T > & mds::img::CArray< T >::mult | ( | const CArray< T > & | Vector, |
| const mds::math::CMatrix< T > & | Matrix | ||
| ) |
Row vector vs.
matrix multiplication.
| CArray& mds::img::CArray< T >::multAdd | ( | const CArray< T > & | Vector, |
| const T & | Scalar | ||
| ) |
Provides operation this += Vector * Scalar.
| CArray< T > & CArray::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::img::CArray< T >::operator() | ( | tSize | i | ) |
Returns reference to the subscripted element [i].
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| const T& mds::img::CArray< T >::operator() | ( | tSize | i | ) | const |
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| CArray< T > & mds::img::CArray< T >::operator*= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
Element wise product.
| CArray< T > & mds::img::CArray< T >::operator*= | ( | const CScalar< U > & | c | ) |
Multiplies all elements by scalar.
| CArray<T>& mds::img::CArray< T >::operator*= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
| CArray<T>& mds::img::CArray< T >::operator*= | ( | const CScalar< U > & | c | ) |
| CArray< T > & mds::img::CArray< T >::operator+= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
Element wise addition.
| CArray< T > & mds::img::CArray< T >::operator+= | ( | const CScalar< U > & | c | ) |
Adds scalar to all elements.
| CArray<T>& mds::img::CArray< T >::operator+= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
| CArray<T>& mds::img::CArray< T >::operator+= | ( | const CScalar< U > & | c | ) |
| CArray< T > & mds::img::CArray< T >::operator-= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
Element wise subtraction.
| CArray< T > & mds::img::CArray< T >::operator-= | ( | const CScalar< U > & | c | ) |
Subtracts scalar from all elements.
| CArray<T>& mds::img::CArray< T >::operator-= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
| CArray<T>& mds::img::CArray< T >::operator-= | ( | const CScalar< U > & | c | ) |
| CArray< T > & mds::img::CArray< T >::operator/= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
Element wise addition.
| CArray< T > & mds::img::CArray< T >::operator/= | ( | const CScalar< U > & | c | ) |
Divides all elements by scalar.
| CArray<T>& mds::img::CArray< T >::operator/= | ( | const mds::math::CVectorBase< Derived > & | Vector | ) |
| CArray<T>& mds::img::CArray< T >::operator/= | ( | const CScalar< U > & | c | ) |
Assignment operator.
| Function mds::img::CArray< T >::pforEach | ( | Function | Func | ) |
Calls a function object for every vector element.
| Function mds::img::CArray< T >::pforEach | ( | Function | Func | ) | const |
Calls a function object for every vector element.
| Function mds::img::CArray< T >::pforEach | ( | Function | Func | ) |
| Function mds::img::CArray< T >::pforEach | ( | Function | Func | ) | const |
Sets the vector element at the position [i].
| CArray& mds::img::CArray< T >::set | ( | tSize | i, |
| const T & | Value | ||
| ) |
Sets the vector element at the position [i].
| tSize mds::img::CArray< T >::size | ( | ) | const |
Returns the vector size.
Reimplemented from mds::math::CVectorBase< CArray< T > >.
| CArray< T > & CArray::subSample | ( | const CArray< T > & | Vector, |
| tSize | k = 2 |
||
| ) |
Initializes this subsampling a given vector.
| CArray< T > & CArray::zeros | ( | ) |
The vector initialization method.
tDataStorage mds::img::CArray< T >::m_DataStorage [protected] |
Vector data.
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.
T* mds::img::CArray< T >::m_pData [protected] |
Direct pointer to the data.
tSize mds::img::CArray< T >::m_Size [protected] |
Vector dimension.
tSize mds::img::CArray< T >::m_Stride [protected] |
Stride between two neighbouring vector values.
1.7.6.1