ndarray
NumPy-friendly multidimensional arrays in C++
|
CRTP base class for all multidimensional expressions. More...
#include <ExpressionBase.h>
Public Types | |
typedef ExpressionTraits< Derived >::Element | Element |
Data type of expression elements. | |
typedef ExpressionTraits< Derived >::ND | ND |
Number of dimensions (boost::mpl::int_). | |
typedef ExpressionTraits< Derived >::Iterator | Iterator |
Nested expression or element iterator. | |
typedef ExpressionTraits< Derived >::Reference | Reference |
Nested expression or element reference. | |
typedef ExpressionTraits< Derived >::Value | Value |
Nested expression or element value type. | |
typedef Vector< Size, ND::value > | Index |
Vector type for N-dimensional indices. | |
typedef Derived | Self |
CRTP derived type. | |
typedef Value | value_type |
typedef Iterator | iterator |
typedef Iterator | const_iterator |
typedef Reference | reference |
typedef Reference | const_reference |
typedef Iterator | pointer |
typedef Offset | difference_type |
typedef Size | size_type |
Public Member Functions | |
Reference | operator[] (Size n) const |
Return a single nested expression or element. | |
Reference | front () const |
Return the first nested expression or element. | |
Reference | back () const |
Return the last nested expression or element. | |
Iterator | begin () const |
Return an Iterator to the beginning of the expression. | |
Iterator | end () const |
Return an Iterator to one past the end of the expression. | |
template<int P> | |
Size | getSize () const |
Return the size of a specific dimension. | |
Index | getShape () const |
Return a Vector of the sizes of all dimensions. | |
Size | getNumElements () const |
Return the total number of elements in the expression. | |
size_type | size () const |
Return the size of the first dimension. | |
bool | empty () const |
Return true if the first dimension has no elements. | |
Protected Member Functions | |
Self & | getSelf () |
Self const & | getSelf () const |
CRTP base class for all multidimensional expressions.
ExpressionBase is a CRTP base class for both true array objects (subclasses of ArrayBase) and lazy array expressions, which are created by most arithmetic, bitwise, and logical operations on arrays. These lazy expressions have most of the features of a true array to a const data type.
ExpressionBase also provides implementations for a few STL compatibility and convenience member functions.