54 : Support::RawBitSetBase(r,static_cast<unsigned int>(n)) {}
58 : Support::RawBitSetBase(r,static_cast<unsigned int>(n),ns) {}
69 return RawBitSetBase::get(static_cast<unsigned int>(i));
73 RawBitSetBase::set(static_cast<unsigned int>(i));
77 RawBitSetBase::clear(static_cast<unsigned int>(i));
81 RawBitSetBase::copy(static_cast<unsigned int>(n),ns);
85 RawBitSetBase::clearall(static_cast<unsigned int>(n));
91 unsigned int n =
static_cast<unsigned int>(_n);
93 unsigned int pos = n / bpb;
94 unsigned int bits = n % bpb;
98 for (
unsigned int i=0;
i<
pos;
i++) {
107 abc.
o(cwa.
data[pos],bits);
108 abc.
o(cwb.
data[pos],bits);
110 assert(cwa.
get(n) && cwb.
get(n));
120 : ns(ns0),
c(ns.next(0)) {}
127 return static_cast<int>(
c);
132 :
n(r,m),
c(0), w(0) {}
135 n.incl(i);
c++; w += wi;
139 n.excl(i);
c--; w -= wi;
146 bins(static_cast<unsigned int>(m)),
188 unsigned int m =
node[
p].
d;
195 while (j() <
nodes()) {
196 if (
node[j()].
d > m) {
217 assert(i == static_cast<int>(
cur.
c));
255 bv[0]=
b[
i]; bv[1]=
b[j]; bv[2]=
b[k];
284 if ((
node[j].d == 1) || (
node[j].d == 2))
295 if ((
node[j].d == 2) || (
node[k].d == 2))
303 if ((
node[j].d == 1) || (
node[j].d == 2))
305 if ((
node[k].d == 1) || (
node[k].d == 2))
320 p.incl(
i); empty =
false;
339 assert(j == static_cast<int>(
max.
c));
void push(const T &x)
Push element x on top of stack.
void init(A &a, unsigned int sz, bool setbits=false)
Initialize for sz bits and allocator a (only after default constructor)
void excl(int i)
Exclude node i.
void empty(int n)
Clear the whole node set for n nodes.
int nodes(void) const
Return number of nodes.
int size(void) const
Return size of array (number of elements)
T * alloc(long unsigned int n)
Allocate block of n objects of type T from region.
Node * node
The nodes in the graph.
unsigned int c
Cardinality of clique.
bool pos(const View &x)
Test whether x is postive.
static ExecStatus post(Home home, ViewArray< View > &x)
Post propagator for views x.
ConflictGraph(Space &home, Region &r, const IntVarArgs &b, int m)
Initialize graph.
Node(void)
Default constructor.
bool get(unsigned int i) const
Access value at bit i.
void copy(int n, const NodeSet &ns)
Copy elements from node set ns with n nodes.
void allocate(A &a, unsigned int sz)
Allocate for sz bits and allocator a (only after default constructor)
ExecStatus clique(void)
Report the current clique.
ExecStatus post(void)
Post additional constraints.
IntSet maxclique(void) const
Return maximal clique found.
#define GECODE_ES_CHECK(es)
Check whether execution status es is failed or subsumed, and forward failure or subsumption.
Gecode::FloatVal c(-8, 8)
int p
Number of positive literals for node type.
bool empty(void) const
Test whether stack is empty.
Gecode::IntArgs i(4, 1, 2, 3, 4)
int n
Number of negative literals for node type.
~ConflictGraph(void)
Destructor.
Execution has resulted in failure.
bool adjacent(int i, int j) const
Test whether nodes i and j are adjacent.
Nodes(const NodeSet &ns)
Initialize for nodes in ns.
Clique cur
Current clique.
Clique(Region &r, int m)
Constructor for m nodes.
bool none(unsigned int sz) const
Test whether no bits are set.
void o(BitSetData a)
Perform "or" with a.
void init(Region &r, int n)
Initialize node set for n nodes.
unsigned int w
Weight (initialized with degree before graph is reduced)
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)
ExecStatus bk(NodeSet &p, NodeSet &x)
Run Bosch-Kerbron algorithm for finding max cliques.
void operator++(void)
Move iterator to next node (if possible)
bool in(int i) const
Test whether node i is included.
Passing integer variables.
void incl(int i)
Include node i.
void init(bool setbits=false)
Initialize with all bits set if setbits.
Node * x
Pointer to corresponding Boolean expression node.
void a(BitSetData a)
Perform "and" with a.
Stack with fixed number of elements.
Clique max
Largest clique so far.
T pop(void)
Pop topmost element from stack and return it.
unsigned int w
Weight of clique.
NodeSet n
Nodes in the clique.
void allocate(Region &r, int n)
Allocate node set for n nodes.
bool none(void) const
Whether no bits are set.
const IntVarArgs & b
Bin variables.
BitSetData * data
Stored bits.
struct Gecode::@518::NNF::@57::@58 b
For binary nodes (and, or, eqv)
Gecode toplevel namespace
int operator()(void) const
Return current node.
unsigned int bins
Number of bins.
NodeSet(void)
Keep uninitialized.
int pivot(const NodeSet &a, const NodeSet &b) const
Find a pivot node with maximal degree from a or b.
static ExecStatus post(Home home, View x0, View x1)
Post propagator .
#define GECODE_NEVER
Assert that this command is never executed.
void incl(int i, unsigned int w)
Include node i with weight w.
struct Gecode::@518::NNF::@57::@59 a
For atomic nodes.
void excl(int i, unsigned int w)
Exclude node i with weight w.
static bool iwn(NodeSet &iwa, const NodeSet &a, NodeSet &iwb, const NodeSet &b, const NodeSet &c, int n)