TBTK
TBTK::Array< DataType > Class Template Reference

Public Member Functions

 Array ()
 
 Array (const std::vector< unsigned int > &ranges)
 
 Array (const std::vector< unsigned int > &ranges, const DataType &fillValue)
 
 Array (const Array &array)
 
 Array (Array &&array)
 
 ~Array ()
 
Arrayoperator= (const Array &rhs)
 
Arrayoperator= (Array &&rhs)
 
DataType & operator[] (const std::initializer_list< unsigned int > &index)
 
const DataType & operator[] (const std::initializer_list< unsigned int > &index) const
 
DataType & operator[] (unsigned int n)
 
const DataType & operator[] (unsigned int n) const
 
Array operator+ (const Array &rhs) const
 
Array operator- (const Array &rhs) const
 
Array operator* (const DataType &rhs) const
 
Array operator/ (const DataType &rhs) const
 
Array< DataType > getSlice (const std::vector< int > &index) const
 
const std::vector< unsigned int > & getRanges () const
 

Friends

Array operator* (const DataType &lhs, const Array &rhs)
 

Constructor & Destructor Documentation

template<typename DataType >
TBTK::Array< DataType >::Array ( )

Constructor.

template<typename DataType >
TBTK::Array< DataType >::Array ( const std::vector< unsigned int > &  ranges)

Constructor.

template<typename DataType >
TBTK::Array< DataType >::Array ( const std::vector< unsigned int > &  ranges,
const DataType &  fillValue 
)

Constructor.

template<typename DataType >
TBTK::Array< DataType >::Array ( const Array< DataType > &  array)

Copy constructor.

template<typename DataType >
TBTK::Array< DataType >::Array ( Array< DataType > &&  array)

Move constructor.

template<typename DataType >
TBTK::Array< DataType >::~Array ( )

Destructor.

Member Function Documentation

template<typename DataType >
const std::vector< unsigned int > & TBTK::Array< DataType >::getRanges ( ) const
inline

Get ranges.

template<typename DataType >
Array< DataType > TBTK::Array< DataType >::getSlice ( const std::vector< int > &  index) const

Get slice.

template<typename DataType >
Array< DataType > TBTK::Array< DataType >::operator* ( const DataType &  rhs) const
inline

Multiplication operator.

template<typename DataType >
Array< DataType > TBTK::Array< DataType >::operator+ ( const Array< DataType > &  rhs) const
inline

Addition operator.

template<typename DataType >
Array< DataType > TBTK::Array< DataType >::operator- ( const Array< DataType > &  rhs) const
inline

Subtraction operator.

template<typename DataType >
Array< DataType > TBTK::Array< DataType >::operator/ ( const DataType &  rhs) const
inline

Division operator.

template<typename DataType >
Array< DataType > & TBTK::Array< DataType >::operator= ( const Array< DataType > &  rhs)

Assignment operator.

template<typename DataType >
Array< DataType > & TBTK::Array< DataType >::operator= ( Array< DataType > &&  rhs)

Move assignment operator.

template<typename DataType >
DataType & TBTK::Array< DataType >::operator[] ( const std::initializer_list< unsigned int > &  index)
inline

Array subscript operator.

template<typename DataType >
const DataType & TBTK::Array< DataType >::operator[] ( const std::initializer_list< unsigned int > &  index) const
inline

Array subscript operator.

template<typename DataType >
DataType & TBTK::Array< DataType >::operator[] ( unsigned int  n)
inline

Array subscript operator. Imediate access for optimization. For an array with size {SIZE_A, SIZE_B, SIZE_C}, the supplied index should be calculated as SIZE_C*SIZE_B*a + SIZE_C*b + c.

template<typename DataType >
const DataType & TBTK::Array< DataType >::operator[] ( unsigned int  n) const
inline

Array subscript operator. Imediate access for optimization. For an array with size {SIZE_A, SIZE_B, SIZE_C}, the supplied index should be calculated as SIZE_C*SIZE_B*a + SIZE_C*b + c.

Friends And Related Function Documentation

template<typename DataType>
Array operator* ( const DataType &  lhs,
const Array< DataType > &  rhs 
)
friend

Multiplication operator.


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