20 #ifndef OST_MM_INDEX_HH
21 #define OST_MM_INDEX_HH
31 namespace ost {
namespace mol{
namespace mm{
39 memcpy(data_, rhs.data_,
sizeof(
uint[D]));
42 memset(data_, 0,
sizeof(
uint[D]));
46 memcpy(data_, rhs.data_,
sizeof(
uint[D]));
58 inline bool operator < (const IndexBase<D>& rhs)
const{
59 return std::lexicographical_compare(data_, data_+D, rhs.data_, rhs.data_+D);
63 return std::equal(data_,data_+D,rhs.data_);
67 return !(*
this == rhs);
82 Index() : impl::IndexBase<1>() {}
86 template <
typename DS>
94 Index() : impl::IndexBase<2>() {}
99 template <
typename DS>
114 template <
typename DS>
131 template <
typename DS>
150 template <
typename DS>
171 template <
typename DS>
194 template <
typename DS>
210 : start_(s), end_(e), current_(s) {
216 while (++current_[current_it] > end_[current_it]) {
218 if (current_it < D) {
219 current_[current_it-1] = start_[current_it-1];
230 return current_[D-1] > end_[D-1];
uint & operator[](uint idx)
Index(uint a, uint b, uint c, uint d)
IndexIterator< D > & operator++()
uint operator[](uint idx) const
const IndexType & operator*() const
IndexBase(const IndexBase &rhs)
Index(uint a, uint b, uint c, uint d, uint e, uint f)
Index(uint a, uint b, uint c, uint d, uint e, uint f, uint g)
Index(uint a, uint b, uint c)
IndexIterator(const IndexType &s, const IndexType &e)
Index(uint a, uint b, uint c, uint d, uint e)
IndexBase & operator=(const IndexBase &rhs)
bool operator!=(const IndexBase< D > &rhs) const
bool operator==(const IndexBase< D > &rhs) const