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>
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;
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>
252 template<
class View,
int n,
class Val,
unsigned int a,
253 class Filter,
class Print>
261 (home,
x,vs,vsc,bf,vvp);
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>
322 return vsc->ngl(home,
b,
326 template<
class View,
int n,
class Val,
unsigned int a,
327 class Filter,
class Print>
331 std::ostream& o)
const {
338 vsc->print(home,
b,xi,pvc.
pos().
pos,pvc.
val(),o);
341 template<
class View,
int n,
class Val,
unsigned int a,
342 class Filter,
class Print>
345 if (vsc->notice() ||
f.notice() ||
p.notice())
352 template<
class View,
int n,
class Val,
unsigned int a>
virtual size_t dispose(Space &home)
Dispose.
virtual void cancel(Space &home, Propagator &p)
Cancel subscription for no-good literal.
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.
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.
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 void subscribe(Space &home, Propagator &p)
Create subscription for no-good literal.
virtual const Choice * choice(Space &home)
Return choice.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
virtual void archive(Archive &e) const
Archive into e.
Node * x
Pointer to corresponding Boolean expression node.
virtual void reschedule(Space &home, Propagator &p)
Schedule propagator p.
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
const int pos
Position of view.
void reschedule(Space &home, Propagator &p, IntSet &y)
Home class for posting propagators
Choice storing position and value
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.