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

CRTP implementation for Array and ArrayRef. More...

#include <ArrayBase.h>

Inheritance diagram for ndarray::ArrayBase< Derived >:
ndarray::ExpressionBase< 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 >

Classes

struct  ResultOf
 A template metafunction class to determine the result of a view indexing operation. More...
 

Public Types

typedef Traits::Element Element
 Data type of array elements.
 
typedef Traits::Iterator Iterator
 Nested array or element iterator.
 
typedef Traits::Reference Reference
 Nested array or element reference.
 
typedef Traits::Value Value
 Nested array or element value type.
 
typedef Traits::ND ND
 Number of dimensions (boost::mpl::int_).
 
typedef Traits::RMC RMC
 Number of guaranteed row-major contiguous dimensions, counted from the end (boost::mpl::int_).
 
typedef Vector< Size, ND::value > Index
 Vector type for N-dimensional indices and shapes.
 
typedef Vector< Offset, ND::value > Strides
 Vector type for N-dimensional offsets and strides.
 
typedef ArrayRef< Element, ND::value,-RMC::value > FullTranspose
 ArrayRef to a reverse-ordered contiguous array; the result of a call to transpose().
 
typedef ArrayRef< Element, ND::value, 0 > Transpose
 ArrayRef to a noncontiguous array; the result of a call to transpose(...).
 
typedef Array< Element, ND::value, RMC::value > Shallow
 The corresponding Array type.
 
typedef ArrayRef< Element, ND::value, RMC::value > Deep
 The corresponding ArrayRef type.
 
- Public Types inherited from ndarray::ExpressionBase< Derived >
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 subarray.
 
Elementoperator[] (Index const &i) const
 Return a single element from the array.
 
Iterator begin () const
 Return an Iterator to the beginning of the array.
 
Iterator end () const
 Return an Iterator to one past the end of the array.
 
ElementgetData () const
 Return a raw pointer to the first element of the array.
 
bool isEmpty () const
 Return true if the array has a null data point.
 
Manager::Ptr getManager () const
 Return the opaque object responsible for memory management.
 
template<int P>
Size getSize () const
 Return the size of a specific dimension.
 
template<int P>
Offset getStride () const
 Return the stride in a specific dimension.
 
Index getShape () const
 Return a Vector of the sizes of all dimensions.
 
Strides getStrides () const
 Return a Vector of the strides of all dimensions.
 
Size getNumElements () const
 Return the total number of elements in the array.
 
FullTranspose transpose () const
 Return a view of the array with the order of the dimensions reversed.
 
Transpose transpose (Index const &order) const
 Return a view of the array with the dimensions permuted.
 
Shallow const shallow () const
 Return a Array view to this.
 
Deep const deep () const
 Return an ArrayRef view to this.
 
template<typename Seq >
ResultOf< View< Seq > >::Type operator[] (View< Seq > const &def) const
 Return a general view into this array (see Tutorial).
 
- Public Member Functions inherited from ndarray::ExpressionBase< Derived >
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 Types

typedef ExpressionTraits< Derived > Traits
 
typedef Traits::Core Core
 
typedef Traits::CorePtr CorePtr
 

Protected Member Functions

void operator= (ArrayBase const &other)
 
template<typename Other >
 ArrayBase (ArrayBase< Other > const &other)
 
 ArrayBase (Element *data, CorePtr const &core)
 
- Protected Member Functions inherited from ndarray::ExpressionBase< Derived >
SelfgetSelf ()
 
Self const & getSelf () const
 

Protected Attributes

Element_data
 
CorePtr _core
 

Friends

template<typename T_ , int N_, int C_>
class Array
 
template<typename T_ , int N_, int C_>
class ArrayRef
 
template<typename T_ , int N_, int C_>
struct ArrayTraits
 
template<typename T_ , int N_, int C_>
class detail::NestedIterator
 
template<typename Array_ >
class detail::ArrayAccess
 

Detailed Description

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

CRTP implementation for Array and ArrayRef.

Implements member functions that need specialization for 1D arrays.


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