11#ifndef NDARRAY_Array_h_INCLUDED
12#define NDARRAY_Array_h_INCLUDED
34template <
typename T,
int N,
int C>
37 typedef typename Super::Core Core;
38 typedef typename Super::CorePtr CorePtr;
59 template <
typename T_,
int C_>
65 ) :
Super(other._data, other._core) {}
73 template <
typename T_,
int C_>
79 ) :
Super(other._data, other._core) {}
89 explicit Array(Size n1, Size n2=1, Size n3=1, Size n4=1, Size n5=1, Size n6=1, Size n7=1, Size n8=1);
103 if (&other !=
this) {
104 this->_data = other._data;
105 this->_core = other._core;
116 template <
typename T_,
int C_>
118 typename boost::enable_if<detail::Convertible<N,T_,C_,T,C>,
Array &>::type
123 this->_data = other._data;
124 this->_core = other._core;
134 template <
typename T_,
int C_>
136 typename boost::enable_if<detail::Convertible<N,T_,C_,T,C>,
Array &>::type
141 this->_data = other._data;
142 this->_core = other._core;
150 template <
typename T_,
int N_,
int C_>
160 template <
typename T_,
int N_,
int C_>
167 std::swap(this->_data, other._data);
168 this->_core.swap(other._core);
178 bool isUnique()
const {
return this->_core->isUnique(); }
181 template <
typename T_,
int N_,
int C_>
friend class Array;
182 template <
typename T_,
int N_,
int C_>
friend class ArrayRef;
183 template <
typename T_,
int N_,
int C_>
friend struct ArrayTraits;
184 template <
typename Derived>
friend class ArrayBase;
188 Array(T * data, CorePtr
const & core) : Super(data, core) {}
Definition of ArrayBaseN, a dimension-specialized CRTP base class for Array and ArrayRef.
An intermediate CRTP base class for Array and ArrayRef.
Definition ArrayBaseN.h:29
CRTP implementation for Array and ArrayRef.
Definition ArrayBase.h:43
Element * getData() const
Return a raw pointer to the first element of the array.
Definition ArrayBase.h:130
Strides getStrides() const
Return a Vector of the strides of all dimensions.
Definition ArrayBase.h:152
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition ArrayBase.h:149
A proxy class for Array with deep assignment operators.
Definition ArrayRef.h:34
A multidimensional strided array.
Definition Array.h:35
bool operator==(Array< T_, N_, C_ > const &other) const
Shallow equality comparison: return true if the arrays share data and have the same shape and strides...
Definition Array.h:151
Array(Array< T_, N, C_ > const &other, typename boost::enable_if< detail::Convertible< N, T_, C_, T, C >, void * >::type=0)
Converting copy constructor.
Definition Array.h:60
Array(ArrayRef< T_, N, C_ > const &other, typename boost::enable_if< detail::Convertible< N, T_, C_, T, C >, void * >::type=0)
Converting copy constructor.
Definition Array.h:74
Array(Array const &other)
Non-converting copy constructor.
Definition Array.h:51
Array()
Default constructor.
Definition Array.h:46
Array & operator=(Array const &other)
Non-converting shallow assignment.
Definition Array.h:102
boost::enable_if< detail::Convertible< N, T_, C_, T, C >, Array & >::type operator=(ArrayRef< T_, N, C_ > const &other)
Converting shallow assignment.
Definition Array.h:140
bool isUnique() const
Return true if the Array is definitely unique.
Definition Array.h:178
void swap(Array &other)
Lightweight shallow swap.
Definition Array.h:166
boost::enable_if< detail::Convertible< N, T_, C_, T, C >, Array & >::type operator=(Array< T_, N, C_ > const &other)
Converting shallow assignment.
Definition Array.h:122
bool operator!=(Array< T_, N_, C_ > const &other) const
Shallow inequality comparison.
Definition Array.h:161
Definition ArrayAccess.h:26
Forward declarations and default template parameters for ndarray.
Dimension-specialized traits shared by Array and ArrayRef.
Definition ArrayTraits.h:44
A fixed-size 1D array class.
Definition Vector.h:82
Definition ArrayTraits.h:33
Public interface for arbitrary views into arrays.