42 namespace Gecode {
namespace Int {
86 for (
int i = n;
i--; ) {
87 xs[
i].idx =
i; xs[
i].view = xa[
i];
116 assert((i >= 0) && (i <
size()));
123 assert((i >= 0) && (i <
size()));
131 for (
int i =
n;
i--; )
132 xs[
i].view.subscribe(home,p,pc,process);
138 for (
int i =
n;
i--; )
139 xs[
i].view.cancel(home,p,pc);
148 for (
int i=
n;
i--; ) {
149 xs[
i].idx = a[
i].idx;
150 xs[
i].view.
update(home,share,a[
i].view);
156 template<
class Char,
class Traits,
class View>
157 std::basic_ostream<Char,Traits>&
158 operator <<(std::basic_ostream<Char,Traits>& os,
160 std::basic_ostringstream<Char,Traits> s;
161 s.copyfmt(os); s.width(0);
164 s <<
x[0].idx <<
':' <<
x[0].view;
165 for (
int i=1;
i<
x.size();
i++)
166 s <<
", " <<
x[
i].idx <<
':' <<
x[
i].view;
169 return os << s.str();
IdxView< View > & operator[](int n)
Access element n.
Base-class for propagators.
static IdxView * allocate(Space &home, int n)
Allocate memory for n index-view pairs.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from space heap.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
void cancel(Space &home, Propagator &p, PropCond pc)
int PropCond
Type for propagation conditions.
unsigned int size(I &i)
Size of all ranges of range iterator i.
struct Gecode::@519::NNF::@60::@62 a
For atomic nodes.
Passing integer variables.
Passing Boolean variables.
Integer view for integer variables.
Node * x
Pointer to corresponding Boolean expression node.
void subscribe(Space &home, Propagator &p, PropCond pc, bool process=true)
IdxViewArray(void)
Default constructor.
An array of IdxView pairs.
Gecode toplevel namespace
Class to map VarArg type to view.
Class for pair of index and view.
int size(void) const
Return the current size.
void update(Space &home, bool share, IdxViewArray< View > &x)
Cloning.
Boolean view for Boolean variables.