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 | Private Types | Private Member Functions | Friends | List of all members
ndarray::ArrayRef< T, N, C > Class Template Reference

A proxy class for Array with deep assignment operators. More...

#include <ArrayRef.h>

Inheritance diagram for ndarray::ArrayRef< T, N, C >:
ndarray::ArrayBaseN< ArrayRef< T, N, C > > ndarray::ArrayBase< ArrayRef< T, N, C > > ndarray::ExpressionBase< Derived >

Public Types

typedef Super::Iterator Iterator
 
- Public Types inherited from ndarray::ArrayBaseN< ArrayRef< T, N, C > >
typedef Super::Element Element
 
- Public Types inherited from ndarray::ArrayBase< ArrayRef< T, N, C > >
typedef Traits::Element Element
 Data type of array elements. More...
 
typedef Traits::Iterator Iterator
 Nested array or element iterator. More...
 
typedef Traits::Reference Reference
 Nested array or element reference. More...
 
typedef Traits::Value Value
 Nested array or element value type. More...
 
typedef Traits::ND ND
 Number of dimensions (boost::mpl::int_). More...
 
typedef Traits::RMC RMC
 Number of guaranteed row-major contiguous dimensions, counted from the end (boost::mpl::int_). More...
 
typedef Vector< int, ND::value > Index
 Vector type for N-dimensional indices. More...
 
typedef ArrayRef< Element,
ND::value,-RMC::value > 
FullTranspose
 ArrayRef to a reverse-ordered contiguous array; the result of a call to transpose(). More...
 
typedef ArrayRef< Element,
ND::value, 0 > 
Transpose
 ArrayRef to a noncontiguous array; the result of a call to transpose(...). More...
 
typedef Array< Element,
ND::value, RMC::value > 
Shallow
 The corresponding Array type. More...
 
typedef ArrayRef< Element,
ND::value, RMC::value > 
Deep
 The corresponding ArrayRef type. More...
 
- Public Types inherited from ndarray::ExpressionBase< Derived >
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

 ArrayRef (ArrayRef const &other)
 Non-converting copy constructor. More...
 
template<typename T_ , int C_>
 ArrayRef (Array< T_, N, C_ > const &other)
 Converting copy constructor. More...
 
template<typename T_ , int C_>
 ArrayRef (ArrayRef< T_, N, C_ > const &other)
 Converting copy constructor. More...
 
Assignment and Augmented Assignment Operators

ArrayRef assignment is deep, and requires that the ArrayRef being assigned to has the same shape as the input array expression. Scalar assignment sets all elements of the ArrayRef to a single value.

ArrayRef const & operator= (Array< T, N, C > const &other) const
 = assignment of arrays and array expressions. More...
 
ArrayRef const & operator= (ArrayRef const &other) const
 = assignment of arrays and array expressions. More...
 
template<typename Other >
ArrayRef const & operator= (ExpressionBase< Other > const &expr) const
 = assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator= (Scalar const &scalar) const
 = assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator+= (ExpressionBase< Other > const &expr) const
 += assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator+= (Scalar const &scalar) const
 += assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator-= (ExpressionBase< Other > const &expr) const
 -= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator-= (Scalar const &scalar) const
 -= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator*= (ExpressionBase< Other > const &expr) const
 *= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator*= (Scalar const &scalar) const
 *= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator/= (ExpressionBase< Other > const &expr) const
 /= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator/= (Scalar const &scalar) const
 /= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator%= (ExpressionBase< Other > const &expr) const
 %= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator%= (Scalar const &scalar) const
 %= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator^= (ExpressionBase< Other > const &expr) const
 ^= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator^= (Scalar const &scalar) const
 ^= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator&= (ExpressionBase< Other > const &expr) const
 &= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator&= (Scalar const &scalar) const
 &= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator|= (ExpressionBase< Other > const &expr) const
 |= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator|= (Scalar const &scalar) const
 |= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator<<= (ExpressionBase< Other > const &expr) const
 <<= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator<<= (Scalar const &scalar) const
 <<= assignment of scalars. More...
 
