34 #ifndef __GECODE_SEARCH_RELAX_HH__
35 #define __GECODE_SEARCH_RELAX_HH__
40 namespace Gecode {
namespace Search {
43 template<
class VarArgs,
class Post>
45 relax(Home home,
const VarArgs&
x,
const VarArgs& sx, Rnd
r,
46 double p, Post&
post);
49 template<
class VarArgs,
class Post>
52 double p, Post&
post) {
59 for (
int i=0;
i<
x.size();
i++)
61 static_cast<unsigned int>(
p *
static_cast<double>(UINT_MAX)))
62 ax.
set(
static_cast<unsigned int>(
i));
65 ax.
clear(
r(
static_cast<unsigned int>(
x.size())));
int p
Number of positive literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
Home class for posting propagators
bool failed(void) const
Check whether corresponding space is failed.
Value iterator for values in a bitset.
bool all(void) const
Test whether all bits are set.
void clear(unsigned int i)
Clear bit i.
void set(unsigned int i)
Set bit i.
@ ES_OK
Execution is okay.
void post(Home home, Term *t, int n, FloatRelType frt, FloatVal c)
Post propagator for linear constraint over floats.
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.
Gecode::IntArgs i({1, 2, 3, 4})