58 const Val& val(
void)
const;
60 virtual size_t size(
void)
const;
62 virtual void archive(
Archive& e)
const;
67 template<
class View,
class Val, PropCond pc>
86 virtual size_t dispose(
Space& home);
96 template<
class View,
int n,
class Val,
unsigned int a,
97 class Filter,
class Print>
104 typedef typename View::VarType
Var;
135 std::ostream& o)
const;
139 virtual size_t dispose(
Space& home);
150 template<
class View,
int n,
class Val,
unsigned int a>
167 const Pos&
p,
const Val& n)
194 template<
class View,
class Val, PropCond pc>
197 :
NGL(home),
x(x0), n(n0) {}
199 template<
class View,
class Val, PropCond pc>
202 :
NGL(home,share,ngl), n(ngl.n) {
203 x.update(home,share,ngl.
x);
206 template<
class View,
class Val, PropCond pc>
209 x.subscribe(home,p,pc);
212 template<
class View,
class Val, PropCond pc>
218 template<
class View,
class Val, PropCond pc>
221 x.reschedule(home,p,pc);
224 template<
class View,
class Val, PropCond pc>
227 (void) NGL::dispose(home);
228 return sizeof(*this);
237 template<
class View,
int n,
class Val,
unsigned int a,
238 class Filter,
class Print>
247 :
ViewBrancher<View,Filter,n>(home,x,vs,bf), vsc(vsc0),
p(vvp) {
252 template<
class View,
int n,
class Val,
unsigned int a,
253 class Filter,
class Print>
264 template<
class View,
int n,
class Val,
unsigned int a,
265 class Filter,
class Print>
273 template<
class View,
int n,
class Val,
unsigned int a,
274 class Filter,
class Print>
281 template<
class View,
int n,
class Val,
unsigned int a,
282 class Filter,
class Print>
290 template<
class View,
int n,
class Val,
unsigned int a,
291 class Filter,
class Print>
301 template<
class View,
int n,
class Val,
unsigned int a,
302 class Filter,
class Print>
315 template<
class View,
int n,
class Val,
unsigned int a,
316 class Filter,
class Print>
326 template<
class View,
int n,
class Val,
unsigned int a,
327 class Filter,
class Print>
331 std::ostream& o)
const {
336 p(home,*
this,b,xi,pvc.
pos().pos,pvc.
val(),o);
341 template<
class View,
int n,
class Val,
unsigned int a,
342 class Filter,
class Print>
352 template<
class View,
int n,
class Val,
unsigned int a>
ViewValBrancher(Space &home, bool share, ViewValBrancher &b)
Constructor for cloning b.
void postviewvalbrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, BranchFilter< typename View::VarType > bf, VarValPrint< typename View::VarType, Val > vvp)
Post view value brancher.
Actor must always be disposed.
View::VarType Var
The corresponding variable.
Class withot a branch filter function.
void cancel(Space &home, Propagator &p, IntSet &y)
virtual size_t dispose(Space &home)
Delete brancher and return its size.
std::function< void(const Space &home, const Brancher &b, unsigned int a, Var x, int i, const Val &m, std::ostream &o)> VarValPrint
Function type for printing variable and value selection.
Generic brancher by view selection.
Base-class for propagators.
virtual void dispose(Space &home)=0
Delete value selection.
ViewArray< View > x
Views to branch on.
View view(const Pos &p) const
Return view according to position information p.
Class storing a print function.
const Pos & pos(void) const
Return position in array.
Class without print function.
Base-class for both propagators and branchers.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
ViewSel< View > * vs[n]
View selection objects.
Pos pos(Space &home)
Return position information.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
virtual NGL * ngl(Space &home, const Choice &c, unsigned int b) const
Create no-good literal for choice c and alternative b.
Base-class for branchers.
int n
Number of negative literals for node type.
Class storing a branch filter function.
virtual void print(const Space &home, unsigned int a, View x, int i, const Val &n, std::ostream &o) const =0
Print on o branch for alternative a, view x at position i, and value n.
Execution has resulted in failure.
Generic brancher by view and value selection.
virtual size_t size(void) const
Report size occupied.
void subscribe(Space &home, Propagator &p, IntSet &y)
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
unsigned int size(I &i)
Size of all ranges of range iterator i.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
static void post(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, BranchFilter< Var > bf, VarValPrint< Var, Val > vvp)
Brancher post function.
virtual void print(const Space &home, const Choice &c, unsigned int b, std::ostream &o) const
Print branch for choice c and alternative b.
const Val & val(void) const
Return value to branch with.
virtual const Choice * choice(Space &home)
Return choice.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
virtual ModEvent commit(Space &home, unsigned int a, View x, int i, Val n)=0
Commit view x at position i to value n for alternative a.
void print(std::basic_ostream< Char, Traits > &s, bool assigned, IL &lb, IU &ub, unsigned int cardMin, unsigned int cardMax)
Print set view.
virtual void archive(Archive &e) const
Archive into e.
Node * x
Pointer to corresponding Boolean expression node.
virtual NGL * ngl(Space &home, unsigned int a, View x, Val n) const =0
Create no-good literal for choice c and alternative a.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Choice for performing commit
Post propagator for SetVar x
ViewValNGL(Space &home, View x, Val n)
Initialize for propagator p with view x and value n.
View-value no-good literal.
virtual void archive(Archive &e) const
Archive into e.
virtual bool notice(void) const =0
Whether dispose must always be called (that is, notice is needed)
virtual Actor * copy(Space &home, bool share)
Perform cloning.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Gecode toplevel namespace
#define GECODE_VTABLE_EXPORT
void reschedule(Space &home, Propagator &p, IntSet &y)
Home class for posting propagators
Choice storing position and value
virtual Val val(const Space &home, View x, int i)=0
Return value of view x at position i.
PosValChoice(const Brancher &b, unsigned int a, const Pos &p, const Val &n)
Initialize choice for brancher b, number of alternatives a, position p, and value n...
bool me_failed(ModEvent me)
Check whether modification event me is failed.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
No-good literal recorded during search.