ndarray
NumPy-friendly multidimensional arrays in C++
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
ndarray::ExpressionBase< Derived > Class Template Reference

CRTP base class for all multidimensional expressions. More...

#include <ExpressionBase.h>

Inheritance diagram for ndarray::ExpressionBase< Derived >:
ndarray::ArrayBase< Array< T, N, C > > ndarray::ArrayBase< ArrayRef< T, N, C > > ndarray::ArrayBase< Derived > ndarray::ArrayBaseN< Array< T, N, C > > ndarray::ArrayBaseN< ArrayRef< T, N, C > > ndarray::ArrayBaseN< Derived, N > ndarray::ArrayBaseN< Derived, 1 > ndarray::ArrayBaseN< Derived, 2 > ndarray::ArrayBaseN< Derived, 3 > ndarray::ArrayBaseN< Derived, 4 > ndarray::ArrayBaseN< Derived, 5 > ndarray::ArrayBaseN< Derived, 6 >

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

SelfgetSelf ()
 
Self const & getSelf () const
 

Detailed Description

template<typename Derived>
class ndarray::ExpressionBase< Derived >

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.


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