66 const Pos&
pos(
void)
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()) {
145 home.notice(*this,AP_DISPOSE,true);
150 template<
class View,
class Filter,
int n>
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++)
164 if (!
x[i].assigned() &&
f(home,
x[i],i)) {
171 template<
class View,
class Filter,
int n>
174 assert(!
x[
start].assigned());
181 int* ties =
r.alloc<
int>(
x.size()-
start+1);
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);
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++)
virtual size_t dispose(Space &home)
Delete actor and return its size.
Base-class for branchers.
Brancher(Home home)
Constructor for creation.
Choice(const Brancher &b, const unsigned int a)
Initialize for particular brancher b and alternatives a.
virtual void archive(Archive &e) const
Archive into e.
Home class for posting propagators
virtual void archive(Archive &e) const
Archive into e.
const Pos & pos(void) const
Return position in array.
PosChoice(const PosChoice &c)
Initialize.
Pos(int p)
Create position information.
const int pos
Position of view.
Pos pos(Space &home)
Return position information.
ViewArray< View > x
Views to branch on.
ViewBrancher(Space &home, ViewBrancher< View, Filter, n > &b)
Constructor for cloning b.
View view(const Pos &p) const
Return view according to position information p.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
int start
Unassigned views start at x[start].
View::VarType Var
The corresponding variable.
ViewSel< View > * vs[n]
View selection objects.
virtual bool status(const Space &home) const
Check status of brancher, return true if alternatives left.
Abstract class for view selection.
virtual ViewSel< View > * copy(Space &home)=0
Create copy during cloning.
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
@ AP_DISPOSE
Actor must always be disposed.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
#define GECODE_VTABLE_EXPORT