16template<
unsigned N>
class ndIndex
20 mutable uint64_t offset;
22 friend class ndIndex<N+1>;
25 ndIndex () { offset = 0; }
27 ndIndex<N-1>& operator* (uint64_t sz) { ndat = sz;
return next; }
29 const ndIndex<N-1>& operator[] (uint64_t idat)
const
30 { next.offset = offset + idat * next.stride();
return next; }
32 uint64_t stride ()
const {
return ndat * next.stride(); }
39 mutable uint64_t offset;
41 friend class ndIndex<2>;
44 ndIndex () { offset = 0; }
45 void operator* (uint64_t sz) { ndat = sz; }
46 uint64_t operator[] (uint64_t idat)
const {
return offset + idat; }
47 uint64_t stride ()
const {
return ndat; }