48 template<
class Val,
class UnsVal,
class I>
121 template<
class Val,
class UnsVal,
class I>
125 template<
class Val,
class UnsVal,
class I>
138 template<
class Val,
class UnsVal,
class I>
150 template<
class Val,
class UnsVal,
class I>
166 template<
class Val,
class UnsVal,
class I>
169 return (
a == 1) ?
i() : (
cur <=
end);
172 template<
class Val,
class UnsVal,
class I>
175 return (
a == 1) ?
static_cast<Val>(
i.min()) :
cur;
177 template<
class Val,
class UnsVal,
class I>
180 return (
a == 1) ?
static_cast<Val>(
i.max()) :
cur;
182 template<
class Val,
class UnsVal,
class I>
186 static_cast<UnsVal
>(
i.width()) :
187 static_cast<UnsVal
>(1);
196 while ((
mi >
ma) &&
i()) {
197 mi =
static_cast<int>(ceil(
static_cast<double>(
i.min())/
a));
198 ma =
static_cast<int>(floor(
static_cast<double>(
i.max())/
a));
202 int n_mi =
static_cast<int>(ceil(
static_cast<double>(
i.min())/
a));
205 int n_ma =
static_cast<int>(floor(
static_cast<double>(
i.max())/
a));
int ma
Maximum of current range.
int mi
Minimum of current range.
MinMax(void)
Default constructor.
void finish(void)
Set range such that iteration stops
void operator++(void)
Move iterator to next range (if possible)
int a
Divide by this factor.
I i
Iterator to be scaled down.
void init(I &i, int a)
Initialize with ranges from i and scale factor a.
ScaleDown(void)
Default constructor.
void operator++(void)
Move iterator to next range (if possible)
bool operator()(void) const
Test whether iterator is still at a range or done.
Val max(void) const
Return largest value of range.
ScaleUp(void)
Default constructor.
UnsVal width(void) const
Return width of range (distance between minimum and maximum)
Val end
Last value of scaled range of i.
Val min(void) const
Return smallest value of range.
Val cur
Current value of range.
I i
Iterator to be scaled.
void init(I &i, int a)
Initialize with ranges from i and scale factor a.
Range and value iterators.
Gecode toplevel namespace