40 namespace Gecode {
namespace Iter {
namespace Ranges {
52 template<
class Val,
class UnsVal,
class I>
71 void init(I& i,
int a);
89 UnsVal
width(
void)
const;
113 void init(I& i,
int a);
125 template<
class Val,
class UnsVal,
class I>
129 template<
class Val,
class UnsVal,
class I>
142 template<
class Val,
class UnsVal,
class I>
154 template<
class Val,
class UnsVal,
class I>
170 template<
class Val,
class UnsVal,
class I>
173 return (
a == 1) ?
i() : (cur <= end);
176 template<
class Val,
class UnsVal,
class I>
179 return (
a == 1) ?
static_cast<Val
>(
i.min()) : cur;
181 template<
class Val,
class UnsVal,
class I>
184 return (
a == 1) ?
static_cast<Val
>(
i.max()) : cur;
186 template<
class Val,
class UnsVal,
class I>
190 static_cast<UnsVal
>(
i.width()) :
191 static_cast<UnsVal>(1);
200 while ((mi > ma) &&
i()) {
201 mi =
static_cast<int>(ceil(static_cast<double>(
i.min())/
a));
202 ma =
static_cast<int>(floor(static_cast<double>(
i.max())/
a));
206 int n_mi =
static_cast<int>(ceil(static_cast<double>(
i.min())/
a));
209 int n_ma =
static_cast<int>(floor(static_cast<double>(
i.max())/
a));
UnsVal width(void) const
Return width of range (distance between minimum and maximum)
Val max(void) const
Return largest value of range.
Base for range iterators with explicit min and max.
Val cur
Current value of range.
Val end
Last value of scaled range of i.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Range iterator for pointwise product with a positive integer.
Range iterator for pointwise division by a positive integer.
ScaleUp(void)
Default constructor.
void init(I &i, int a)
Initialize with ranges from i and scale factor a.
void init(I &i, int a)
Initialize with ranges from i and scale factor a.
bool operator()(void) const
Test whether iterator is still at a range or done.
I i
Iterator to be scaled.
int a
Divide by this factor.
Gecode toplevel namespace
ScaleDown(void)
Default constructor.
Val min(void) const
Return smallest value of range.
I i
Iterator to be scaled down.
void operator++(void)
Move iterator to next range (if possible)
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
void operator++(void)
Move iterator to next range (if possible)