65 const Pos&
pos(
void)
const;
67 virtual size_t size(
void)
const;
69 virtual void archive(
Archive& e)
const;
78 template<
class View,
int n>
138 template<
class View,
int n>
142 :
Brancher(home),
x(x0), start(0), bf(bf0) {
143 for (
int i=0;
i<
n;
i++)
145 for (
int i=0;
i<
n;
i++)
146 if (
vs[
i]->notice()) {
152 template<
class View,
int n>
156 :
Brancher(home,shared,vb), start(vb.start), bf(vb.bf) {
157 x.update(home,shared,vb.
x);
158 for (
int i=0;
i<
n;
i++)
162 template<
class View,
int n>
166 for (
int i=start;
i <
x.size();
i++)
172 for (
int i=start;
i <
x.size();
i++) {
173 typename View::VarType y(
x[
i].varimp());
183 template<
class View,
int n>
190 s = vs[0]->select(home,
x,start);
193 int* ties = r.
alloc<
int>(
x.size()-start+1);
195 vs[0]->ties(home,
x,start,ties,n_ties);
196 for (
int i=1; (
i <
n-1) && (n_ties > 1);
i++)
197 vs[
i]->brk(home,
x,ties,n_ties);
199 s = vs[
n-1]->select(home,
x,ties,n_ties);
205 s = vs[0]->select(home,
x,start,bf);
208 int* ties = r.
alloc<
int>(
x.size()-start+1);
210 vs[0]->ties(home,
x,start,ties,n_ties,bf);
211 for (
int i=1; (
i <
n-1) && (n_ties > 1);
i++)
212 vs[
i]->brk(home,
x,ties,n_ties);
214 s = vs[
n-1]->select(home,
x,ties,n_ties);
223 template<
class View,
int n>
229 template<
class View,
int n>
232 for (
int i=0;
i<
n;
i++)
233 if (vs[
i]->notice()) {
237 for (
int i=0;
i<
n;
i++)
238 vs[
i]->dispose(home);
const Pos & pos(void) const
Return position in array.
BranchFilter bf
Branch filter function.
Actor must always be disposed.
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
BranchTraits< typename View::VarType >::Filter BranchFilter
The branch filter that corresponds to the var type.
Generic brancher by view selection.
bool pos(const View &x)
Test whether x is postive.
ViewBrancher(Space &home, bool shared, ViewBrancher< View, n > &b)
Constructor for cloning b.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
Pos pos(Space &home)
Return position information.
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.
ViewSel< View > * vs[n]
View selection objects.
View view(const Pos &p) const
Return view according to position information p.
virtual void archive(Archive &e) const
Archive into e.
unsigned int size(I &i)
Size of all ranges of range iterator i.
PosChoice(const Brancher &b, unsigned int a, const Pos &p)
Initialize choice for brancher b, number of alternatives a, and position p.
virtual size_t size(void) const
Report size occupied.
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
virtual void archive(Archive &e) const
Archive into e.
Pos(int p)
Create position information.
Node * x
Pointer to corresponding Boolean expression node.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Choice for performing commit
virtual size_t dispose(Space &home)
Delete actor and return its size.
bool assigned(View x, int v)
Whether x is assigned to value v.
int start
Unassigned views start at x[start].
virtual bool status(const Space &home) const
Check status of brancher, return true if alternatives left.
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
#define GECODE_VTABLE_EXPORT
const int pos
Position of view.
ViewArray< View > x
Views to branch on.
virtual ViewSel< View > * copy(Space &home, bool shared)=0
Create copy during cloning.
Home class for posting propagators
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.