Go to the documentation of this file.
66 const Pos&
pos(
void)
const;
68 virtual void archive(
Archive& e)
const;
77 template<
class View,
class Filter,
int n>
81 typedef typename View::VarType
Var;
135 template<
class View,
class Filter,
int n>
141 for (
int i=0;
i<
n;
i++)
143 for (
int i=0;
i<
n;
i++)
144 if (
f.notice() || vs[
i]->notice()) {
150 template<
class View,
class Filter,
int n>
154 :
Brancher(home,vb), start(vb.start),
f(vb.
f) {
156 for (
int i=0;
i<
n;
i++)
160 template<
class View,
class Filter,
int n>
163 for (
int i=start;
i <
x.size();
i++)
171 template<
class View,
class Filter,
int n>
178 s = vs[0]->select(home,
x,start,
f);
181 int* ties =
r.alloc<
int>(
x.size()-start+1);
183 vs[0]->ties(home,
x,start,ties,n_ties,
f);
184 for (
int i=1; (
i <
n-1) && (n_ties > 1);
i++)
185 vs[
i]->brk(home,
x,ties,n_ties);
187 s = vs[
n-1]->select(home,
x,ties,n_ties);
193 s = vs[0]->select(home,
x,start);
196 int* ties =
r.alloc<
int>(
x.size()-start+1);
198 vs[0]->ties(home,
x,start,ties,n_ties);
199 for (
int i=1; (
i <
n-1) && (n_ties > 1);
i++)
200 vs[
i]->brk(home,
x,ties,n_ties);
202 s = vs[
n-1]->select(home,
x,ties,n_ties);
211 template<
class View,
class Filter,
int n>
217 template<
class View,
class Filter,
int n>
220 for (
int i=0;
i<
n;
i++)
221 if (
f.notice() || vs[
i]->notice()) {
225 for (
int i=0;
i<
n;
i++)
226 vs[
i]->dispose(home);
227 (void) Brancher::dispose(home);
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Post propagator for SetVar x
#define GECODE_VTABLE_EXPORT
bool assigned(View x, int v)
Whether x is assigned to value v.
Pos pos(Space &home)
Return position information.
const int pos
Position of view.
int start
Unassigned views start at x[start].
ViewArray< View > x
Views to branch on.
virtual void archive(Archive &e) const
Archive into e.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
Gecode toplevel namespace
Generic brancher by view selection.
ViewSel< View > * vs[n]
View selection objects.
PosChoice(const PosChoice &c)
Initialize.
View::VarType Var
The corresponding variable.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Node * x
Pointer to corresponding Boolean expression node.
Base-class for branchers.
Home class for posting propagators
Actor must always be disposed.
View view(const Pos &p) const
Return view according to position information p.
ViewBrancher(Space &home, ViewBrancher< View, Filter, n > &b)
Constructor for cloning b.
virtual ViewSel< View > * copy(Space &home)=0
Create copy during cloning.
Pos(int p)
Create position information.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Post propagator for f(x \diamond_{\mathit{op}} y) \sim_r z \f$ void rel(Home home
Gecode::FloatVal c(-8, 8)
virtual bool status(const Space &home) const
Check status of brancher, return true if alternatives left.
int n
Number of negative literals for node type.
Choice for performing commit
Gecode::IntArgs i({1, 2, 3, 4})
bool pos(const View &x)
Test whether x is postive.
int p
Number of positive literals for node type.
virtual void archive(Archive &e) const
Archive into e.
const Pos & pos(void) const
Return position in array.