40 #ifndef __GECODE_INT_EXTENSIONAL_HH__
41 #define __GECODE_INT_EXTENSIONAL_HH__
52 namespace Gecode {
namespace Int {
namespace Extensional {
68 template<
class View,
class Val,
class Degree,
class StateIdx>
149 bool empty(
void)
const;
225 namespace Gecode {
namespace Int {
namespace Extensional {
241 template<
class View,
bool subscribe = true>
280 namespace Gecode {
namespace Int {
namespace Extensional {
294 template<
class View,
bool shared>
332 namespace Gecode {
namespace Int {
namespace Extensional {
382 static void*
operator new(
size_t s,
Space& home);
384 static void operator delete(
void*
p);
386 static void operator delete(
void*
p,
Space& home);
417 static void*
operator new(
size_t s,
Space& home);
419 static void operator delete(
void*
p);
421 static void operator delete(
void*
p,
Space& home);
433 bool empty(
void)
const;
437 void pop(
Space& home,
int& i,
int& n);
481 class SupportAdvisor :
public Advisor {
489 SupportAdvisor(
Space& home,
bool share, SupportAdvisor&
a);
IndexRange i_ch
Index range with in-degree modifications.
int lst(void) const
Return last position.
TupleSet tupleSet
Definition of constraint.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Work w_remove
Work for removing values.
void init_dom(Space &home, Domain dom)
Initialize domain information.
Description of work to be done.
void audit(void)
Perform consistency check on data structures.
Edge defined by in-state and out-state
Council< Index > c
The advisor council.
Tuple find_support(Domain dom, int i, int n)
Find support for view at position i and value n.
int val(void) const
Return supported value.
int n
Number of layers (and views)
Iterator for telling variable domains by scanning support.
IndexRange a_ch
Index range for any change (for compression)
StateIdx n_states
Number of states used by outgoing edges.
void dispose(Space &home)
Free memory for this element.
virtual ~Base(void)
Unused destructor (to avoid warnings)
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
unsigned int n_states
Total number of states.
void init_last(Space &home, Tuple **source, Tuple *base)
Initialize last support.
WorkEntry(int i, int n, WorkEntry *ne)
Initialize with position i, value n, and next entry ne.
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
size_t dispose(Space &home)
Delete propagator and return its size.
void init(const Layer &l)
Initialize for support of layer l.
int * Tuple
Type of a tuple.
void dom(Home home, FloatVar x, FloatVal n)
Propagates .
StateIdx i_state
Number of in-state.
Base-class for propagators.
Tuple last_next(int i, int n)
Find last support for view at position i and value n.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
Tuple last(int i, int n)
Find last support for view at position i and value n.
void dispose(Space &home, SupportEntry *l)
Free memory for all elements between this and l (inclusive)
void lshift(int n)
Shift index range by n elements to the left.
void add_support(Space &home, Tuple l)
Add support.
void init_support(Space &home)
Initialize support.
Support information for a value
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
bool i_dec(int i, const Edge &e)
Decrement out degree for in state of edge e for layer i.
IndexRange o_ch
Index range with out-degree modifications.
Base-class for both propagators and branchers.
SupportEntry ** support_data
Support information.
State & o_state(int i, StateIdx os)
Return out state for layer i and state index os.
ValSize size
Number of supported values.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode::FloatVal c(-8, 8)
StateIdx o_state
Number of out-state.
Deterministic finite automaton (DFA)
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.
Domain consistent extensional propagator.
void operator++(void)
Move to next supported value.
Support * support
Supported values.
void remove_support(Space &home, Tuple l, int i, int n)
Remove support for view at position i and value n.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
Range approximation of which positions have changed.
SupportEntry(Tuple t)
Initialize with Tuple t.
ViewArray< View > x
Variables.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Tuple ** last_data
Last tuple looked at Access real tuple-set.
ModEventDelta med
A set of modification events (used during propagation)
Entry for storing support.
Layer for a view in the layered graph
Support::BitSetBase * Domain
Degree n_edges
Number of supporting edges.
void find_support(Space &home, Domain dom, int i, int n)
Find a next support for view at position i and value n.
LayeredGraph(Space &home, bool share, LayeredGraph< View, Val, Degree, StateIdx > &p)
Constructor for cloning p.
bool operator()(void) const
Test whether more values supported.
Layer * layers
The layers of the graph.
int fst(void) const
Return first position.
int i
Position of view in view array.
StateIdx max_states
Maximal number of states per layer.
bool valid(Tuple t, Domain dom)
Check wether tuple is valid for domain.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
bool empty(void) const
Check whether work stack is empty.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high quadratic)
ExecStatus post_lgp(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Select small types for the layered graph propagator.
void reset(void)
Reset range to be empty.
Traits to for information about integer types.
int unassigned
Number of unassigned views.
Degree o_deg
The out-degree (number of outgoing edges) Initialize with zeroes.
State * states
States used by outgoing edges.
Work(void)
Initialize as empty.
Domain consistent layered graph (regular) propagator.
LayerValues(void)
Default constructor.
Class represeting a set of tuples.
SupportEntry ** nextRef(void)
Return reference to field for next support entry.
void push(Space &home, int i, int n)
Push new work entry for position i and value n.
Work w_support
Work for finding support.
Domain consistent extensional propagator.
static ExecStatus post(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Post propagator on views x and DFA dfa.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &t)
Post propagator for views x.
Node * x
Pointer to corresponding Boolean expression node.
Base(Space &home, bool share, Base< View, subscribe > &p)
Constructor for cloning p.
Generic domain change information to be supplied to advisors.
Basic(Space &home, bool share, Basic< View, shared > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Advisors for views (by position in array)
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &t)
Post propagator for views x.
IndexRange(void)
Initialize range as empty.
Incremental(Space &home, bool share, Incremental< View > &p)
Constructor for cloning p.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
SupportEntry * support(int i, int n)
Creat support entry for view at position i and value n.
Support::BitSetBase BitSet
Base-class for freelist-managed objects.
TupleSet::TupleSetI * ts(void)
void add(int i)
Add index i to range.
Base for domain consistent extensional propagation
Edge * edges
Supporting edges in layered graph.
State & i_state(int i, StateIdx is)
Return in state for layer i and state index is.
Gecode toplevel namespace
Argument array for variables.
ExecStatus initialize(Space &home, const VarArgArray< Var > &x, const DFA &dfa)
Initialize layered graph.
void pop(Space &home, int &i, int &n)
Pop current top entry and set position i and value n.
States are described by number of incoming and outgoing edges.
Degree i_deg
The in-degree (number of incoming edges)
bool o_dec(int i, const Edge &e)
Decrement in degree for out state of edge e for layer i.
virtual size_t dispose(Space &home)
Delete propagator and return its size.
int ModEventDelta
Modification event deltas.
Home class for posting propagators
bool empty(void) const
Test whether range is empty.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
unsigned int n_edges
Total number of edges.
SupportEntry * next(void) const
Return next support entry.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
Gecode::Support::IntTypeTraits< Val >::utype ValSize
Type for support size.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
WorkEntry * next(void) const
Return next work entry.
int i
The position of the view in the view array.