Go to the documentation of this file.
38 #ifndef __GECODE_INT_BIN_PACKING_HH__
39 #define __GECODE_INT_BIN_PACKING_HH__
103 int card(
void)
const;
105 int total(
void)
const;
123 int card(
void)
const;
125 int total(
void)
const;
159 template<
class SizeSet>
162 template<
class SizeSet>
191 int nodes(
void)
const;
207 bool in(
int i)
const;
279 void incl(
int i,
unsigned int w);
281 void excl(
int i,
unsigned int w);
311 void edge(
int i,
int j,
bool add=
true);
Post propagator for SetVar x
unsigned int w
Weight (initialized with degree before graph is reduced)
Basic bitset support (without stored size information)
ExecStatus bk(NodeSet &p, NodeSet &x)
Run Bosch-Kerbron algorithm for finding max cliques.
const IntVarArgs & b
Bin variables.
Passing integer variables.
IntSet maxclique(void) const
Return maximal clique found.
bool nosum(const SizeSet &s, int a, int b, int &ap, int &bp)
Detect non-existence of sums in a .. b.
ViewArray< Item > bs
Items with bin and size.
int t
Total size of all items.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
Clique(Region &r, int m)
Constructor for m nodes.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
int n
Number of size entries in the set.
static ExecStatus post(Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
Post propagator for loads l and items bs.
Base-class for both propagators and branchers.
Nodes(const NodeSet &ns)
Initialize for nodes in ns.
Clique cur
Current clique.
void edge(int i, int j, bool add=true)
Add or remove an edge between nodes i and j (i must be less than j)
Pack(Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
Constructor for posting.
ViewArray< OffsetView > l
Views for load of bins.
bool operator<(const Item &i, const Item &j)
For sorting according to size.
void incl(int i, unsigned int w)
Include node i with weight w.
int size(void) const
Return size of item.
int p
Position of discarded item.
Base-class for derived views.
Gecode toplevel namespace
bool in(int i) const
Test whether node i is included.
void allocate(Region &r, int n)
Allocate node set for n nodes.
~ConflictGraph(void)
Destructor.
Base-class for propagators.
void copy(int n, const NodeSet &ns)
Copy elements from node set ns with n nodes.
SizeSet(void)
Default constructor.
int pivot(const NodeSet &a, const NodeSet &b) const
Find a pivot node with maximal degree from a or b.
NodeSet(void)
Keep uninitialized.
int card(void) const
Return cardinality of set (number of entries)
void minus(int s)
Discard size s.
void excl(int i)
Exclude node i.
#define GECODE_INT_EXPORT
SizeSetMinusOne(void)
Default constructor.
Home class for posting propagators
Post propagator for SetVar SetOpType SetVar SetRelType r
Clique max
Largest clique so far.
ModEventDelta med
A set of modification events (used during propagation)
void operator++(void)
Move iterator to next node (if possible)
bool adjacent(int i, int j) const
Test whether nodes i and j are adjacent.
void add(int s)
Add new size s.
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
bool operator!=(const Item &i, const Item &j)
Whether two items are not the same.
ExecStatus post(void)
Post additional constraints.
int card(void) const
Return cardinality of set (number of entries)
void empty(int n)
Clear the whole node set for n nodes.
Size sets with one element discarded.
int operator[](int i) const
Return size of item i.
virtual size_t dispose(Space &home)
Destructor.
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Node(void)
Default constructor.
void incl(int i)
Include node i.
bool operator==(const Item &i, const Item &j)
Whether two items are the same.
Item(void)
Default constructor.
Node * node
The nodes in the graph.
int operator[](int i) const
Return size of item i.
unsigned int c
Cardinality of clique.
int operator()(void) const
Return current node.
IntView bin(void) const
Return bin of item.
int nodes(void) const
Return number of nodes.
Integer view for integer variables.
int t
Total size of the set.
ConflictGraph(Home &home, Region &r, const IntVarArgs &b, int m)
Initialize graph.
unsigned int w
Weight of clique.
int total(void) const
Return total size.
int total(void) const
Return total size.
Gecode::FloatVal c(-8, 8)
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
virtual void reschedule(Space &home)
Schedule function.
Graph containing conflict information.
void update(Space &home, Item &i)
Update item during cloning.
ExecStatus clique(void)
Report the current clique.
NodeSet n
Nodes in the clique.
int n
Number of negative literals for node type.
static bool iwn(NodeSet &iwa, const NodeSet &a, NodeSet &iwb, const NodeSet &b, const NodeSet &c, int n)
int ModEventDelta
Modification event deltas.
Gecode::IntArgs i({1, 2, 3, 4})
void init(Region &r, int n)
Initialize node set for n nodes.
int p
Number of positive literals for node type.
void excl(int i, unsigned int w)
Exclude node i with weight w.
int * s
Array of sizes (will have more elements)
Item combining bin and size information.
unsigned int bins
Number of bins.