DMRITool  v0.1.1-139-g860d86b4
Diffusion MRI Tool
Public Types | Public Member Functions | List of all members
utl::NDArray< T, Dim > Class Template Reference

#include <utlFunctors.h>

+ Inheritance diagram for utl::NDArray< T, Dim >:
+ Collaboration diagram for utl::NDArray< T, Dim >:

Detailed Description

template<class T, unsigned int Dim>
class utl::NDArray< T, Dim >

NDArray is a N-Dimensional array class (row-major, c version)

It uses blas, mkl, and expression templates.

Author
Jian Cheng (JC), jian..nosp@m.chen.nosp@m.g.198.nosp@m.3@gm.nosp@m.ail.c.nosp@m.om

Definition at line 131 of file utlFunctors.h.

Public Types

typedef Superclass::ConstIterator ConstIterator
 
typedef Superclass::ConstPointer ConstPointer
 
typedef Superclass::ConstReference ConstReference
 
typedef Superclass::Iterator Iterator
 
typedef Superclass::Pointer Pointer
 
typedef Superclass::Reference Reference
 
typedef Superclass::ScalarValueType ScalarValueType
 
typedef NDArray Self
 
typedef Superclass::ShapeType ShapeType
 
typedef Superclass::SizeType SizeType
 
typedef NDArrayBase< T, Dim > Superclass
 
typedef Superclass::ValueType ValueType
 
- Public Types inherited from utl::NDArrayBase< T, Dim >
enum  { Dimension = Dim }
 
typedef const ValueTypeConstIterator
 
typedef const ValueTypeConstPointer
 
typedef const ValueTypeConstReference
 
typedef ValueTypeIterator
 
typedef ValueTypePointer
 
typedef ValueTypeReference
 
typedef utl::remove_complex_t< T > ScalarValueType
 
typedef NDArrayBase Self
 
typedef Superclass::ShapeType ShapeType
 
typedef Superclass::SizeType SizeType
 
typedef Expr< NDArrayBase< T, Dim >, T > Superclass
 
typedef T ValueType
 
- Public Types inherited from utl::Expr< NDArrayBase< T, Dim >, T >
typedef SizeType const * ShapeType
 
typedef unsigned int SizeType
 
typedef T ValueType
 

Public Member Functions

 NDArray ()
 
 NDArray (const ShapeType &shape)
 
 NDArray (const NDArray< T, Dim > &vec)
 
 NDArray (NDArray< T, Dim > &&vec)
 
template<typename EType >
 NDArray (const Expr< EType, typename EType::ValueType > &expr)
 
 NDArray (const T *vec, const ShapeType &shape)
 
 NDArray (const ShapeType &shape, const T r)
 
template<typename TValue >
 NDArray (const NDArray< TValue, Dim > &r)
 
NDArray< T, Dim > & operator= (const NDArray< T, Dim > &r)
 
NDArray< T, Dim > & operator= (NDArray< T, Dim > &&r)
 
