38namespace 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++)
69 auto f =
static_cast<std::function<
void(
Space&)
>>
70 ([](
Space& home) {
c(home); });
73 Gecode::wait(home, x, f);
75 Gecode::wait(home, x, &c);
78 Gecode::wait(home, x[0], f);
80 Gecode::wait(home, x[0], &c);
86 for (
int i=0; i<home.
x.
size(); i++)
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++)
114 for (
int i=
b.
size(); i--; )
115 b[i]=channel(home,
x[i]);
116 auto f =
static_cast<std::function<
void(
Space&)
>>
117 ([](
Space& home) {
c(home); });
120 Gecode::wait(home, b, f);
122 Gecode::wait(home, b, &c);
125 Gecode::wait(home, b[0], f);
127 Gecode::wait(home, b[0], &c);
134 for (
int i=0; i<home.
x.
size(); i++)
135 t += home.
x[i].val();
150 (sf0 ?
"std::function" :
"funptr"),1,0,1,false),
sf(sf0) {}
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); });
163 when(home, channel(home,
x[0]), sft, sfe);
165 when(home, channel(home,
x[0]), &
t, &
e);
struct Gecode::@603::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.
int size(void) const
Return size of array (number of elements)
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 fail(void)
Fail space.
Gecode toplevel namespace