38 namespace Test {
namespace Int {
57 (sf0 ?
"std::function" :
"funptr"),
n,0,
n,false),
sf(sf0) {}
60 for (
int i=0;
i<
x.size();
i++)
61 for (
int j=
i+1; j<
x.size(); j++)
68 using namespace Gecode;
69 auto f =
static_cast<std::function<
void(
Space&)
>>
70 ([](
Space& home) {
c(home); });
87 for (
int j=
i+1; j<home.
x.
size(); j++)
88 if (home.
x[
i].val() == home.
x[j].val())
102 (sf0 ?
"std::function" :
"funptr"),
n,0,1,false),
sf(sf0) {}
106 for (
int i=0;
i<
x.size();
i++)
112 using namespace Gecode;
114 for (
int i=
b.size();
i--; )
116 auto f =
static_cast<std::function<
void(
Space&)
>>
117 ([](
Space& home) {
c(home); });
135 t += home.
x[
i].val();
150 (sf0 ?
"std::function" :
"funptr"),1,0,1,false),
sf(sf0) {}
157 using namespace Gecode;
159 auto sft =
static_cast<std::function<
void(
Space&)
>>
160 ([](
Space& home) {
t(home); });
161 auto sfe =
static_cast<std::function<
void(
Space&)
>>
162 ([](
Space& home) { e(home); });
struct Gecode::@602::NNF::@65::@66 b
For binary nodes (and, or, eqv)
int n
Number of negative literals for node type.
Node * x
Pointer to corresponding Boolean expression node.
Passing Boolean variables.
int size(void) const
Return size of array (number of elements)
Base class for assignments
Simple test for wait (Boolean variables)
bool sf
Whether to use std::function.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post wait on x.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
static void c(Gecode::Space &_home)
Continuation to be executed.
BoolWait(int n, bool sf0)
Create and register test.
Simple test for wait (integer variables)
IntWait(int n, bool sf0)
Create and register test.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post wait on x.
bool sf
Whether to use std::function.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
static void c(Gecode::Space &_home)
Continuation to be executed.
static void t(Gecode::Space &home)
Then-function to be executed.
bool sf
Whether to use std::function.
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)
Post when on x.
virtual bool solution(const Assignment &x) const
Check whether x is solution.
When(bool sf0)
Create and register test.
static void e(Gecode::Space &home)
Else-function to be executed.
Space for executing tests.
Gecode::IntVarArray x
Variables to be tested.
static std::string str(Gecode::IntPropLevel ipl)
Map integer propagation level to string.
void channel(Home home, FloatVar x0, IntVar x1)
Post propagator for channeling a float and an integer variable .
void wait(Home home, FloatVar x, std::function< void(Space &home)> c)
Execute c when x becomes assigned.
void when(Home home, BoolVar x, std::function< void(Space &home)> t, std::function< void(Space &home)> e, IntPropLevel)
Execute t (then) when x is assigned one, and e (else) otherwise.
void fail(void)
Fail space.
Gecode::IntArgs i({1, 2, 3, 4})