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 {
177 static void*
operator new(
size_t s,
Space& home);
179 static void operator delete(
void*,
Space&);
181 static void operator delete(
void*);
184 template <
class View>
204 template <
class View>
224 template <
class View>
266 template <
class View>
306 const Literal *
const _literals;
308 const int _nliterals;
313 const Literal* literals,
int nliterals);
317 const Literal* literals(
void)
const;
319 int nliterals(
void)
const;
321 virtual size_t size(
void)
const;
323 virtual void archive(
Archive& e)
const;
334 template<
class View,
int n,
class Val,
unsigned int a>
348 typename View::VarType
x,
int i,
Int::LDSB::Literal ValueType
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
virtual size_t dispose(Space &home)
Disposal.
int _nsyms
Number of symmetry implementations.
VarImpBase ** xs
Array of variables in symmetry.
BranchFilter bf
Branch filter function.
unsigned int n_indices
Total number of indices (n_seqs * seq_size)
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.
Implementation of a value symmetry at the modelling level.
bool operator<(const Literal &rhs) const
Less than. The ordering is the lexicographical order on the (variable,value) pair.
int getVal(unsigned int sequence, unsigned int position) const
Get the value in the specified sequence at the specified position. (Both are zero-based.)
Implementation of a value sequence symmetry at the modelling level.
virtual Actor * copy(Space &home, bool share)
Perform cloning.
BranchTraits< typename View::VarType >::Filter BranchFilter
The branch filter that corresponds to the var type.
int ModEvent
Type for modification events.
Implementation of a symmetry at the modelling level.
Implementation of a variable sequence symmetry.
virtual const Choice * choice(Space &home)
Return choice.
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Support::BitSetOffset< Space > values
Symmetric values.
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...
SymmetryImp< View > ** _syms
Array of symmetry implementations.
Base-class for both propagators and branchers.
int nxs
Number of variables in symmetry.
ArgArray< Int::LDSB::Literal > LiteralArgs
An array of literals.
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntConLevel)
Post propagator for .
Gecode::FloatVal c(-8, 8)
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
int p
Number of positive literals for node type.
Choice storing position and value, and symmetric literals to be excluded on the right branch...
Gecode::IntArgs i(4, 1, 2, 3, 4)
Base-class for branchers.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
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.
virtual size_t dispose(Space &home)
Delete brancher and return its size.
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.
int getVal(unsigned int sequence, unsigned int position) const
Get the value in the specified sequence at the specified position. (Both are zero-based.)
Implementation of a value symmetry.
virtual SymmetryImp< View > * copy(Space &home, bool share) const =0
Copy function.
ViewSel< View > * vs[n]
View selection objects.
unsigned int size(I &i)
Size of all ranges of range iterator i.
unsigned int seq_size
Size of each sequence in symmetry.
ArgArray< VarImpBase * > ArgsType
int nxs
Number of variables in symmetry.
Support::BitSet< Space > dead_sequences
Which sequences are dead.
virtual size_t dispose(Space &home)
Disposal.
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.
VarValPrint vvp
Print function.
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.
Passing integer arguments.
unsigned int seq_size
Size of each sequence in symmetry.
void(* VarValPrint)(const Space &home, const BrancherHandle &bh, unsigned int b, typename View::VarType x, int i, const Val &m, std::ostream &o)
Function type for printing variable and value selection.
double position(const Space &home, IntVar x, int i)
unsigned int n_values
Total number of values (n_seqs * seq_size)
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Implementation of a single symmetry.
void update(Literal)
Left-branch update.
Node * x
Pointer to corresponding Boolean expression node.
Choice for performing commit
Implementation of a variable symmetry.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
static BrancherHandle post(Home home, ViewArray< View > &x, ViewSel< View > *vs[n], ValSelCommitBase< View, Val > *vsc, SymmetryImp< View > **syms, int nsyms, BranchFilter bf, VarValPrint vvp)
Brancher post function.
void update(Literal)
Left-branch update.
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Implementation of a value sequence symmetry.
Traits of arrays in Gecode.
LDSBBrancher(Space &home, bool share, LDSBBrancher &b)
Constructor for cloning b.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
unsigned int n_seqs
Number of sequences in symmetry.
void update(Literal)
Search left-branch update.
Gecode toplevel namespace
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
#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.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
ViewArray< View > x
Views to branch on.
Home class for posting propagators
SymmetryImp< View > * copy(Space &home, bool share) const
Copy function.
Choice storing position and value
int nrefs
Number of references that point to this symmetry object.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
void update(Literal)
Left-branch update.
Bitsets with index offset.
int * values
Set of sequences.