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>
160 bool nosum(
const SizeSet& s,
int a,
int b,
int& ap,
int& bp);
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);
Home class for posting propagators
Passing integer variables.
Clique(Region &r, int m)
Constructor for m nodes.
void excl(int i, unsigned int w)
Exclude node i with weight w.
NodeSet n
Nodes in the clique.
void incl(int i, unsigned int w)
Include node i with weight w.
unsigned int c
Cardinality of clique.
unsigned int w
Weight of clique.
void empty(int n)
Clear the whole node set for n nodes.
void incl(int i)
Include node i.
NodeSet(void)
Keep uninitialized.
static bool iwn(NodeSet &iwa, const NodeSet &a, NodeSet &iwb, const NodeSet &b, const NodeSet &c, int n)
void init(Region &r, int n)
Initialize node set for n nodes.
bool in(int i) const
Test whether node i is included.
void allocate(Region &r, int n)
Allocate node set for n nodes.
void copy(int n, const NodeSet &ns)
Copy elements from node set ns with n nodes.
void excl(int i)
Exclude node i.
unsigned int w
Weight (initialized with degree before graph is reduced)
Node(void)
Default constructor.
void operator++(void)
Move iterator to next node (if possible)
Nodes(const NodeSet &ns)
Initialize for nodes in ns.
int operator()(void) const
Return current node.
Clique cur
Current clique.
ExecStatus clique(void)
Report the current clique.
int nodes(void) const
Return number of nodes.
ExecStatus post(void)
Post additional constraints.
ConflictGraph(Home &home, Region &r, const IntVarArgs &b, int m)
Initialize graph.
int pivot(const NodeSet &a, const NodeSet &b) const
Find a pivot node with maximal degree from a or b.
~ConflictGraph(void)
Destructor.
bool adjacent(int i, int j) const
Test whether nodes i and j are adjacent.
Node * node
The nodes in the graph.
ExecStatus bk(NodeSet &p, NodeSet &x)
Run Bosch-Kerbron algorithm for finding max cliques.
unsigned int bins
Number of bins.
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)
const IntVarArgs & b
Bin variables.
Clique max
Largest clique so far.
IntSet maxclique(void) const
Return maximal clique found.
Item combining bin and size information.
IntView bin(void) const
Return bin of item.
void update(Space &home, Item &i)
Update item during cloning.
Item(void)
Default constructor.
int size(void) const
Return size of item.
ViewArray< OffsetView > l
Views for load of bins.
static ExecStatus post(Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
Post propagator for loads l and items bs.
virtual ExecStatus propagate(Space &home, const ModEventDelta &med)
Perform propagation.
ViewArray< Item > bs
Items with bin and size.
Pack(Home home, ViewArray< OffsetView > &l, ViewArray< Item > &bs)
Constructor for posting.
int t
Total size of all items.
virtual Actor * copy(Space &home)
Copy propagator during cloning.
bool nosum(const SizeSet &s, int a, int b, int &ap, int &bp)
Detect non-existence of sums in a .. b.
virtual PropCost cost(const Space &home, const ModEventDelta &med) const
Cost function.
virtual void reschedule(Space &home)
Schedule function.
virtual size_t dispose(Space &home)
Destructor.
int operator[](int i) const
Return size of item i.
void minus(int s)
Discard size s.
SizeSetMinusOne(void)
Default constructor.
int p
Position of discarded item.
int total(void) const
Return total size.
int card(void) const
Return cardinality of set (number of entries)
int t
Total size of the set.
SizeSet(void)
Default constructor.
void add(int s)
Add new size s.
int total(void) const
Return total size.
int operator[](int i) const
Return size of item i.
int n
Number of size entries in the set.
int * s
Array of sizes (will have more elements)
int card(void) const
Return cardinality of set (number of entries)
Integer view for integer variables.
ModEventDelta med
A set of modification events (used during propagation)
Propagator(Home home)
Constructor for posting.
Basic bitset support (without stored size information)
#define GECODE_INT_EXPORT
int ModEventDelta
Modification event deltas.
bool operator<(const Item &i, const Item &j)
Order, also for sorting according to size.
bool operator!=(const Item &i, const Item &j)
Whether two items are not the same.
bool operator==(const Item &i, const Item &j)
Whether two items are the same.
Gecode toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar x