LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
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. More...
 
typedef ExpressionTraits
< Derived >::ND 
ND
 Number of dimensions (boost::mpl::int_). More...
 
typedef ExpressionTraits
< Derived >::Iterator 
Iterator
 Nested expression or element iterator. More...
 
typedef ExpressionTraits
< Derived >::Reference 
Reference
 Nested expression or element reference. More...
 
typedef ExpressionTraits
< Derived >::Value 
Value
 Nested expression or element value type. More...
 
typedef Vector< int, ND::value > Index
 Vector type for N-dimensional indices. More...
 
typedef Derived Self
 CRTP derived type. More...
 
typedef Value value_type
 
typedef Iterator iterator
 
typedef Iterator const_iterator
 
typedef Reference reference
 
typedef Reference const_reference
 
typedef Iterator pointer
 
typedef int difference_type
 
typedef int size_type
 

Public Member Functions

Reference operator[] (int n) const
 Return a single nested expression or element. More...
 
Reference front () const
 Return the first nested expression or element. More...
 
Reference back () const
 Return the last nested expression or element. More...
 
Iterator begin () const
 Return an Iterator to the beginning of the expression. More...
 
Iterator end () const
 Return an Iterator to one past the end of the expression. More...
 
template<int P>
int getSize () const
 Return the size of a specific dimension. More...
 
Index getShape () const
 Return a Vector of the sizes of all dimensions. More...
 
int getNumElements () const
 Return the total number of elements in the expression. More...
 
size_type size () const
 Return the size of the first dimension. More...
 
bool empty () const
 Return true if the first dimension has no elements. More...
 

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.

Definition at line 52 of file ExpressionBase.h.

Member Typedef Documentation

template<typename Derived>
typedef Iterator ndarray::ExpressionBase< Derived >::const_iterator

Definition at line 97 of file ExpressionBase.h.

template<typename Derived>
typedef Reference ndarray::ExpressionBase< Derived >::const_reference

Definition at line 99 of file ExpressionBase.h.

template<typename Derived>
typedef int ndarray::ExpressionBase< Derived >::difference_type

Definition at line 101 of file ExpressionBase.h.

template<typename Derived>
typedef ExpressionTraits<Derived>::Element ndarray::ExpressionBase< Derived >::Element

Data type of expression elements.

Definition at line 55 of file ExpressionBase.h.

template<typename Derived>
typedef Vector<int,ND::value> ndarray::ExpressionBase< Derived >::Index

Vector type for N-dimensional indices.

Definition at line 65 of file ExpressionBase.h.

template<typename Derived>
typedef ExpressionTraits<Derived>::Iterator ndarray::ExpressionBase< Derived >::Iterator

Nested expression or element iterator.

Definition at line 59 of file ExpressionBase.h.

template<typename Derived>
typedef Iterator ndarray::ExpressionBase< Derived >::iterator

Definition at line 96 of file ExpressionBase.h.

template<typename Derived>
typedef ExpressionTraits<Derived>::ND ndarray::ExpressionBase< Derived >::ND

Number of dimensions (boost::mpl::int_).

Definition at line 57 of file ExpressionBase.h.

template<typename Derived>
typedef Iterator ndarray::ExpressionBase< Derived >::pointer

Definition at line 100 of file ExpressionBase.h.

template<typename Derived>
typedef ExpressionTraits<Derived>::Reference ndarray::ExpressionBase< Derived >::Reference

Nested expression or element reference.

Definition at line 61 of file ExpressionBase.h.

template<typename Derived>
typedef Reference ndarray::ExpressionBase< Derived >::reference

Definition at line 98 of file ExpressionBase.h.

template<typename Derived>
typedef Derived ndarray::ExpressionBase< Derived >::Self

CRTP derived type.

Definition at line 67 of file ExpressionBase.h.

template<typename Derived>
typedef int ndarray::ExpressionBase< Derived >::size_type

Definition at line 102 of file ExpressionBase.h.

template<typename Derived>
typedef ExpressionTraits<Derived>::Value ndarray::ExpressionBase< Derived >::Value

Nested expression or element value type.

Definition at line 63 of file ExpressionBase.h.

template<typename Derived>
typedef Value ndarray::ExpressionBase< Derived >::value_type

Definition at line 95 of file ExpressionBase.h.

Member Function Documentation

template<typename Derived>
Reference ndarray::ExpressionBase< Derived >::back ( ) const
inline

Return the last nested expression or element.

Definition at line 76 of file ExpressionBase.h.

76 { return this->operator[](this->template getSize<0>()-1); }
Reference operator[](int n) const
Return a single nested expression or element.
template<typename Derived>
Iterator ndarray::ExpressionBase< Derived >::begin ( ) const
inline

Return an Iterator to the beginning of the expression.

Definition at line 79 of file ExpressionBase.h.

79 { return getSelf().begin(); }
template<typename Derived>
bool ndarray::ExpressionBase< Derived >::empty ( ) const
inline

Return true if the first dimension has no elements.

Definition at line 108 of file ExpressionBase.h.

108 { return this->template getSize<0>() == 0; }
template<typename Derived>
Iterator ndarray::ExpressionBase< Derived >::end ( ) const
inline

Return an Iterator to one past the end of the expression.

Definition at line 82 of file ExpressionBase.h.

82 { return getSelf().end(); }
template<typename Derived>
Reference ndarray::ExpressionBase< Derived >::front ( ) const
inline

Return the first nested expression or element.

Definition at line 73 of file ExpressionBase.h.

73 { return this->operator[](0); }
Reference operator[](int n) const
Return a single nested expression or element.
template<typename Derived>
int ndarray::ExpressionBase< Derived >::getNumElements ( ) const
inline

Return the total number of elements in the expression.

Definition at line 91 of file ExpressionBase.h.

91 { return getSelf().getNumElements(); }
template<typename Derived>
Self& ndarray::ExpressionBase< Derived >::getSelf ( )
inlineprotected

Definition at line 113 of file ExpressionBase.h.

113 { return *static_cast<Self *>(this); }
Derived Self
CRTP derived type.
template<typename Derived>
Self const& ndarray::ExpressionBase< Derived >::getSelf ( ) const
inlineprotected

Definition at line 114 of file ExpressionBase.h.

114 { return *static_cast<Self const *>(this); }
Derived Self
CRTP derived type.
template<typename Derived>
Index ndarray::ExpressionBase< Derived >::getShape ( ) const
inline

Return a Vector of the sizes of all dimensions.

Definition at line 88 of file ExpressionBase.h.

88 { return getSelf().getShape(); }
template<typename Derived>
template<int P>
int ndarray::ExpressionBase< Derived >::getSize ( ) const
inline

Return the size of a specific dimension.

Definition at line 85 of file ExpressionBase.h.

85 { return getSelf().template getSize<P>(); }
template<typename Derived>
Reference ndarray::ExpressionBase< Derived >::operator[] ( int  n) const
inline

Return a single nested expression or element.

Definition at line 70 of file ExpressionBase.h.

70 { return getSelf().operator[](n); }
template<typename Derived>
size_type ndarray::ExpressionBase< Derived >::size ( ) const
inline

Return the size of the first dimension.

Definition at line 105 of file ExpressionBase.h.

105 { return this->template getSize<0>(); }

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