46 template<
class _View,
class _Val>
53 typedef typename View::VarType
Var;
63 virtual Val
val(
const Space& home, View
x,
int i) = 0;
66 View
x,
int i, Val
n) = 0;
69 View
x, Val
n)
const = 0;
71 virtual void print(
const Space& home,
unsigned int a,
72 View
x,
int i,
const Val&
n,
73 std::ostream& o)
const = 0;
77 virtual bool notice(
void)
const = 0;
84 static void*
operator new(
size_t s,
Space& home);
87 static void operator delete(
void*
p,
Space& home);
89 static void operator delete(
void*
p);
94 template<
class ValSel,
class ValCommit>
115 virtual Val
val(
const Space& home, View
x,
int i);
120 View
x, Val
n)
const;
122 virtual void print(
const Space& home,
unsigned int a,
123 View
x,
int i,
const Val&
n,
124 std::ostream& o)
const;
128 virtual bool notice(
void)
const;
135 template<
class View,
class Val>
139 template<
class View,
class Val>
143 template<
class View,
class Val>
146 template<
class View,
class Val>
149 template<
class View,
class Val>
152 template<
class View,
class Val>
155 return home.ralloc(s);
161 template<
class ValSel,
class ValCommit>
167 template<
class ValSel,
class ValCommit>
172 s(home,shared,vsc.s),
c(home,shared,vsc.
c) {}
174 template<
class ValSel,
class ValCommit>
177 return s.
val(home,x,i);
180 template<
class ValSel,
class ValCommit>
184 return c.commit(home,a,x,i,n);
187 template<
class ValSel,
class ValCommit>
191 return c.ngl(home, a, x, n);
194 template<
class ValSel,
class ValCommit>
198 std::ostream& o)
const {
199 c.print(home,a,x,i,n,o);
202 template<
class ValSel,
class ValCommit>
208 template<
class ValSel,
class ValCommit>
214 template<
class ValSel,
class ValCommit>
virtual void dispose(Space &home)
Delete value selection.
ValSelCommitBase< typename ValSel::View, typename ValSel::Val >::Val Val
Class for value selection and commit.
bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
virtual ~ValSelCommitBase(void)
Unused destructor.
ValSelCommitBase< typename ValSel::View, typename ValSel::Val >::Var Var
ValCommit c
The commit object used.
int ModEvent
Type for modification events.
virtual void dispose(Space &home)=0
Delete value selection.
virtual void print(const Space &home, unsigned int a, View x, int i, const Val &n, std::ostream &o) const
Print on o branch for alternative a, view x at position i, and value n.
Base class for value selection and commit.
virtual Val val(const Space &home, View x, int i)
Return value of view x at position i.
Base class for value commit.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
virtual void print(const Space &home, unsigned int a, View x, int i, const Val &n, std::ostream &o) const =0
Print on o branch for alternative a, view x at position i, and value n.
ValSelCommit(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
void dispose(Space &home)
Delete value commit.
ValSel s
The value selection object used.
ValSelCommitBase(Space &home, const ValBranch< Var > &vb)
Constructor for initialization.
virtual ValSelCommit< ValSel, ValCommit > * copy(Space &home, bool shared)
Perform cloning.
virtual bool notice(void) const
Whether dispose must always be called (that is, notice is needed)
virtual ModEvent commit(Space &home, unsigned int a, View x, int i, Val n)=0
Commit view x at position i to value n for alternative a.
Value branching information.
ValSelCommitBase< typename ValSel::View, typename ValSel::Val >::View View
virtual NGL * ngl(Space &home, unsigned int a, View x, Val n) const =0
Create no-good literal for choice c and alternative a.
View::VarType Var
Corresponding variable type.
virtual ValSelCommitBase< View, Val > * copy(Space &home, bool shared)=0
Perform cloning.
Post propagator for SetVar x
virtual bool notice(void) const =0
Whether dispose must always be called (that is, notice is needed)
bool shared(const ConstView< ViewA > &, const ConstView< ViewB > &)
Test whether views share same variable.
Gecode toplevel namespace
virtual ModEvent commit(Space &home, unsigned int a, View x, int i, Val n)
Commit view x at position i to value n for alternative a.
virtual Val val(const Space &home, View x, int i)=0
Return value of view x at position i.
virtual NGL * ngl(Space &home, unsigned int a, View x, Val n) const
Create no-good literal for choice c and alternative a.
Base class for value selection.
No-good literal recorded during search.