34#ifndef __FLATZINC_LASTVAL_HH__
35#define __FLATZINC_LASTVAL_HH__
41#ifdef GECODE_HAS_SET_VARS
45#ifdef GECODE_HAS_FLOAT_VARS
51#ifdef GECODE_HAS_FLOAT_VARS
66 template<
class View,
class SetLastVal>
79 for (
int i = 0; i <
x.size(); ++i) {
80 SetLastVal::init_last_val(home,
x[i].idx,
x[i].view);
87 for (
int i = n; i--; ) {
88 if (
x[i].view.assigned()) {
89 SetLastVal::set_last_val(home,
x[i].idx,
x[i].view);
118 (void)
new (home)
LastVal(home, ix);
146#ifdef GECODE_HAS_FLOAT_VARS
159#ifdef GECODE_HAS_SET_VARS
A space that can be initialized with a FlatZinc model.
OnRestartHandle restart_data
virtual Actor * copy(Space &home)
Copy propagator during cloning.
IdxViewArray< IntView > x
virtual PropCost cost(const Space &, const ModEventDelta &) const
Cost function.
LastVal(FlatZincSpace &home, IdxViewArray< View > x0)
Constructor for posting.
virtual ExecStatus propagate(Space &home, const ModEventDelta &)
Perform propagation.
virtual void reschedule(Space &home)
Schedule function.
static ExecStatus post(FlatZincSpace &home, const typename ViewToVarArg< View >::argtype &x)
Post propagator.
LastVal(Space &home, LastVal &p)
Constructor for cloning p.
static void record_assigned(FlatZincSpace &home, IdxViewArray< View > &x)
Record (and forget) the values of any assigned views in x in the right position in last_val.
static void set_last_val(FlatZincSpace &home, size_t idx, BoolView &var)
static void init_last_val(FlatZincSpace &home, size_t idx, BoolView &var)
static void set_last_val(FlatZincSpace &home, size_t idx, Float::FloatView &var)
static void init_last_val(FlatZincSpace &home, size_t idx, Float::FloatView &var)
static void set_last_val(FlatZincSpace &home, size_t idx, IntView &var)
static void init_last_val(FlatZincSpace &home, size_t idx, IntView &var)
static void set_last_val(FlatZincSpace &home, size_t idx, Set::SetView &var)
static void init_last_val(FlatZincSpace &home, size_t idx, Set::SetView &var)
Float view for float variables.
FloatNum min(void) const
Return minimum of domain.
FloatVal val(void) const
Return assigned value.
Boolean view for Boolean variables.
int min(void) const
Return minimum of domain.
int val(void) const
Return assigned value (only if assigned).
An array of IdxView pairs.
int size(void) const
Return the current size.
Integer view for integer variables.
int min(void) const
Return minimum of domain.
int val(void) const
Return assigned value (only if assigned).
Gecode::FloatVarArgs argtype
Class to map VarArg type to view.
static PropCost record(void)
For recording information (no propagation allowed).
Propagator(Home home)
Constructor for posting.
Range iterator for the greatest lower bound.
Set view for set variables
ExecStatus ES_SUBSUMED(Propagator &p)
Propagator p is subsumed
int ModEventDelta
Modification event deltas.
Interpreter for the FlatZinc language.
LastVal< Float::FloatView, SetFloatLastVal > LastValFloat
LastVal< IntView, SetIntLastVal > LastValInt
LastVal< BoolView, SetBoolLastVal > LastValBool
LastVal< Set::SetView, SetIntSetLastVal > LastValSet
Gecode toplevel namespace
const PropCond PC_GEN_ASSIGNED
Propagation condition for an assigned variable.
@ ES_OK
Execution is okay.
@ ES_FIX
Propagation has computed fixpoint.