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