38 #ifndef __GECODE_INT_LDSB_HH__ 39 #define __GECODE_INT_LDSB_HH__ 47 namespace Gecode {
namespace Int {
namespace LDSB {
83 findVar(
int *indices,
unsigned int n_values,
unsigned int seq_size,
int index);
108 namespace Gecode {
namespace Int {
namespace LDSB {
179 static void*
operator new(
size_t s,
Space& home);
181 static void operator delete(
void*,
Space&);
183 static void operator delete(
void*);
186 template <
class View>
206 template <
class View>
226 template <
class View>
268 template <
class View>
308 const Literal *
const _literals;
310 const int _nliterals;
315 const Literal* literals,
int nliterals);
319 const Literal* literals(
void)
const;
321 int nliterals(
void)
const;
323 virtual size_t size(
void)
const;
325 virtual void archive(
Archive& e)
const;
336 template<
class View,
int n,
class Val,
unsigned int a,
337 class Filter,
class Print>
381 template<
class View,
int n,
class Val,
unsigned int a>
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Int::LDSB::Literal ValueType
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
virtual size_t dispose(Space &home)
Disposal.
VarImpBase ** xs
Array of variables in symmetry.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
unsigned int n_indices
Total number of indices (n_seqs * seq_size)
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
IntSet values
Set of symmetric values.
A Literal is a pair of variable index and value.
unsigned int lookup_size
Size of lookup.
IntArgs values
Array of values in symmetry.
std::pair< int, int > findVar(int *indices, unsigned int n_values, unsigned int seq_size, int index)
Find the location of an integer in a collection of sequences.
View::VarType Var
The corresponding variable.
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Implementation of a value symmetry at the modelling level.
Implementation of a value sequence symmetry at the modelling level.
virtual ~SymmetryImp(void)
Unused destructor.
std::function< void(const Space &home, const Brancher &b, unsigned int a, Var x, int i, const Val &m, std::ostream &o)> VarValPrint
Function type for printing variable and value selection.
void postldsbbrancher(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **syms, int nsyms, BranchFilter< typename View::VarType > bf, VarValPrint< typename View::VarType, Val > vvp)
Post LDSB brancher.
int ModEvent
Type for modification events.
Implementation of a symmetry at the modelling level.
Implementation of a variable sequence symmetry.
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Support::BitSetOffset< Space > values
Symmetric values.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
ViewArray< View > x
Views to branch on.
int * lookup
Map from variable's index to its sequence and position.
int _value
The value of the literal. For int and bool variables, this is the value itself; for set variables...
Base-class for variable implementations.
int _variable
Variable index. The ViewArray that the index is meant for is assumed to be known by context...
Base-class for both propagators and branchers.
int nxs
Number of variables in symmetry.
ArgArray< Int::LDSB::Literal > LiteralArgs
An array of literals.
ViewSel< View > * vs[n]
View selection objects.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
bool operator<(const Literal &rhs) const
Less than. The ordering is the lexicographical order on the (variable,value) pair.
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
Choice storing position and value, and symmetric literals to be excluded on the right branch...
Base-class for branchers.
int n
Number of negative literals for node type.
unsigned int n_seqs
Number of sequences in symmetry.
Argument array for non-primitive types.
virtual size_t dispose(Space &home)
Disposal.
virtual size_t dispose(Space &home)=0
Disposal.
unsigned int * indices
Array of variable indices.
Generic brancher by view and value selection.
Literal(void)
Constructor for an empty literal.
ModEvent prune(Space &home, View x, int v)
Exclude value from variable view .
Implementation of a variable symmetry at the modelling level.
Implementation of a value symmetry.
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
virtual SymmetryImp< View > * copy(Space &home, bool share) const =0
Copy function.
int getVal(unsigned int sequence, unsigned int position) const
Get the value in the specified sequence at the specified position. (Both are zero-based.)
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
unsigned int size(I &i)
Size of all ranges of range iterator i.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
unsigned int seq_size
Size of each sequence in symmetry.
ArgArray< VarImpBase * > ArgsType
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
int nxs
Number of variables in symmetry.
Support::BitSet< Space > dead_sequences
Which sequences are dead.
virtual size_t dispose(Space &home)
Disposal.
static void post(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **syms, int nsyms, BranchFilter< Var > bf, VarValPrint< Var, Val > vvp)
Brancher post function.
int seq_size
Size of each sequence in symmetry.
Symmetry-breaking brancher with generic view and value selection.
Implementation of a variable sequence symmetry at the modelling level.
Support::BitSetOffset< Space > indices
Symmetric variable indices.
VarImpBase ** xs
Array of variables in symmetry.
int seq_size
Size of each sequence in symmetry.
virtual void update(Literal)=0
Left-branch update.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Passing integer arguments.
unsigned int seq_size
Size of each sequence in symmetry.
double position(const Space &home, IntVar x, int i)
unsigned int n_values
Total number of values (n_seqs * seq_size)
Implementation of a single symmetry.
void update(Literal)
Left-branch update.
Choice for performing commit
Implementation of a variable symmetry.
void update(Literal)
Left-branch update.
Implementation of a value sequence symmetry.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Post propagator for SetVar x
int _nsyms
Number of symmetry implementations.
SymmetryImp< View > ** _syms
Array of symmetry implementations.
Traits of arrays in Gecode.
LDSBBrancher(Space &home, bool share, LDSBBrancher &b)
Constructor for cloning b.
unsigned int n_seqs
Number of sequences in symmetry.
void update(Literal)
Search left-branch update.
Gecode toplevel namespace
#define GECODE_VTABLE_EXPORT
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const =0
Compute symmetric literals.
#define GECODE_INT_EXPORT
ArgArray< VarImpBase * > StorageType
virtual size_t dispose(Space &home)
Disposal.
int getVal(unsigned int sequence, unsigned int position) const
Get the value in the specified sequence at the specified position. (Both are zero-based.)
Home class for posting propagators
Choice storing position and value
virtual const Choice * choice(Space &home)
Return choice.
int nrefs
Number of references that point to this symmetry object.
void update(Literal)
Left-branch update.
Bitsets with index offset.
virtual Actor * copy(Space &home, bool share)
Perform cloning.
int * values
Set of sequences.