Go to the documentation of this file.
34 #ifndef __GECODE_INT_LDSB_HH__
35 #define __GECODE_INT_LDSB_HH__
43 namespace Gecode {
namespace Int {
namespace LDSB {
79 findVar(
int *indices,
unsigned int n_values,
unsigned int seq_size,
int index);
104 namespace Gecode {
namespace Int {
namespace LDSB {
175 static void*
operator new(
size_t s,
Space& home);
177 static void operator delete(
void*,
Space&);
179 static void operator delete(
void*);
182 template <
class View>
202 template <
class View>
222 template <
class View>
264 template <
class View>
304 const Literal *
const _literals;
306 const int _nliterals;
311 const Literal* literals,
int nliterals);
315 const Literal* literals(
void)
const;
317 int nliterals(
void)
const;
319 virtual void archive(
Archive& e)
const;
330 template<
class View,
int n,
class Val,
unsigned int a,
331 class Filter,
class Print>
375 template<
class View,
int n,
class Val,
unsigned int a>
int * values
Set of sequences.
int seq_size
Size of each sequence in symmetry.
std::function< bool(const Space &home, Var x, int i)> BranchFilter
Function type for branch filter functions.
Post propagator for SetVar x
unsigned int seq_size
Size of each sequence in symmetry.
unsigned int seq_size
Size of each sequence in symmetry.
SymmetryImp< View > * copy(Space &home) const
Copy function.
VarImpBase ** xs
Array of variables in symmetry.
#define GECODE_VTABLE_EXPORT
Choice storing position and value, and symmetric literals to be excluded on the right branch.
virtual size_t dispose(Space &home)
Disposal.
IntSet values
Set of symmetric values.
VarImpBase ** xs
Array of variables in symmetry.
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.
Implementation of a value symmetry.
ArgArray< VarImpBase * > StorageType
virtual size_t dispose(Space &home)
Delete brancher and return its size.
int _variable
Variable index. The ViewArray that the index is meant for is assumed to be known by context.
Support::BitSet< Space > dead_sequences
Which sequences are dead.
Implementation of a symmetry at the modelling level.
Support::BitSetOffset< Space > values
Symmetric values.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
ViewArray< View > x
Views to branch on.
int getVal(unsigned int sequence, unsigned int position) const
Get the value in the specified sequence at the specified position. (Both are zero-based....
ArgArray< VarImpBase * > ArgsType
Base-class for both propagators and branchers.
virtual SymmetryImp< View > * copy(Space &home) const =0
Copy function.
Implementation of a variable symmetry.
void update(Literal)
Search left-branch update.
virtual size_t dispose(Space &home)=0
Disposal.
Generic brancher by view and value selection.
ModEvent prune(Space &home, View x, int v)
Exclude value \v from variable view \x.
Gecode toplevel namespace
IntArgs values
Array of values in symmetry.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
virtual ~SymmetryImp(void)
Unused destructor.
bool operator<(const Literal &rhs) const
Less than. The ordering is the lexicographical order on the (variable,value) pair.
unsigned int n_seqs
Number of sequences in symmetry.
View::VarType Var
The corresponding variable.
ViewSel< View > * vs[n]
View selection objects.
Implementation of a value sequence symmetry at the modelling level.
Argument array for non-primitive types.
SymmetryImp< View > * copy(Space &home) const
Copy function.
virtual ExecStatus commit(Space &home, const Choice &c, unsigned int b)
Perform commit for choice c and alternative b.
virtual const Choice * choice(Space &home)
Return choice.
Base-class for branchers.
Implementation of a variable sequence symmetry.
unsigned int n_values
Total number of values (n_seqs * seq_size)
#define GECODE_INT_EXPORT
Home class for posting propagators
int _nsyms
Number of symmetry implementations.
virtual size_t dispose(Space &home)
Disposal.
int nxs
Number of variables in symmetry.
Implementation of a variable symmetry at the modelling level.
int nrefs
Number of references that point to this symmetry object.
virtual void update(Literal)=0
Left-branch update.
SymmetryImp< View > * copy(Space &home) const
Copy function.
int nxs
Number of variables in symmetry.
Implementation of a value symmetry at the modelling level.
unsigned int n_indices
Total number of indices (n_seqs * seq_size)
Implementation of a value sequence symmetry.
ValSelCommitBase< View, Val > * vsc
Value selection and commit object.
virtual Actor * copy(Space &home)
Perform cloning.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
A Literal is a pair of variable index and value.
virtual size_t dispose(Space &home)
Disposal.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
int ModEvent
Type for modification events.
unsigned int lookup_size
Size of lookup.
void update(Literal)
Left-branch update.
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const
Compute symmetric literals.
Choice storing position and value
virtual ArgArray< Literal > symmetric(Literal, const ViewArray< View > &) const =0
Compute symmetric literals.
Traits of arrays in Gecode.
ArgArray< Int::LDSB::Literal > LiteralArgs
An array of literals.
int _value
The value of the literal. For int and bool variables, this is the value itself; for set variables,...
Implementation of a variable sequence symmetry at the modelling level.
Support::BitSetOffset< Space > indices
Symmetric variable indices.
void sequence(Home home, const IntVarArgs &x, const IntSet &s, int q, int l, int u, IntPropLevel)
Post propagator for .
int * lookup
Map from variable's index to its sequence and position.
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.
virtual size_t dispose(Space &home)
Disposal.
Base-class for variable implementations.
Symmetry-breaking brancher with generic view and value selection.
int seq_size
Size of each sequence in symmetry.
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.
void update(Literal)
Left-branch update.
Gecode::FloatVal c(-8, 8)
unsigned int * indices
Array of variable indices.
Implementation of a single symmetry.
int n
Number of negative literals for node type.
Choice for performing commit
void update(Literal)
Left-branch update.
Passing integer arguments.
Bitsets with index offset.
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.
unsigned int n_seqs
Number of sequences in symmetry.
int getVal(unsigned int sequence, unsigned int position) const
Get the value in the specified sequence at the specified position. (Both are zero-based....
SymmetryImp< View > * copy(Space &home) const
Copy function.
int p
Number of positive literals for node type.
Literal(void)
Constructor for an empty literal.
LDSBBrancher(Space &home, LDSBBrancher &b)
Constructor for cloning b.
Int::LDSB::Literal ValueType
SymmetryImp< View > ** _syms
Array of symmetry implementations.
double position(const Space &home, IntVar x, int i)