33#ifndef MADNESS_MRA_INDEXIT_H__INCLUDED
34#define MADNESS_MRA_INDEXIT_H__INCLUDED
70 n(limits.size()),
i(limits.size(), 0l),
finished(false) {
71 for (
unsigned int d = 0;
d <
n.size(); ++
d)
78 for (
unsigned int d = 0;
d <
n.size(); ++
d)
91 for (
unsigned int d = 0;
d <
n.size(); ++
d)
103 const std::vector<long>&
109 operator bool()
const {
116 for (
int d =
n.size() - 1;
d >= 0; --
d) {
165 for (
int d =
n.size() - 1;
d >= 0; --
d) {
205 for (
int d = 0;
d < ndim; ++
d) {
242 template<
typename V,
typename D>
245 int i, j, ndim = order.size();
248 for(
i = 0;
i < ndim; ++
i) {
252 for(j = 0; j <
i; ++j)
268 for(
i = 0;
i < ndim; ++
i) {
272 for(j = 0; j <
i; ++j)
290 for(
i = 0;
i < ndim; ++
i) {
294 for(j = 0; j <
i; ++j)
310 for(
i = 0;
i < ndim; ++
i) {
314 for(j = 0; j <
i; ++j)
327 for (
int d = 0;
d < ndim; ++
d) {
HighDimIndexIterator()
Bury the default constructor.
Definition indexit.h:145
virtual ~HighDimIndexIterator()
Definition indexit.h:159
virtual IndexIterator & operator++()
Definition indexit.h:164
HighDimIndexIterator(int ndim, const long limits[])
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition indexit.h:153
HighDimIndexIterator(int ndim, long top)
Iterates all dimensions from 0 to top-1 inclusive.
Definition indexit.h:157
HighDimIndexIterator(const V &limits)
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition indexit.h:150
virtual IndexIterator & operator++()
this function should be abstracted and deprecated
Definition indexit.h:115
bool finished
Definition indexit.h:64
IndexIterator(int ndim, const long limits[])
Iterates dimension d from 0 to limits[d]-1 inclusive.
Definition indexit.h:76
static void test()
this function should also be deprecated
Definition indexit.h:129
std::vector< long > i
Current index.
Definition indexit.h:63
virtual ~IndexIterator()
Definition indexit.h:87
long operator[](int d) const
Definition indexit.h:98
IndexIterator & reset()
Definition indexit.h:90
std::vector< long > n
User specified upper limits for each dimension.
Definition indexit.h:62
IndexIterator()
Bury the default constructor.
Definition indexit.h:59
IndexIterator(const V &limits)
Iterates dimension d from 0 to limits[d]-1 inclusive.
Definition indexit.h:69
IndexIterator(int ndim, long top)
Iterates all dimensions from 0 to top-1 inclusive.
Definition indexit.h:83
const std::vector< long > & operator*() const
Definition indexit.h:104
virtual IndexIterator & operator++()
Definition indexit.h:203
LowDimIndexIterator(int ndim, const long limits[])
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition indexit.h:192
virtual ~LowDimIndexIterator()
Definition indexit.h:198
LowDimIndexIterator()
Bury the default constructor.
Definition indexit.h:184
LowDimIndexIterator(const V &limits)
Iterates dimension d from 0 to limts[d]-1 inclusive.
Definition indexit.h:189
LowDimIndexIterator(int ndim, long top)
Iterates all dimensions from 0 to top-1 inclusive.
Definition indexit.h:196
std::vector< int > dim
Definition indexit.h:234
NonstandardIndexIterator(const V &limits, const D &order)
Definition indexit.h:243
NonstandardIndexIterator(int ndim, long top, const D &order)
Definition indexit.h:285
virtual IndexIterator & operator++()
increment the dimensions in the order detailed in dim
Definition indexit.h:325
virtual ~NonstandardIndexIterator()
Definition indexit.h:321
NonstandardIndexIterator(int ndim, long top, const int order[])
Definition indexit.h:306
NonstandardIndexIterator(int ndim, const long limits[], const int order[])
Definition indexit.h:264
NonstandardIndexIterator()
Bury the default constructor.
Definition indexit.h:228
A simple, fixed dimension vector.
Definition vector.h:64
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Namespace for all elements and tools of MADNESS.
Definition DFConvergence.h:9
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:227
static const double d
Definition nonlinschro.cc:121
Defines simple templates for printing to std::cout "a la Python".
Definition test_ar.cc:204
static double V(const coordT &r)
Definition tdse.cc:288
Implement the madness:Vector class, an extension of std::array that supports some mathematical operat...