34#ifndef __GECODE_SEARCH_RELAX_HH__
35#define __GECODE_SEARCH_RELAX_HH__
40namespace 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())));
67 if (
post(home,
x[i.val()], sx[i.val()]) !=
ES_OK) {
int p
Number of positive literals for node type.
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.
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 toplevel namespace
Post propagator for SetVar SetOpType SetVar SetRelType r
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
@ ES_OK
Execution is okay.
Post propagator for SetVar x