38 #ifndef __GECODE_SEARCH_RELAX_HH__ 39 #define __GECODE_SEARCH_RELAX_HH__ 44 namespace Gecode {
namespace Search {
47 template<
class VarArgs,
class Post>
49 relax(Home home,
const VarArgs&
x,
const VarArgs& sx, Rnd
r,
50 double p, Post&
post);
53 template<
class VarArgs,
class Post>
56 double p, Post&
post) {
63 for (
int i=x.
size();
i--; )
65 static_cast<unsigned int>(p *
static_cast<double>(UINT_MAX)))
66 ax.
set(static_cast<unsigned int>(
i));
69 ax.
clear(r(static_cast<unsigned int>(x.size())));
bool all(void) const
Test whether all bits are set.
int size(void) const
Return size of array (number of elements)
void clear(unsigned int i)
Clear bit i.
Value iterator for values in a bitset.
int p
Number of positive literals for node type.
Gecode::IntArgs i(4, 1, 2, 3, 4)
bool failed(void) const
Check whether corresponding space is failed.
void set(unsigned int i)
Set bit i.
Post propagator for SetVar SetOpType SetVar SetRelType r
Post propagator for SetVar x
Gecode toplevel namespace
Home class for posting propagators
void relax(Home home, const VarArgs &x, const VarArgs &sx, Rnd r, double p, Post &post)
Relax variables in x from solution sx with probability p.
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.