38 #ifndef __GECODE_SEARCH_META_NO_GOODS_HH__ 39 #define __GECODE_SEARCH_META_NO_GOODS_HH__ 43 namespace Gecode {
namespace Search {
namespace Meta {
65 virtual NGL* copy(
Space& home,
bool share);
92 virtual size_t dispose(
Space& home);
104 :
NGL(home,share,ngl) {}
115 while ((l != NULL) && l->
leaf()) {
117 notice = notice || l->
notice();
123 while (!notice && (l != NULL)) {
124 notice = notice || l->
notice();
134 assert(p.
root != NULL);
137 for (
NGL* pc = p.
root; pc != NULL; pc = pc->
next()) {
138 NGL*
n = pc->copy(home,shared);
151 int n =
std::min(p.ds.entries(),
static_cast<int>(p.ngdl()));
153 unsigned long int n_nogood = 0;
156 while ((n > s) && (p.ds[n-1].truealt() == 0U))
165 while ((s < n) && (p.ds[s].truealt() > 0U))
167 if (p.ds[s].rightmost()) {
169 home.
trycommit(*p.ds[s].choice(),p.ds[s].truealt());
173 for (
unsigned int a=0U;
a<p.ds[s].truealt();
a++) {
174 NGL*
l = home.
ngl(*p.ds[s].choice(),
a);
181 if (
NGL*
l = home.
ngl(*p.ds[s].choice(),p.ds[s].truealt())) {
195 ((n-s == 1) && (c != &nn)));
201 for (
int i=s;
i<
n;
i++) {
203 for (
unsigned int a=0U;
a<p.ds[
i].truealt();
a++) {
212 c = c->
add(l,
true); ll =
c;
216 if (
NGL*
l = home.
ngl(*p.ds[
i].choice(),p.ds[
i].truealt())) {
218 }
else if (!p.ds[
i].rightmost()) {
227 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.
#define GECODE_SEARCH_EXPORT
Actor must always be disposed.
void cancel(Space &home, Propagator &p, IntSet &y)
long long int ll(int x)
Cast x into a long long int.
Status
The status of a no-good literal.
Base-class for propagators.
ExecStatus prune(Space &home, ViewArray< VX > &x, ConstIntView)
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.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
bool leaf(void) const
Test whether literal is a leaf.
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.
void subscribe(Space &home, Propagator &p, IntSet &y)
bool failed(void) const
Check whether space is failed.
NGL * next(void) const
Return pointer to next literal.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
virtual bool notice(void) const
Whether dispose must always be called (returns false)
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
#define GECODE_VTABLE_EXPORT
void reschedule(Space &home, Propagator &p, IntSet &y)
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.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
No-good literal recorded during search.