33 #ifndef MADNESS_MRA_INDEXIT_H__INCLUDED
34 #define MADNESS_MRA_INDEXIT_H__INCLUDED
69 n(limits.size()), i(limits.size(), 0), finished(false) {
70 for (
unsigned int d = 0; d < n.size(); ++d)
76 n(ndim), i(ndim, 0), finished(false) {
77 for (
unsigned int d = 0; d < n.size(); ++d)
83 n(ndim,top), i(ndim, 0), finished(false) {
90 for (
unsigned int d = 0; d < n.size(); ++d)
98 MADNESS_ASSERT(!finished);
102 const std::vector<long>&
104 MADNESS_ASSERT(!finished);
108 operator bool()
const {
115 for (
int d = n.size() - 1; d >= 0; --d) {
164 for (
int d =
n.size() - 1; d >= 0; --d) {
204 for (
int d = 0; d < ndim; ++d) {
241 template<
typename V,
typename D>
244 int i, j, ndim = order.size();
246 MADNESS_ASSERT(limits.size() == ndim);
247 for(i = 0; i < ndim; ++
i) {
248 MADNESS_ASSERT(order[i] >= 0 && order[i] < ndim);
251 for(j = 0; j <
i; ++j)
252 MADNESS_ASSERT(order[i] != order[j]);
267 for(i = 0; i < ndim; ++
i) {
268 MADNESS_ASSERT(order[i] >= 0 && order[i] < ndim);
271 for(j = 0; j <
i; ++j)
272 MADNESS_ASSERT(order[i] != order[j]);
288 MADNESS_ASSERT(order.size() == ndim);
289 for(i = 0; i < ndim; ++
i) {
290 MADNESS_ASSERT(order[i] >= 0 && order[i] < ndim);
293 for(j = 0; j <
i; ++j)
294 MADNESS_ASSERT(order[i] != order[j]);
309 for(i = 0; i < ndim; ++
i) {
310 MADNESS_ASSERT(order[i] >= 0 && order[i] < ndim);
313 for(j = 0; j <
i; ++j)
314 MADNESS_ASSERT(order[i] != order[j]);
326 for (
int d = 0; d < ndim; ++d) {
328 if (
i[dim[d]] <
n[dim[d]])
339 #endif // MADNESS_MRA_INDEXIT_H__INCLUDED
virtual ~LowDimIndexIterator()
Definition: indexit.h:197
IndexIterator(int ndim, long top)
Iterates all dimensions from 0 to top-1 inclusive.
Definition: indexit.h:82
IndexIterator & reset()
Definition: indexit.h:89
NonstandardIndexIterator(int ndim, const long limits[], const int order[])
Definition: indexit.h:263
NonstandardIndexIterator(int ndim, long top, const D &order)
Definition: indexit.h:284
HighDimIndexIterator(const V &limits)
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition: indexit.h:149
A simple, fixed dimension Coordinate.
Definition: array.h:99
bool finished
Definition: indexit.h:63
std::vector< long > i
Current index.
Definition: indexit.h:62
LowDimIndexIterator(const V &limits)
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition: indexit.h:188
Definition: indexit.h:180
LowDimIndexIterator(int ndim, long top)
Iterates all dimensions from 0 to top-1 inclusive.
Definition: indexit.h:195
IndexIterator(const V &limits)
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition: indexit.h:68
double V(const Vector< double, 3 > &r)
Definition: apps/ii/hatom_energy.cc:46
HighDimIndexIterator(int ndim, const long limits[])
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition: indexit.h:152
LowDimIndexIterator(int ndim, const long limits[])
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition: indexit.h:191
virtual IndexIterator & operator++()
increment the dimensions in the order detailed in dim
Definition: indexit.h:324
virtual ~IndexIterator()
Definition: indexit.h:86
NonstandardIndexIterator(const V &limits, const D &order)
Definition: indexit.h:242
std::vector< int > dim
Definition: indexit.h:233
virtual IndexIterator & operator++()
Definition: indexit.h:163
std::vector< long > n
User specified upper limits for each dimension.
Definition: indexit.h:61
virtual ~NonstandardIndexIterator()
Definition: indexit.h:320
HighDimIndexIterator(int ndim, long top)
Iterates all dimensions from 0 to top-1 inclusive.
Definition: indexit.h:156
NonstandardIndexIterator(int ndim, long top, const int order[])
Definition: indexit.h:305
Definition: indexit.h:224
virtual IndexIterator & operator++()
Definition: indexit.h:202
Defines simple templates for printing to std::cout "a la Python".
virtual IndexIterator & operator++()
this function should be abstracted and deprecated
Definition: indexit.h:114
long operator[](int d) const
Definition: indexit.h:97
const std::vector< long > & operator*() const
Definition: indexit.h:103
IndexIterator(int ndim, const long limits[])
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition: indexit.h:75
void print(const A &a)
Print a single item to std::cout terminating with new line.
Definition: print.h:122
virtual ~HighDimIndexIterator()
Definition: indexit.h:158
static void test()
this function should also be deprecated
Definition: indexit.h:128
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
Definition: indexit.h:141