Go to the documentation of this file. 1 #ifndef GfxTL__ARRAY_HEADER__
2 #define GfxTL__ARRAY_HEADER__
9 template<
unsigned int DimT,
class IteratorT >
20 return ArrayAccessor < DimT - 1, IteratorT > (m_arr + i * (*m_fac), m_fac + 1);
25 return ArrayAccessor < DimT - 1, IteratorT > (m_arr + i * (*m_fac), m_fac + 1);
34 return m_arr + *(m_fac - 1);
42 template<
class IteratorT >
46 typedef typename std::iterator_traits< IteratorT >::value_type
value_type;
47 typedef typename std::iterator_traits< IteratorT >::reference
reference;
65 return m_arr + *(m_fac - 1);
73 template<
unsigned int DimT,
class IteratorT >
77 typedef typename std::iterator_traits< IteratorT >::value_type
value_type;
80 template<
unsigned int D >
85 for (
unsigned int i = 0; i < DimT; ++i)
91 Array(IteratorT arr,
const size_t* ext)
99 for (
unsigned int i = 0; i < DimT; ++i)
104 for (
unsigned int i = DimT - 1; i != 0; --i)
106 m_fac[i - 1] = m_fac[i] * m_ext[i];
117 return ArrayAccessor < DimT - 1, IteratorT > (m_arr + i * m_fac[0], m_fac + 1);
122 return ArrayAccessor < DimT - 1, IteratorT > (m_arr + i * m_fac[0], m_fac + 1);
125 const size_t Extent(
unsigned int d)
const
141 return m_arr + m_fac[0] * m_ext[0];
149 return m_arr + m_fac[0] * m_ext[0];
165 template<
unsigned int DimT,
class IteratorT >
169 for (
size_t i = 0; i <
a.Extent(0); ++i)
171 o <<
Array < DimT - 1, IteratorT > (
a.m_arr +
a.m_fac[0] * i,
a.m_ext + 1);
172 if (i <
a.Extent(0) - 1)
181 template<
class IteratorT >
185 for (
size_t i = 0; i <
a.Extent(0); ++i)
188 if (i <
a.Extent(0) - 1)
reference operator[](size_t i) const
const ArrayAccessor< DimT - 1, IteratorT > operator[](size_t i) const
friend std::ostream & operator<<(std::ostream &o, const Array< D, IteratorT > &a)
Array< DimT, IteratorT > ThisType
std::iterator_traits< IteratorT >::value_type value_type
ArrayAccessor(IteratorT arr, const size_t *fac)
ArrayAccessor< DimT - 1, IteratorT > operator[](size_t i)
double a(double t, double a0, double j)
std::ostream & operator<<(std::ostream &o, const Array< DimT, IteratorT > &a)
ArrayAccessor< DimT - 1, IteratorT > operator[](size_t i)
const size_t * Extent() const
std::iterator_traits< IteratorT >::reference reference
Array(IteratorT arr, const size_t *ext)
void SetExtent(const size_t *ext)
std::iterator_traits< IteratorT >::value_type value_type
ArrayAccessor(IteratorT arr, const size_t *fac)
void Iterator(iterator i)
const size_t Extent(unsigned int d) const
const ArrayAccessor< DimT - 1, IteratorT > operator[](size_t i) const