Go to the documentation of this file.
42 #ifndef __GECODE_INT_BIN_PACKING_HH__
43 #define __GECODE_INT_BIN_PACKING_HH__
107 int card(
void)
const;
109 int total(
void)
const;
127 int card(
void)
const;
129 int total(
void)
const;
163 template<
class SizeSet>
166 template<
class SizeSet>
195 int nodes(
void)
const;
211 bool in(
int i)
const;
283 void incl(
int i,
unsigned int w);
285 void excl(
int i,
unsigned int w);
315 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.
Gecode::IntArgs i(4, 1, 2, 3, 4)
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
bool same(const Item &i, const Item &j)
Whether two items are the same.
Clique(Region &r, int m)
Constructor for m nodes.
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.
void update(Space &home, bool share, Item &i)
Update item during cloning.
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
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
struct Gecode::@579::NNF::@61::@62 b
For binary nodes (and, or, eqv)
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.
virtual Actor * copy(Space &home, bool share)
Copy propagator during cloning.
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.
bool before(const Item &i, const Item &j)
Test whether one item is before another.
Node(void)
Default constructor.
void incl(int i)
Include node i.
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.
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.
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.