Go to the documentation of this file.
38 #ifndef __GECODE_INT_EXTENSIONAL_HH__
39 #define __GECODE_INT_EXTENSIONAL_HH__
50 namespace Gecode {
namespace Int {
namespace Extensional {
66 template<
class View,
class Val,
class Degree,
class StateIdx>
147 bool empty(
void)
const;
223 namespace Gecode {
namespace Int {
namespace Extensional {
234 template<
class IndexType>
251 template<
class OldIndexType>
262 unsigned int limit(
void)
const;
264 bool empty(
void)
const;
268 unsigned int width(
void)
const;
274 template<
bool sparse>
283 unsigned long long int ones(
void)
const;
287 unsigned long long int bits(
void)
const;
289 unsigned int words(
void)
const;
291 unsigned int size(
void)
const;
298 namespace Gecode {
namespace Int {
namespace Extensional {
301 template<
unsigned int _size>
311 template<
unsigned int largersize>
314 template<
class IndexType>
317 int limit(
void)
const;
319 bool empty(
void)
const;
323 unsigned int width(
void)
const;
329 template<
bool sparse>
340 unsigned long long int ones(
void)
const;
344 unsigned long long int bits(
void)
const;
346 unsigned int words(
void)
const;
348 unsigned int size(
void)
const;
355 namespace Gecode {
namespace Int {
namespace Extensional {
361 template<
class View,
bool pos>
458 bool all(
void)
const;
475 template<
class Table>
478 template<
class Table>
479 bool full(
const Table& table)
const;
503 template<
class View,
class Table>
553 bool empty(
void)
const;
555 template<
class TableProp>
593 template<
class View,
class Table>
610 template<
class TableProp>
635 template<
class View,
class Table,
class CtrlView, ReifyMode rm>
655 template<
class TableProp>
676 template<
class View,
class CtrlView, ReifyMode rm>
void audit(void)
Perform consistency check on data structures.
unsigned int width(void) const
Return the highest active index.
void flush(void)
Make the set empty.
bool empty(void) const
Check whether the table is empty.
const Range * lst
Last range.
Base class for compact table propagator.
void clear_mask(BitSetData *mask) const
Clear the first limit words in mask.
Degree o_deg
The out-degree (number of outgoing edges) Initialize with zeroes.
Post propagator for SetVar x
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
Compact< View, false >::ValidSupports ValidSupports
Table table
Current table.
void lshift(int n)
Shift index range by n elements to the left.
Council< CTAdvisor > c
The advisor council.
Index(Space &home, Propagator &p, Council< Index > &c, int i)
Create index advisor.
Advisors for views (by position in array)
const BitSetData * supports(void) const
Return supports.
bool full(const Table &table) const
Check whether the table covers the whole Cartedion product.
IndexRange a_ch
Index range for any change (for compression)
const unsigned int n_words
Number of words in supports.
bool i_dec(int i, const Edge &e)
Decrement out degree for in state of edge e for layer i.
int val(void) const
Return supported value.
Compact< View, true >::LostSupports LostSupports
@ PROPAGATING
The propagator is currently running.
void propagating(void)
Set status to PROPAGATING.
@ SINGLE
A single view has been touched.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
Gecode::Support::BitSetData BitSetData
Import type.
bool all(void) const
Whether all variables are assigned.
unsigned int words(void) const
Return the number of required bit set words.
Compact(Space &home, Compact &p)
Constructor for cloning p.
bool intersects(const BitSetData *b) const
Check if has a non-empty intersection with the set.
StatusType
Type of status.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
const Range * sr
Support iterator.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
int fst(void) const
Return first position.
ReCompact(Space &home, TableProp &p)
Constructor for cloning p.
Council< Index > c
The advisor council.
const unsigned int n_words
Number of words.
void nand_with_masks(const BitSetData *a, const BitSetData *b)
Perform "nand" with and the "or" of a and b.
static ExecStatus post(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Post propagator on views x and DFA dfa.
Advisor for updating current table.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
bool atmostone(void) const
Whether at most one variable is unassigned.
virtual void reschedule(Space &home)
Schedule function.
size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
const Range * range(CTAdvisor &a, int n)
Find range for n.
int limit(void) const
Get the limit.
Table table
Current table.
Compact< View, false >::ValidSupports ValidSupports
void flush(void)
Make the set empty.
@ MULTIPLE
Multiple view have been touched.
unsigned int words(void) const
Return the number of required bit set words.
void operator++(void)
Move iterator to next value.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
size_t dispose(Space &home)
Delete propagator and return its size.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
CtrlView b
Boolean control view.
ExecStatus post_lgp(Home home, const VarArgArray< Var > &x, const DFA &dfa)
Select small types for the layered graph propagator.
bool operator()(void) const
Whether there are still supports left.
Compact< View, false >::CTAdvisor CTAdvisor
const Range * _lst
Last range of support data structure.
bool empty(void) const
Check whether the set is empty.
Advisor storing a single view
Edge * edges
Supporting edges in layered graph.
Base-class for both propagators and branchers.
IndexType * _index
Indices.
const BitSetData * supports(void) const
Provide access to corresponding supports.
const Range * r
Range information.
StateIdx n_states
Number of states used by outgoing edges.
void add_to_mask(const BitSetData *b, BitSetData *mask) const
Add to mask.
State & i_state(int i, StateIdx is)
Return in state for layer i and state index is.
Layer * layers
The layers of the graph.
Compact< View, false >::CTAdvisor CTAdvisor
CTAdvisor(Space &home, Propagator &p, Council< CTAdvisor > &c, const TupleSet &ts, View x0, int i)
Initialise from parameters.
Table table
Current table.
const Range * lst
The last range.
void init(const Layer &l)
Initialize for support of layer l.
ExecStatus postposcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for positive compact table propagator.
void dispose(Space &home, Council< CTAdvisor > &c)
Dispose advisor.
void touched(CTAdvisor &a)
Set status to SINGLE or MULTIPLE depending on a.
StatusType type(void) const
Return status type.
Range approximation of which positions have changed.
ptrdiff_t s
A tagged pointer for storing the status.
IndexRange i_ch
Index range with in-degree modifications.
ExecStatus postnegcompact(Home home, ViewArray< View > &x, const TupleSet &ts)
Post function for compact table propagator.
PosCompact(Space &home, TableProp &p)
Constructor for cloning p.
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
int val(void) const
Return supported value.
TupleSet ts
The tuple set.
Gecode toplevel namespace
Domain consistent negative extensional propagator.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Support information for a value
Base-class for propagators.
void setup(Space &home, Table &table, ViewArray< View > &x)
Setup the actual table.
Range iterator for integer views.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
LayerValues(void)
Default constructor.
Compact< View, true >::Range Range
Domain consistent layered graph (regular) propagator.
int lst(void) const
Return last position.
const BitSetData * s
The value's support.
ViewRanges< View > xr
Range iterator.
Generic domain change information to be supplied to advisors.
Home class for posting propagators
LayeredGraph(Space &home, LayeredGraph< View, Val, Degree, StateIdx > &p)
Constructor for cloning p.
Iterator over lost supports.
Compact< View, false >::Range Range
int n
Number of layers (and views)
unsigned long long int ones(void) const
Return the number of ones.
Gecode::Support::IntTypeTraits< Val >::utype ValSize
Type for support size.
ValSize size
Number of supported values.
Iterator for telling variable domains by scanning support.
bool operator()(void) const
Whether iterator is done.
const BitSetData * supports(CTAdvisor &a, int n)
Return supports for value n.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
Iterator over valid supports.
virtual void reschedule(Space &home)
Schedule function.
void operator++(void)
Move to next supported value.
int * Tuple
Type of a tuple.
void reset(void)
Reset range to be empty.
ModEventDelta med
A set of modification events (used during propagation)
Support * support
Supported values.
unsigned int size(void) const
Return the number of required bit set words.
Compact< View, true >::ValidSupports ValidSupports
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts)
Post propagator for views x and table t.
unsigned int n_states
Total number of states.
void operator++(void)
Move to next supports.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
Domain consistent reified extensional propagator.
const Range * fst(void) const
Return first range of support data structure.
virtual void reschedule(Space &home)
Schedule function.
StateIdx o_state
Number of out-state.
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
const unsigned int n_words
Number of words.
::Gecode::TupleSet::Tuple Tuple
Import tuple type.
virtual ExecStatus advise(Space &home, Advisor &a, const Delta &d)
Give advice to propagator.
void none(void)
Set status to NONE.
Degree i_deg
The in-degree (number of incoming edges)
Class represeting a set of tuples.
IndexRange o_ch
Index range with out-degree modifications.
int i
The position of the view in the view array.
bool empty(void) const
Check whether the set is empty.
unsigned int limit(void) const
Get the limit.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
ValidSupports(const Compact< View, pos > &p, CTAdvisor &a)
Initialize from initialized propagator.
Status status
Propagator status.
const BitSetData * s
The lost value's support.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function (defined as high linear)
StateIdx i_state
Number of in-state.
StateIdx max_states
Maximal number of states per layer.
Deterministic finite automaton (DFA)
Traits to for information about integer types.
bool empty(void) const
Test whether range is empty.
States are described by number of incoming and outgoing edges.
unsigned long long int ones(void) const
Return the number of ones.
unsigned int size(void) const
Return the total number of words.
State * states
States used by outgoing edges.
static ExecStatus post(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post propagator for views x and table t.
Domain consistent positive extensional propagator.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
BitSetData _bits[_size]
Words.
Layer for a view in the layered graph
void replace_and_decrease(IndexType i, BitSetData w)
Replace the i th word with w, decrease limit if w is zero.
void adjust(void)
Adjust supports.
TupleSet::Range Range
Range type for supports.
void find(void)
Find a new value (only for negative case)
virtual void reschedule(Space &home)
Schedule function.
Status(StatusType t)
Initialize with type t (either NONE or SEVERAL)
const Range * lst(void) const
Return lasst range of support data structure.
ExecStatus initialize(Space &home, const VarArgArray< Var > &x, const DFA &dfa)
Initialize layered graph.
unsigned int n_edges
Total number of edges.
void clear_mask(BitSetData *mask)
Clear the first limit words in mask.
bool intersects(const BitSetData *b)
Check if has a non-empty intersection with the set.
ViewArray< View > y
The views (for rewriting)
IndexRange(void)
Initialize range as empty.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
void nand_with_mask(const BitSetData *b)
Perform "nand" with b.
Degree n_edges
Number of supporting edges.
void intersect_with_masks(const BitSetData *a, const BitSetData *b)
Intersect with the "or" of and b.
size_t dispose(Space &home)
Delete propagator and return its size.
Compact< View, false >::Range Range
size_t dispose(Space &home)
Delete propagator and return its size.
ExecStatus postrecompact(Home home, ViewArray< View > &x, const TupleSet &ts, CtrlView b)
Post function for compact table propagator.
State & o_state(int i, StateIdx os)
Return out state for layer i and state index os.
@ NONE
No view has been touched.
Edge defined by in-state and out-state
int n
Number of negative literals for node type.
const Range * _fst
First range of support data structure.
Argument array for variables.
LostSupports(const Compact< View, pos > &p, CTAdvisor &a, int l, int h)
Initialize iterator for values between l and h.
bool single(CTAdvisor &a) const
Check whether status is single and equal to a.
int ModEventDelta
Modification event deltas.
bool o_dec(int i, const Edge &e)
Decrement in degree for out state of edge e for layer i.
Gecode::IntArgs i({1, 2, 3, 4})
unsigned long long int bits(void) const
Return an upper bound on the number of bits.
int p
Number of positive literals for node type.
void intersect_with_mask(const BitSetData *mask)
Intersect with mask, sparse mask if sparse is true.
unsigned int width(void) const
Return the highest active index.
bool operator()(void) const
Test whether more values supported.
void add(int i)
Add index i to range.
NegCompact(Space &home, TableProp &p)
Constructor for cloning p.
Compact< View, true >::CTAdvisor CTAdvisor
virtual size_t dispose(Space &home)
Delete propagator and return its size.