Home
Install
Use
Develop
Support
News
Credits
hosted by
|
21template< unsigned N, typename T> class ndArray
26 uint64_t multiplicity;
27 mutable uint64_t offset;
29 friend class ndArray<N+1,T>;
33 ndArray () { offset = 0; multiplicity = 1; }
37 { ndat = sz; next.multiplicity = multiplicity * ndat; return next; }
39 const ndArray<N-1,T>& operator[] (uint64_t idat) const
40 { next.offset = offset + idat * next.stride(); return next; }
42 ndArray<N-1,T>& operator[] (uint64_t idat)
43 { next.offset = offset + idat * next.stride(); return next; }
45 uint64_t stride () const { return ndat * next.stride(); }
46 uint64_t size () const { return ndat; }
54 uint64_t multiplicity;
55 mutable uint64_t offset;
57 friend class ndArray<2,T>;
62 ndArray () { offset = 0; multiplicity = 1; }
64 void operator* (uint64_t sz) { ndat = sz; data.resize (ndat * multiplicity); }
65 const T& operator[] (uint64_t idat) const { return data[offset + idat]; }
66 T& operator[] (uint64_t idat) { return data[offset + idat]; }
68 uint64_t stride () const { return ndat; }
69 uint64_t size () const { return ndat; }
An N-dimensional array of elements of type T, defined recursively. Definition ndArray.h:22
ndArray< N-1, T > & operator*(uint64_t sz) Set the dimension along this index. Definition ndArray.h:36
Generated using doxygen 1.14.0
|