- Public Member Functions inherited from utl::NDArrayBase< T, Dim >
 __Array_Saver_Scalar (+=) __Array_Saver_Scalar(-
 
AbsoluteMaxValue () const
 
AbsoluteMinValue () const
 
template<typename FuncT >
void Apply (const FuncT &func, NDArrayBase< T, Dim > &vec) const
 
void Apply (T(*f)(T), NDArrayBase< T, Dim > &vec) const
 
void Apply (T(*f)(T const &), NDArrayBase< T, Dim > &vec) const
 
unsigned ArgAbsoluteMax () const
 
unsigned ArgAbsoluteMin () const
 
unsigned ArgMax () const
 
unsigned ArgMin () const
 
Reference Back ()
 
ConstReference Back () const
 
Iterator Begin ()
 
ConstIterator Begin () const
 
ConstIterator cBegin () const
 
ConstIterator cEnd () const
 
void Clear ()
 
void CopyData (T *const data, const ShapeType &shape)
 
NDArrayBase< T, Dim > & CopyIn (T const *ptr, const int size, const int start=0)
 
void CopyOut (T *ptr, const int size, const int start=0) const
 
ConstReverseIterator crBegin () const
 
ConstReverseIterator crEnd () const
 
NDArrayBase< T, Dim > & ElementAbsolute (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementAbsolute (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementAdd (T *const vec, T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementAxpby (T *const vec, const T alpha, const T beta)
 
NDArrayBase< T, Dim > & ElementCos (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementCos (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementDivide (T *const vec, T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementExp (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementExp (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementInverse (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementInverse (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementMultiply (T *const vec, T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementSin (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementSin (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementSqrt (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementSqrt (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementSquare (T *outVec=NULL)
 
NDArrayBase< T, Dim > & ElementSquare (NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & ElementSubstract (T *const vec, T *outVec=NULL)
 
Iterator End ()
 
ConstIterator End () const
 
Eval (int i) const
 
void Fill (const T &value)
 
NDArrayBase< T, Dim > & Flip ()
 
T * GetData ()
 
const T * GetData () const
 
ConstReference GetElement (unsigned short index) const
 
NDArrayBase< T, Dim > GetElementAbsolute () const
 
NDArrayBase< T, Dim > GetElementCos () const
 
NDArrayBase< T, Dim > GetElementExp () const
 
NDArrayBase< T, Dim > GetElementInverse () const
 
NDArrayBase< T, Dim > GetElementSin () const
 
NDArrayBase< T, Dim > GetElementSqrt () const
 
NDArrayBase< T, Dim > GetElementSquare () const
 
void GetIndex (const SizeType offset, SizeType index[Dimension]) const
 
double GetInfNorm () const
 
bool GetIsShared () const
 
GetMean () const
 
GetMedian () const
 
SizeType GetOffset (const ShapeType &shapeIndex) const
 
const SizeTypeGetOffSetTable () const
 
double GetOneNorm () const
 
NDArray< T, SubDimensionGetRefSubArray (const int i) const
 
NDArray< T, Dim > GetRefSubArray (const int istart, const int iend) const
 
double GetRootMeanSquares () const
 
const ShapeType GetShape () const
 
SizeType GetSize () const
 
double GetSquaredTwoNorm () const
 
GetSum () const
 
double GetTwoNorm () const
 
int GetZeroNorm (const double eps=1e-10) const
 
void HardThreshold (const double threshold)
 
ValueType InnerProduct (const NDArrayBase< T, Dim > &vec) const
 
bool IsEmpty () const
 
bool IsEqual (const NDArrayBase< T, Dim > &r, const double eps) const
 
template<typename EType >
bool IsSameShape (const EType &src) const
 
bool IsSameShape (const ShapeType &shape) const
 
bool IsSameSize (const ShapeType &shape) const
 
bool IsSameValues (const NDArrayBase< T, Dim > &r, const double eps) const
 
bool IsZero () const
 
MaxValue () const
 
MinValue () const
 
 NDArrayBase ()
 
 NDArrayBase (const ShapeType &shape)
 
 NDArrayBase (const NDArrayBase< T, Dim > &vec)
 
 NDArrayBase (NDArrayBase< T, Dim > &&vec)
 
template<typename EType >
 NDArrayBase (const Expr< EType, typename EType::ValueType > &expr)
 
 NDArrayBase (const T *vec, const ShapeType &shape)
 
 NDArrayBase (const ShapeType &shape, const T r)
 
template<typename TValue >
 NDArrayBase (const NDArrayBase< TValue, Dim > &r)
 
int NNZ (const double eps=1e-10) const
 
NDArrayBase< T, Dim > & operator saver (const T val)
 
bool operator!= (const NDArrayBase< T, Dim > &r) const
 
template<typename EType >
NDArrayBase< T, Dim > & operator%= (const Expr< EType, typename EType::ValueType > &src)
 
NDArrayBase< T, Dim > & operator%= (const NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & operator%= (const T val)
 
Reference operator() (const ShapeType &shape)
 
ConstReference operator() (const ShapeType &shape) const
 
template<typename EType >
NDArrayBase< T, Dim > & operator+= (const Expr< EType, typename EType::ValueType > &src)
 
NDArrayBase< T, Dim > & operator+= (const NDArrayBase< T, Dim > &vec)
 
template<typename EType >
NDArrayBase< T, Dim > & operator-= (const Expr< EType, typename EType::ValueType > &src)
 
NDArrayBase< T, Dim > & operator-= (const NDArrayBase< T, Dim > &vec)
 
template<typename EType >
NDArrayBase< T, Dim > & operator/= (const Expr< EType, typename EType::ValueType > &src)
 
NDArrayBase< T, Dim > & operator/= (const NDArrayBase< T, Dim > &vec)
 
NDArrayBase< T, Dim > & operator/= (const T val)
 
template<typename EType >
NDArrayBase< T, Dim > & operator= (const Expr< EType, typename EType::ValueType > &src)
 
Dim & operator= (const NDArrayBase< T, Dim > &r)
 
NDArrayBase< T, Dim > & operator= (NDArrayBase< T, Dim > &&r)
 
template<typename TValueType >
NDArrayBase< T, Dim > & operator= (const NDArrayBase< TValueType, Dim > &r)
 
NDArrayBase< T, Dim > & operator= (const std::initializer_list< T > &r)
 
NDArrayBase< T, Dim > & operator= (const std::vector< T > &r)
 
NDArrayBase< T, Dim > & operator= (const T r)
 
bool operator== (const NDArrayBase< T, Dim > &r) const
 
Reference operator[] (short index)
 
ConstReference operator[] (short index) const
 
Reference operator[] (unsigned short index)
 
ConstReference operator[] (unsigned short index) const
 
Reference operator[] (int index)
 
ConstReference operator[] (int index) const
 
Reference operator[] (unsigned int index)
 
ConstReference operator[] (unsigned int index) const
 
Reference operator[] (long index)
 
ConstReference operator[] (long index) const
 
Reference operator[] (unsigned long index)
 
ConstReference operator[] (unsigned long index) const
 
Reference operator[] (long long index)
 
ConstReference operator[] (long long index) const
 
Reference operator[] (unsigned long long index)
 
ConstReference operator[] (unsigned long long index) const
 
void Print (std::ostream &os, const char *separate=" ") const
 
void PrintInfo (std::ostream &os, const char *separate=" ") const
 
void PrintWithIndex (std::ostream &os, const char *separate=" ") const
 
ReverseIterator rBegin ()
 
ConstReverseIterator rBegin () const
 
ReverseIterator rEnd ()
 
ConstReverseIterator rEnd () const
 
NDArrayBase< T, Dim > & ReShape (const ShapeType &shape)
 
bool ReSize (const ShapeType &shape)
 
NDArrayBase< T, Dim > & Scale (const T a)
 
void SetData (T *const data, const ShapeType &shape)
 
void SetElement (unsigned short index, ConstReference value)
 
SizeType Size () const
 
void SoftThreshold (const double threshold)
 
void Swap (NDArrayBase< T, Dim > &vec)
 
 ~NDArrayBase ()
 
- Public Member Functions inherited from utl::Expr< NDArrayBase< T, Dim >, T >
const NDArrayBase< T, Dim > & ConstRef (void) const
 
const ShapeType GetShape () const
 
NDArrayBase< T, Dim > & Ref (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from utl::NDArrayBase< T, Dim >
static constexpr SizeType GetDimension ()
 
- Static Public Member Functions inherited from utl::Expr< NDArrayBase< T, Dim >, T >
static SizeType GetDimension ()
 
- Static Public Attributes inherited from utl::NDArrayBase< T, Dim >
static constexpr SizeType SubDimension = Dim>1?Dim-1:1
 
- Protected Member Functions inherited from utl::NDArrayBase< T, Dim >
void ClearData ()
 
void ClearShape ()
 
void ComputeOffSetTable ()
 
- Protected Attributes inherited from utl::NDArrayBase< T, Dim >
T * m_Data
 
bool m_IsShared
 
SizeType m_OffSetTable [Dimension]
 
SizeType m_Shape [Dimension]
 

Member Typedef Documentation

template<class T, unsigned int Dim>
typedef Superclass::ConstIterator utl::NDArray< T, Dim >::ConstIterator

Definition at line 75 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::ConstPointer utl::NDArray< T, Dim >::ConstPointer

Definition at line 77 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::ConstReference utl::NDArray< T, Dim >::ConstReference

Definition at line 79 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::Iterator utl::NDArray< T, Dim >::Iterator

Definition at line 74 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::Pointer utl::NDArray< T, Dim >::Pointer

Definition at line 76 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::Reference utl::NDArray< T, Dim >::Reference

Definition at line 78 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::ScalarValueType utl::NDArray< T, Dim >::ScalarValueType

Definition at line 69 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef NDArray utl::NDArray< T, Dim >::Self

Definition at line 64 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::ShapeType utl::NDArray< T, Dim >::ShapeType

Definition at line 72 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::SizeType utl::NDArray< T, Dim >::SizeType

Definition at line 71 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef NDArrayBase<T,Dim> utl::NDArray< T, Dim >::Superclass

Definition at line 65 of file utlNDArray.h.

template<class T, unsigned int Dim>
typedef Superclass::ValueType utl::NDArray< T, Dim >::ValueType

Definition at line 68 of file utlNDArray.h.

Constructor & Destructor Documentation

template<class T, unsigned int Dim>
utl::NDArray< T, Dim >::NDArray ( )
inline

Definition at line 87 of file utlNDArray.h.

template<class T, unsigned int Dim>
utl::NDArray< T, Dim >::NDArray ( const ShapeType shape)
inlineexplicit

Definition at line 89 of file utlNDArray.h.

template<class T, unsigned int Dim>
utl::NDArray< T, Dim >::NDArray ( const NDArray< T, Dim > &  vec)
inline

Definition at line 91 of file utlNDArray.h.

template<class T, unsigned int Dim>
utl::NDArray< T, Dim >::NDArray ( NDArray< T, Dim > &&  vec)
inline

Definition at line 93 of file utlNDArray.h.

template<class T, unsigned int Dim>
template<typename EType >
utl::NDArray< T, Dim >::NDArray ( const Expr< EType, typename EType::ValueType > &  expr)
inline

Definition at line 99 of file utlNDArray.h.

template<class T, unsigned int Dim>
utl::NDArray< T, Dim >::NDArray ( const T *  vec,
const ShapeType shape 
)
inline

Constructor assumes input points to array of correct size. Values are copied individually instead of with a binary copy. This allows the T's assignment operator to be executed.

Definition at line 106 of file utlNDArray.h.

template<class T, unsigned int Dim>
utl::NDArray< T, Dim >::NDArray ( const ShapeType shape,
const T  r 
)
inline

Constructor to initialize entire array to one value.

Definition at line 111 of file utlNDArray.h.

template<class T, unsigned int Dim>
template<typename TValue >
utl::NDArray< T, Dim >::NDArray ( const NDArray< TValue, Dim > &  r)
inline

Definition at line 114 of file utlNDArray.h.

Member Function Documentation

template<class T, unsigned int Dim>
NDArray<T,Dim>& utl::NDArray< T, Dim >::operator= ( const NDArray< T, Dim > &  r)
inline
template<class T, unsigned int Dim>
NDArray<T,Dim>& utl::NDArray< T, Dim >::operator= ( NDArray< T, Dim > &&  r)
inline

Definition at line 122 of file utlNDArray.h.


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