template<typename Other >
ArrayRef const & operator>>= (ExpressionBase< Other > const &expr) const
 >>= assignment of arrays and array expressions. More...
 
template<typename Scalar >
ArrayRef const & operator>>= (Scalar const &scalar) const
 >>= assignment of scalars. More...
 
- Public Member Functions inherited from ndarray::ArrayBase< ArrayRef< T, N, C > >
Reference operator[] (int n) const
 Return a single subarray. More...
 
Elementoperator[] (Index const &i) const
 Return a single element from the array. More...
 
ResultOf< View< Seq > >::Type operator[] (View< Seq > const &def) const
 Return a general view into this array (see Tutorial). More...
 
Iterator begin () const
 Return an Iterator to the beginning of the array. More...
 
Iterator end () const
 Return an Iterator to one past the end of the array. More...
 
ElementgetData () const
 Return a raw pointer to the first element of the array. More...
 
bool isEmpty () const
 Return true if the array has a null data point. More...
 
Manager::Ptr getManager () const
 Return the opaque object responsible for memory management. More...
 
int getSize () const
 Return the size of a specific dimension. More...
 
int getStride () const
 Return the stride in a specific dimension. More...
 
Index getShape () const
 Return a Vector of the sizes of all dimensions. More...
 
Index getStrides () const
 Return a Vector of the strides of all dimensions. More...
 
int getNumElements () const
 Return the total number of elements in the array. More...
 
FullTranspose transpose () const
 Return a view of the array with the order of the dimensions reversed. More...
 
Transpose transpose (Index const &order) const
 Return a view of the array with the dimensions permuted. More...
 
Shallow const shallow () const
 Return a Array view to this. More...
 
Deep const deep () const
 Return an ArrayRef view to this. More...
 
EigenView< Element, ND::value,
RMC::value, XprKind, Rows,
Cols > 
asEigen () const
 
EigenView< Element, ND::value,
RMC::value, XprKind > 
asEigen () const
 
EigenView< Element, ND::value,
RMC::value, Eigen::MatrixXpr,
Rows, Cols > 
asEigen () const
 
EigenView< Element, ND::value,
RMC::value, Eigen::MatrixXpr > 
asEigen () const
 
- Public Member Functions inherited from ndarray::ExpressionBase< Derived >
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...
 

Private Types

typedef ArrayBaseN< ArrayRefSuper
 
typedef Super::Core Core
 
typedef Super::CorePtr CorePtr
 

