38 #ifndef __GECODE_SEARCH_META_NO_GOODS_HH__
39 #define __GECODE_SEARCH_META_NO_GOODS_HH__
43 namespace Gecode {
namespace Search {
namespace Meta {
100 :
NGL(home,share,ngl) {}
111 while ((l != NULL) && l->
leaf()) {
113 notice = notice || l->
notice();
119 while (!notice && (l != NULL)) {
120 notice = notice || l->
notice();
130 assert(p.
root != NULL);
133 for (
NGL* pc = p.
root; pc != NULL; pc = pc->
next()) {
134 NGL*
n = pc->copy(home,shared);
147 int n =
std::min(p.ds.entries(),p.ngdl());
149 unsigned long int n_nogood = 0;
152 while ((n > s) && (p.ds[n-1].truealt() == 0U))
161 while ((s < n) && (p.ds[s].truealt() > 0U))
163 if (p.ds[s].rightmost()) {
165 home.
trycommit(*p.ds[s].choice(),p.ds[s].truealt());
169 for (
unsigned int a=0U;
a<p.ds[s].truealt();
a++) {
170 NGL*
l = home.
ngl(*p.ds[s].choice(),
a);
177 if (
NGL*
l = home.
ngl(*p.ds[s].choice(),p.ds[s].truealt())) {
191 ((n-s == 1) && (c != &nn)));
197 for (
int i=s;
i<
n;
i++) {
199 for (
unsigned int a=0U;
a<p.ds[
i].truealt();
a++) {
208 c = c->
add(l,
true); ll =
c;
212 if (
NGL*
l = home.
ngl(*p.ds[
i].choice(),p.ds[
i].truealt())) {
214 }
else if (!p.ds[
i].rightmost()) {
223 const_cast<Path&
>(
p).ng(n_nogood);
virtual void subscribe(Space &home, Propagator &p)=0
Subscribe propagator p to all views of the no-good literal.
virtual ExecStatus prune(Space &home)=0
Propagate the negation of the no-good literal.
NGL * next(void) const
Return pointer to next literal.
Actor must always be disposed.
long long int ll(int x)
Cast x into a long long int.
virtual bool notice(void) const
Whether dispose must always be called (returns false)
Status
The status of a no-good literal.
Base-class for propagators.
bool failed(void) const
Check whether space is failed.
Base-class for both propagators and branchers.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
const FloatNum min
Smallest allowed float value.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
Execution has resulted in failure.
ModEventDelta med
A set of modification events (used during propagation)
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
void trycommit(const Choice &c, unsigned int a, CommitStatistics &stat=unused_commit)
If possible, commit choice c for alternative a.
NGL * add(NGL *n, bool l)
Add node n and mark it as leaf l and return n.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Gecode toplevel namespace
bool leaf(void) const
Test whether literal is a leaf.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
NGL * ngl(const Choice &c, unsigned int a)
Create no-good literal for choice c and alternative a.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
No-good literal recorded during search.