34#ifndef __GECODE_SEARCH_RELAX_HH__
35#define __GECODE_SEARCH_RELAX_HH__
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 size(void) const
Return size of array (number of elements).
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
TFE post(PropagatorGroup g)
Only post functions (but not propagators) from g are considered.
@ ES_OK
Execution is okay.