11#ifndef NDARRAY_ArrayTraits_h_INCLUDED
12#define NDARRAY_ArrayTraits_h_INCLUDED
23#include <boost/mpl/int.hpp>
24#include <boost/mpl/bool.hpp>
29template <
int N,
typename T2,
int C2,
typename T1,
int C1>
31 (((C2>=C1 && C1>=0) || (C2<=C1 && C1<=0) || (N == 1 && C2 == -C1))
32 && boost::is_convertible<T2*,T1*>::value)
43template <
typename T,
int N,
int C>
46 typedef boost::mpl::int_<N> ND;
47 typedef boost::mpl::int_<C> RMC;
50 typedef Array<T,N-1,(N==C)?(N-1):((C>0)?C:0)>
Value;
54 static Reference makeReference(Element * data, CorePtr
const & core) {
57 static Iterator makeIterator(Element * data, CorePtr
const & core, Offset stride) {
66 for (; iter != end; ++iter) {
75 typedef boost::mpl::int_<1> ND;
76 typedef boost::mpl::int_<0> RMC;
78 typedef Element & Reference;
79 typedef Element Value;
83 static Reference makeReference(Element * data, CorePtr
const & core) {
86 static Iterator makeIterator(Element * data, CorePtr
const & core, Offset stride) {
90 std::fill(iter, end, value);
97 typedef boost::mpl::int_<1> ND;
98 typedef boost::mpl::int_<1> RMC;
99 typedef Element * Iterator;
100 typedef Element & Reference;
101 typedef Element Value;
105 static Reference makeReference(Element * data, CorePtr
const & core) {
108 static Iterator makeIterator(Element * data, CorePtr
const & core, Offset stride) {
111 static void fill(Iterator iter, Iterator
const & end, Element value) {
112 std::fill(iter, end, value);
119 typedef boost::mpl::int_<1> ND;
120 typedef boost::mpl::int_<-1> RMC;
121 typedef Element * Iterator;
122 typedef Element & Reference;
123 typedef Element Value;
127 static Reference makeReference(Element * data, CorePtr
const & core) {
130 static Iterator makeIterator(Element * data, CorePtr
const & core, Offset stride) {
133 static void fill(Iterator iter, Iterator
const & end, Element value) {
134 std::fill(iter, end, value);
138template <
typename T,
int N,
int C>
141 typedef boost::mpl::false_ IsScalar;
144template <
typename T,
int N,
int C>
147 typedef boost::mpl::false_ IsScalar;
A proxy class for Array with deep assignment operators.
Definition ArrayRef.h:34
A multidimensional strided array.
Definition Array.h:35
boost::intrusive_ptr< Core const > ConstPtr
const intrusive_ptr to Core
Definition Core.h:52
Definition NestedIterator.h:46
Definition StridedIterator.h:36
Forward declarations and default template parameters for ndarray.
Dimension-specialized traits shared by Array and ArrayRef.
Definition ArrayTraits.h:44
Traits for expressions.
Definition ExpressionTraits.h:30
Definition ArrayTraits.h:33