23 #ifndef NDARRAY_ArrayBase_h_INCLUDED
24 #define NDARRAY_ArrayBase_h_INCLUDED
33 #include <boost/iterator/counting_iterator.hpp>
55 template <
typename Derived>
87 return Traits::makeReference(
88 this->
_data + n * this->
template getStride<0>(),
95 return *(this->
_data + this->
_core->template computeOffset(i));
100 return Traits::makeIterator(
103 this->
template getStride<0>()
109 return Traits::makeIterator(
110 this->
_data + this->
template getSize<0>() * this->
template getStride<0>(),
112 this->
template getStride<0>()
148 for (
int n=0; n < ND::value / 2; ++n) {
149 std::swap(shape[n], shape[ND::value-n-1]);
150 std::swap(strides[n], strides[ND::value-n-1]);
164 for (
int n=0; n < ND::value; ++n) {
165 newShape[n] = oldShape[order[n]];
166 newStrides[n] = oldStrides[order[n]];
170 Core::create(newShape, newStrides,
getManager())
190 template <
typename XprKind,
int Rows,
int Cols>
193 template <
typename XprKind>
196 template <
int Rows,
int Cols>
203 template <
typename View_>
213 template <
typename Seq>
220 template <
typename T_,
int N_,
int C_>
friend class Array;
221 template <
typename T_,
int N_,
int C_>
friend class ArrayRef;
240 #endif // !NDARRAY_ArrayBase_h_INCLUDED
A proxy class for Array with deep assignment operators.
Array< Element_, ND_::value, RMC_::value > Value
Dimension-specialized traits shared by Array and ArrayRef.
ArrayRef< Element_, ND_::value, RMC_::value > Type
ExpressionTraits< Derived >::Reference Reference
Nested expression or element reference.
Traits::Value Value
Nested array or element value type.
Index getStrides() const
Return a Vector of the strides of all dimensions.
void swap(ImageBase< PixelT > &a, ImageBase< PixelT > &b)
Eigen3 view into an ndarray::Array.
Vector< int, ND::value > Index
Vector type for N-dimensional indices.
Traits::Reference Reference
Nested array or element reference.
Traits::ND ND
Number of dimensions (boost::mpl::int_).
Traits::Iterator Iterator
Nested array or element iterator.
int getStride() const
Return the stride in a specific dimension.
detail::ViewTraits< ND::value, RMC::value, typename View_::Sequence >::ND ND_
boost::mpl::int_< C > RMC
Array< Element, ND::value, RMC::value > Shallow
The corresponding Array type.
void operator=(ArrayBase const &other)
ArrayRef< Element, ND::value, RMC::value > Deep
The corresponding ArrayRef type.
FullTranspose transpose() const
Return a view of the array with the order of the dimensions reversed.
EigenView< Element, ND::value, RMC::value, XprKind, Rows, Cols > asEigen() const
ExpressionTraits< Derived > Traits
A template metafunction class to determine the result of a view indexing operation.
int getSize() const
Return the size of a specific dimension.
ExpressionTraits< Derived >::Element Element
Data type of expression elements.
A fixed-size 1D array class.
Index getShape() const
Return a Vector of the sizes of all dimensions.
boost::intrusive_ptr< Manager > Ptr
detail::ViewTraits< ND::value, RMC::value, typename View_::Sequence >::RMC RMC_
ResultOf< View< Seq > >::Type operator[](View< Seq > const &def) const
Return a general view into this array (see Tutorial).
Definitions for ArrayAccess.
Definitions for ExpressionBase.
int getNumElements() const
Return the total number of elements in the array.
Traits::RMC RMC
Number of guaranteed row-major contiguous dimensions, counted from the end (boost::mpl::int_).
Implementation of arbitrary views into arrays.
Forward declarations for ndarray/eigen interface.
CRTP implementation for Array and ArrayRef.
Element * getData() const
Return a raw pointer to the first element of the array.
ArrayRef< Element, ND::value,-RMC::value > FullTranspose
ArrayRef to a reverse-ordered contiguous array; the result of a call to transpose().
bool isEmpty() const
Return true if the array has a null data point.
A multidimensional strided array.
Deep const deep() const
Return an ArrayRef view to this.
Traits::Element Element
Data type of array elements.
Iterator end() const
Return an Iterator to one past the end of the array.
A template meta-sequence that defines an arbitrary view into an unspecified array.
Element & operator[](Index const &i) const
Return a single element from the array.
ArrayBase(Element *data, CorePtr const &core)
Sequence _seq
A boost::fusion sequence of index objects.
Definition of NestedIterator.
Shallow const shallow() const
Return a Array view to this.
ExpressionTraits< Derived >::Iterator Iterator
Nested expression or element iterator.
ArrayRef< Element, ND::value, 0 > Transpose
ArrayRef to a noncontiguous array; the result of a call to transpose(...).
Definition of StridedIterator.
Transpose transpose(Index const &order) const
Return a view of the array with the dimensions permuted.
ViewBuilder< Array_, Seq_ >::OutputArray buildView(Array_ const &array, Seq_ const &seq)
Manager::Ptr getManager() const
Return the opaque object responsible for memory management.
CRTP base class for all multidimensional expressions.
Reference operator[](int n) const
Return a single subarray.
Iterator begin() const
Return an Iterator to the beginning of the array.