23 #ifndef NDARRAY_ExpressionBase_h_INCLUDED
24 #define NDARRAY_ExpressionBase_h_INCLUDED
51 template <
typename Derived>
85 template <
int P>
int getSize()
const {
return getSelf().template getSize<P>(); }
108 bool empty()
const {
return this->
template getSize<0>() == 0; }
119 #endif // !NDARRAY_ExpressionBase_h_INCLUDED
Derived Self
CRTP derived type.
ExpressionTraits< Derived >::Reference Reference
Nested expression or element reference.
Index getShape() const
Return a Vector of the sizes of all dimensions.
int getNumElements() const
Return the total number of elements in the expression.
Vector< int, ND::value > Index
Vector type for N-dimensional indices.
ExpressionTraits< Derived >::ND ND
Number of dimensions (boost::mpl::int_).
ExpressionTraits< Derived >::Element Element
Data type of expression elements.
A fixed-size 1D array class.
Reference front() const
Return the first nested expression or element.
Reference const_reference
size_type size() const
Return the size of the first dimension.
Reference back() const
Return the last nested expression or element.
Self const & getSelf() const
int getSize() const
Return the size of a specific dimension.
Iterator begin() const
Return an Iterator to the beginning of the expression.
bool empty() const
Return true if the first dimension has no elements.
Reference operator[](int n) const
Return a single nested expression or element.
Iterator end() const
Return an Iterator to one past the end of the expression.
ExpressionTraits< Derived >::Value Value
Nested expression or element value type.
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
CRTP base class for all multidimensional expressions.