88 for (
int i=0; i<n; i++) {
89 xs[i].idx = i; xs[i].view = xa[i];
118 assert((i >= 0) && (i <
size()));
125 assert((i >= 0) && (i <
size()));
133 for (
int i=0; i<n; i++)
134 xs[i].view.subscribe(home,p,pc,process);
140 for (
int i=0; i<n; i++)
141 xs[i].view.cancel(home,p,pc);
147 for (
int i=0; i<n; i++)
148 xs[i].view.reschedule(home,p,pc);
157 for (
int i=0; i<n; i++) {
158 xs[i].idx = a[i].idx;
159 xs[i].view.update(home,a[i].view);
165 template<
class Char,
class Traits,
class View>
166 std::basic_ostream<Char,Traits>&
169 std::basic_ostringstream<Char,Traits> s;
170 s.copyfmt(os); s.width(0);
173 s <<
x[0].idx <<
':' <<
x[0].view;
174 for (
int i=1; i<
x.size(); i++)
175 s <<
", " <<
x[i].idx <<
':' <<
x[i].view;
178 return os << s.str();
Passing Boolean variables.
FloatNum size(void) const
Return size of float value (distance between maximum and minimum)
Passing integer variables.
Boolean view for Boolean variables.
An array of IdxView pairs.
IdxView< View > & operator[](int n)
Access element n.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
void reschedule(Space &home, Propagator &p, PropCond pc)
Schedule propagator p.
IdxViewArray(void)
Default constructor.
void update(Space &home, IdxViewArray< View > &x)
Cloning.
void cancel(Space &home, Propagator &p, PropCond pc)
int size(void) const
Return the current size.
Class for pair of index and view.
static IdxView * allocate(Space &home, int n)
Allocate memory for n index-view pairs.
Integer view for integer variables.
Class to map VarArg type to view.
Base-class for propagators.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
std::basic_ostream< Char, Traits > & operator<<(std::basic_ostream< Char, Traits > &os, const IdxViewArray< View > &x)
Gecode toplevel namespace
int PropCond
Type for propagation conditions.
Post propagator for SetVar x