65 const Pos&
pos(
void)
const;
67 virtual size_t size(
void)
const;
69 virtual void archive(
Archive& e)
const;
78 template<
class View,
class Filter,
int n>
82 typedef typename View::VarType
Var;
94 View view(
const Pos&
p)
const;
102 virtual bool status(
const Space& home)
const;
104 virtual size_t dispose(
Space& home);
138 template<
class View,
class Filter,
int n>
144 for (
int i=0;
i<
n;
i++)
146 for (
int i=0;
i<
n;
i++)
147 if (
f.notice() || vs[
i]->notice()) {
153 template<
class View,
class Filter,
int n>
157 :
Brancher(home,shared,vb), start(vb.start),
158 f(home,shared,vb.
f) {
159 x.update(home,shared,vb.
x);
160 for (
int i=0;
i<
n;
i++)
161 vs[
i] = vb.
vs[
i]->
copy(home,shared);
164 template<
class View,
class Filter,
int n>
167 for (
int i=start;
i <
x.size();
i++)
175 template<
class View,
class Filter,
int n>
182 s = vs[0]->select(home,
x,start,
f);
185 int* ties = r.
alloc<
int>(
x.size()-start+1);
187 vs[0]->ties(home,
x,start,ties,n_ties,
f);
188 for (
int i=1; (
i <
n-1) && (n_ties > 1);
i++)
189 vs[
i]->brk(home,
x,ties,n_ties);
191 s = vs[
n-1]->select(home,
x,ties,n_ties);
197 s = vs[0]->select(home,
x,start);
200 int* ties = r.
alloc<
int>(
x.size()-start+1);
202 vs[0]->ties(home,
x,start,ties,n_ties);
203 for (
int i=1; (
i <
n-1) && (n_ties > 1);
i++)
204 vs[
i]->brk(home,
x,ties,n_ties);
206 s = vs[
n-1]->select(home,
x,ties,n_ties);
215 template<
class View,
class Filter,
int n>
221 template<
class View,
class Filter,
int n>
224 for (
int i=0;
i<
n;
i++)
225 if (
f.notice() || vs[
i]->notice()) {
229 for (
int i=0;
i<
n;
i++)
230 vs[
i]->dispose(home);
231 (void) Brancher::dispose(home);
Actor must always be disposed.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
ViewBrancher(Space &home, bool shared, ViewBrancher< View, Filter, n > &b)
Constructor for cloning b.
Generic brancher by view selection.
bool pos(const View &x)
Test whether x is postive.
ViewArray< View > x
Views to branch on.
const Pos & pos(void) const
Return position in array.
bool shared(const IntSet &, VX)
ViewSel< View > * vs[n]
View selection objects.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
int n
Number of negative literals for node type.
int start
Unassigned views start at x[start].
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
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)
PosChoice(const Brancher &b, unsigned int a, const Pos &p)
Initialize choice for brancher b, number of alternatives a, and position p.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Pos(int p)
Create position information.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Node * x
Pointer to corresponding Boolean expression node.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
virtual void archive(Archive &e) const
Archive into e.
Choice for performing commit
bool assigned(View x, int v)
Whether x is assigned to value v.
View::VarType Var
The corresponding variable.
Post propagator for SetVar x
virtual void archive(Archive &e) const
Archive into e.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
virtual size_t size(void) const
Report size occupied.
Gecode toplevel namespace
#define GECODE_VTABLE_EXPORT
const int pos
Position of view.
virtual ViewSel< View > * copy(Space &home, bool shared)=0
Create copy during cloning.
Home class for posting propagators