Private Member Functions

 ArrayRef (T *data, CorePtr const &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 Derived >
class ArrayBase
 
template<typename Array_ >
class detail::ArrayAccess
 

Additional Inherited Members

- Protected Types inherited from ndarray::ArrayBaseN< ArrayRef< T, N, C > >
typedef Super::Core Core
 
typedef Super::CorePtr CorePtr
 
- Protected Types inherited from ndarray::ArrayBase< ArrayRef< T, N, C > >
typedef ExpressionTraits
< ArrayRef< T, N, C > > 
Traits
 
typedef Traits::Core Core
 
typedef Traits::CorePtr CorePtr
 
- Protected Member Functions inherited from ndarray::ArrayBase< ArrayRef< T, N, C > >
 ArrayBase (Element *data, CorePtr const &core)
 
void operator= (ArrayBase const &other)
 
- Protected Member Functions inherited from ndarray::ExpressionBase< Derived >
SelfgetSelf ()
 
Self const & getSelf () const
 
- Protected Attributes inherited from ndarray::ArrayBase< ArrayRef< T, N, C > >
Element_data
 
CorePtr _core
 

Detailed Description

template<typename T, int N, int C>
class ndarray::ArrayRef< T, N, C >

A proxy class for Array with deep assignment operators.

Definition at line 46 of file ArrayRef.h.

Member Typedef Documentation

template<typename T, int N, int C>
typedef Super::Core ndarray::ArrayRef< T, N, C >::Core
private

Definition at line 48 of file ArrayRef.h.

template<typename T, int N, int C>
typedef Super::CorePtr ndarray::ArrayRef< T, N, C >::CorePtr
private

Definition at line 49 of file ArrayRef.h.

template<typename T, int N, int C>
typedef Super::Iterator ndarray::ArrayRef< T, N, C >::Iterator

Definition at line 51 of file ArrayRef.h.

template<typename T, int N, int C>
typedef ArrayBaseN<ArrayRef> ndarray::ArrayRef< T, N, C >::Super
private

Definition at line 47 of file ArrayRef.h.

Constructor & Destructor Documentation

template<typename T, int N, int C>
ndarray::ArrayRef< T, N, C >::ArrayRef ( ArrayRef< T, N, C > const &  other)
inline

Non-converting copy constructor.

Definition at line 56 of file ArrayRef.h.

56 : Super(other._data, other._core) {}
ArrayBaseN< ArrayRef > Super
Definition: ArrayRef.h:47
template<typename T, int N, int C>
template<typename T_ , int C_>
ndarray::ArrayRef< T, N, C >::ArrayRef ( Array< T_, N, C_ > const &  other)
inlineexplicit

Converting copy constructor.

Implicit conversion is allowed for non-const to const and for more guaranteed RMC to less guaranteed RMC (see Tutorial).

Definition at line 65 of file ArrayRef.h.

70  : Super(other._data, other._core) {}
ArrayBaseN< ArrayRef > Super
Definition: ArrayRef.h:47
template<typename T, int N, int C>
template<typename T_ , int C_>
ndarray::ArrayRef< T, N, C >::ArrayRef ( ArrayRef< T_, N, C_ > const &  other)
inline

Converting copy constructor.

Implicit conversion is allowed for non-const to const and for more guaranteed RMC to less guaranteed RMC (see Tutorial).

Definition at line 79 of file ArrayRef.h.

84  : Super(other._data, other._core) {}
ArrayBaseN< ArrayRef > Super
Definition: ArrayRef.h:47
template<typename T, int N, int C>
ndarray::ArrayRef< T, N, C >::ArrayRef ( T *  data,
CorePtr const &  core 
)
inlineprivate

Definition at line 389 of file ArrayRef.h.

389 : Super(data, core) {}
ArrayBaseN< ArrayRef > Super
Definition: ArrayRef.h:47

Member Function Documentation

template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator%= ( ExpressionBase< Other > const &  expr) const
inline

%= assignment of arrays and array expressions.

Definition at line 233 of file ArrayRef.h.

233  {
234  NDARRAY_ASSERT(expr.getShape()
235  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
236  Iterator const i_end = this->end();
237  typename Other::Iterator j = expr.begin();
238  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) %= (*j);
239  return *this;
240  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator%= ( Scalar const &  scalar) const
inline

%= assignment of scalars.

Definition at line 249 of file ArrayRef.h.

249  {
250  Iterator const i_end = this->end();
251  for (Iterator i = this->begin(); i != i_end; ++i) (*i) %= scalar;
252  return *this;
253  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator&= ( ExpressionBase< Other > const &  expr) const
inline

&= assignment of arrays and array expressions.

Definition at line 283 of file ArrayRef.h.

283  {
284  NDARRAY_ASSERT(expr.getShape()
285  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
286  Iterator const i_end = this->end();
287  typename Other::Iterator j = expr.begin();
288  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) &= (*j);
289  return *this;
290  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator&= ( Scalar const &  scalar) const
inline

&= assignment of scalars.

Definition at line 299 of file ArrayRef.h.

299  {
300  Iterator const i_end = this->end();
301  for (Iterator i = this->begin(); i != i_end; ++i) (*i) &= scalar;
302  return *this;
303  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator*= ( ExpressionBase< Other > const &  expr) const
inline

*= assignment of arrays and array expressions.

Definition at line 183 of file ArrayRef.h.

183  {
184  NDARRAY_ASSERT(expr.getShape()
185  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
186  Iterator const i_end = this->end();
187  typename Other::Iterator j = expr.begin();
188  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) *= (*j);
189  return *this;
190  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator*= ( Scalar const &  scalar) const
inline

*= assignment of scalars.

Definition at line 199 of file ArrayRef.h.

199  {
200  Iterator const i_end = this->end();
201  for (Iterator i = this->begin(); i != i_end; ++i) (*i) *= scalar;
202  return *this;
203  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator+= ( ExpressionBase< Other > const &  expr) const
inline

+= assignment of arrays and array expressions.

Definition at line 133 of file ArrayRef.h.

133  {
134  NDARRAY_ASSERT(expr.getShape()
135  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
136  Iterator const i_end = this->end();
137  typename Other::Iterator j = expr.begin();
138  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) += (*j);
139  return *this;
140  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator+= ( Scalar const &  scalar) const
inline

+= assignment of scalars.

Definition at line 149 of file ArrayRef.h.

149  {
150  Iterator const i_end = this->end();
151  for (Iterator i = this->begin(); i != i_end; ++i) (*i) += scalar;
152  return *this;
153  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator-= ( ExpressionBase< Other > const &  expr) const
inline

-= assignment of arrays and array expressions.

Definition at line 158 of file ArrayRef.h.

158  {
159  NDARRAY_ASSERT(expr.getShape()
160  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
161  Iterator const i_end = this->end();
162  typename Other::Iterator j = expr.begin();
163  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) -= (*j);
164  return *this;
165  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator-= ( Scalar const &  scalar) const
inline

-= assignment of scalars.

Definition at line 174 of file ArrayRef.h.

174  {
175  Iterator const i_end = this->end();
176  for (Iterator i = this->begin(); i != i_end; ++i) (*i) -= scalar;
177  return *this;
178  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator/= ( ExpressionBase< Other > const &  expr) const
inline

/= assignment of arrays and array expressions.

Definition at line 208 of file ArrayRef.h.

208  {
209  NDARRAY_ASSERT(expr.getShape()
210  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
211  Iterator const i_end = this->end();
212  typename Other::Iterator j = expr.begin();
213  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) /= (*j);
214  return *this;
215  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator/= ( Scalar const &  scalar) const
inline

/= assignment of scalars.

Definition at line 224 of file ArrayRef.h.

224  {
225  Iterator const i_end = this->end();
226  for (Iterator i = this->begin(); i != i_end; ++i) (*i) /= scalar;
227  return *this;
228  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator<<= ( ExpressionBase< Other > const &  expr) const
inline

<<= assignment of arrays and array expressions.

Definition at line 333 of file ArrayRef.h.

333  {
334  NDARRAY_ASSERT(expr.getShape()
335  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
336  Iterator const i_end = this->end();
337  typename Other::Iterator j = expr.begin();
338  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) <<= (*j);
339  return *this;
340  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator<<= ( Scalar const &  scalar) const
inline

<<= assignment of scalars.

Definition at line 349 of file ArrayRef.h.

349  {
350  Iterator const i_end = this->end();
351  for (Iterator i = this->begin(); i != i_end; ++i) (*i) <<= scalar;
352  return *this;
353  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator= ( Array< T, N, C > const &  other) const
inline

= assignment of arrays and array expressions.

Definition at line 95 of file ArrayRef.h.

95  {
96  NDARRAY_ASSERT(other.getShape() == this->getShape());
97  std::copy(other.begin(), other.end(), this->begin());
98  return *this;
99  }
SelectEigenView< T >::Type copy(Eigen::EigenBase< T > const &other)
Copy an arbitrary Eigen expression into a new EigenView.
Definition: eigen.h:390
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator= ( ArrayRef< T, N, C > const &  other) const
inline

= assignment of arrays and array expressions.

Definition at line 101 of file ArrayRef.h.

101  {
102  NDARRAY_ASSERT(other.getShape() == this->getShape());
103  std::copy(other.begin(), other.end(), this->begin());
104  return *this;
105  }
SelectEigenView< T >::Type copy(Eigen::EigenBase< T > const &other)
Copy an arbitrary Eigen expression into a new EigenView.
Definition: eigen.h:390
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator= ( ExpressionBase< Other > const &  expr) const
inline

= assignment of arrays and array expressions.

Definition at line 111 of file ArrayRef.h.

111  {
112  NDARRAY_ASSERT(expr.getShape()
113  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
114  std::copy(expr.begin(),expr.end(),this->begin());
115  return *this;
116  }
SelectEigenView< T >::Type copy(Eigen::EigenBase< T > const &other)
Copy an arbitrary Eigen expression into a new EigenView.
Definition: eigen.h:390
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator= ( Scalar const &  scalar) const
inline

= assignment of scalars.

Definition at line 125 of file ArrayRef.h.

125  {
126  Super::Traits::fill(this->begin(),this->end(),scalar);
127  return *this;
128  }
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator>>= ( ExpressionBase< Other > const &  expr) const
inline

>>= assignment of arrays and array expressions.

Definition at line 358 of file ArrayRef.h.

358  {
359  NDARRAY_ASSERT(expr.getShape()
360  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
361  Iterator const i_end = this->end();
362  typename Other::Iterator j = expr.begin();
363  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) >>= (*j);
364  return *this;
365  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator>>= ( Scalar const &  scalar) const
inline

>>= assignment of scalars.

Definition at line 374 of file ArrayRef.h.

374  {
375  Iterator const i_end = this->end();
376  for (Iterator i = this->begin(); i != i_end; ++i) (*i) >>= scalar;
377  return *this;
378  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator^= ( ExpressionBase< Other > const &  expr) const
inline

^= assignment of arrays and array expressions.

Definition at line 258 of file ArrayRef.h.

258  {
259  NDARRAY_ASSERT(expr.getShape()
260  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
261  Iterator const i_end = this->end();
262  typename Other::Iterator j = expr.begin();
263  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) ^= (*j);
264  return *this;
265  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator^= ( Scalar const &  scalar) const
inline

^= assignment of scalars.

Definition at line 274 of file ArrayRef.h.

274  {
275  Iterator const i_end = this->end();
276  for (Iterator i = this->begin(); i != i_end; ++i) (*i) ^= scalar;
277  return *this;
278  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Other >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator|= ( ExpressionBase< Other > const &  expr) const
inline

|= assignment of arrays and array expressions.

Definition at line 308 of file ArrayRef.h.

308  {
309  NDARRAY_ASSERT(expr.getShape()
310  == this->getShape().template first<ExpressionBase<Other>::ND::value>());
311  Iterator const i_end = this->end();
312  typename Other::Iterator j = expr.begin();
313  for (Iterator i = this->begin(); i != i_end; ++i, ++j) (*i) |= (*j);
314  return *this;
315  }
#define NDARRAY_ASSERT(ARG)
Definition: ndarray_fwd.h:51
Index getShape() const
Return a Vector of the sizes of all dimensions.
Definition: ArrayBase.h:136
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99
template<typename T, int N, int C>
template<typename Scalar >
ArrayRef const& ndarray::ArrayRef< T, N, C >::operator|= ( Scalar const &  scalar) const
inline

|= assignment of scalars.

Definition at line 324 of file ArrayRef.h.

324  {
325  Iterator const i_end = this->end();
326  for (Iterator i = this->begin(); i != i_end; ++i) (*i) |= scalar;
327  return *this;
328  }
Super::Iterator Iterator
Definition: ArrayRef.h:51
Iterator end() const
Return an Iterator to one past the end of the array.
Definition: ArrayBase.h:108
Iterator begin() const
Return an Iterator to the beginning of the array.
Definition: ArrayBase.h:99

Friends And Related Function Documentation

template<typename T, int N, int C>
template<typename T_ , int N_, int C_>
friend class ArrayRef
friend

Definition at line 383 of file ArrayRef.h.

template<typename T, int N, int C>
template<typename T_ , int N_, int C_>
friend class Array
friend

Definition at line 382 of file ArrayRef.h.

template<typename T, int N, int C>
template<typename Derived >
friend class ArrayBase
friend

Definition at line 385 of file ArrayRef.h.

template<typename T, int N, int C>
template<typename T_ , int N_, int C_>
friend struct ArrayTraits
friend

Definition at line 384 of file ArrayRef.h.

template<typename T, int N, int C>
template<typename Array_ >
friend class detail::ArrayAccess
friend

Definition at line 386 of file ArrayRef.h.


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