main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Jan 28 2020 00:00:00 for Gecode by
doxygen
1.8.17
test
assign.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Christian Schulte <schulte@gecode.org>
5
*
6
* Contributing authors:
7
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
8
*
9
* Copyright:
10
* Christian Schulte, 2008
11
* Vincent Barichard, 2012
12
*
13
* Last modified:
14
* $Date: 2012-04-05 12:00:11 +0200 (Thu, 05 Apr 2012) $ by $Author: vbarichard $
15
* $Revision: 12703 $
16
*
17
* This file is part of Gecode, the generic constraint
18
* development environment:
19
* http://www.gecode.org
20
*
21
* Permission is hereby granted, free of charge, to any person obtaining
22
* a copy of this software and associated documentation files (the
23
* "Software"), to deal in the Software without restriction, including
24
* without limitation the rights to use, copy, modify, merge, publish,
25
* distribute, sublicense, and/or sell copies of the Software, and to
26
* permit persons to whom the Software is furnished to do so, subject to
27
* the following conditions:
28
*
29
* The above copyright notice and this permission notice shall be
30
* included in all copies or substantial portions of the Software.
31
*
32
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
33
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
36
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
37
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
38
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39
*
40
*/
41
42
#ifndef __GECODE_TEST_ASSIGN_HH__
43
#define __GECODE_TEST_ASSIGN_HH__
44
45
#include <
gecode/kernel.hh
>
46
#include <
gecode/int.hh
>
47
#ifdef GECODE_HAS_SET_VARS
48
#include <
gecode/set.hh
>
49
#endif
50
#ifdef GECODE_HAS_FLOAT_VARS
51
#include <
gecode/float.hh
>
52
#endif
53
54
#include "
test/test.hh
"
55
56
namespace
Test
{
57
59
namespace
Assign {
60
65
class
IntTest
:
public
Base
{
66
protected
:
68
int
arity
;
70
Gecode::IntSet
dom
;
71
public
:
73
IntTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
75
virtual
bool
run
(
void
);
77
virtual
void
post
(
Gecode::Space
& home,
Gecode::IntVarArray
&
x
) = 0;
78
};
79
84
class
BoolTest
:
public
Base
{
85
protected
:
87
int
arity
;
88
public
:
90
BoolTest
(
const
std::string& s,
int
a
);
92
virtual
bool
run
(
void
);
94
virtual
void
post
(
Gecode::Space
& home,
Gecode::BoolVarArray
&
x
) = 0;
95
};
96
97
#ifdef GECODE_HAS_SET_VARS
98
103
class
SetTest
:
public
Base
{
104
protected
:
106
int
arity
;
108
Gecode::IntSet
dom
;
109
public
:
111
SetTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
113
virtual
bool
run
(
void
);
115
virtual
void
post
(
Gecode::Space
& home,
Gecode::SetVarArray
&
x
) = 0;
116
};
117
118
#endif
119
120
#ifdef GECODE_HAS_FLOAT_VARS
121
126
class
FloatTest
:
public
Base
{
127
protected
:
129
int
arity
;
131
Gecode::FloatVal
dom
;
132
public
:
134
FloatTest
(
const
std::string& s,
int
a
,
const
Gecode::FloatVal
&
d
);
136
virtual
bool
run
(
void
);
138
virtual
void
post
(
Gecode::Space
& home,
Gecode::FloatVarArray
&
x
) = 0;
139
};
140
141
#endif
142
143
}
144
145
}
146
147
#endif
148
149
// STATISTICS: test-branch
kernel.hh
Test::Assign::IntTest::dom
Gecode::IntSet dom
Domain of variables.
Definition:
assign.hh:70
Test::Assign::SetTest
Base class for tests for branching on set variables
Definition:
assign.hh:103
Test::Assign::IntTest::run
virtual bool run(void)
Perform test.
Test::Assign::BoolTest::arity
int arity
Number of variables.
Definition:
assign.hh:87
int.hh
Test::Assign::IntTest::IntTest
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Test::Assign::BoolTest
Base class for tests for branching on Boolean variables
Definition:
assign.hh:84
Test::Assign::FloatTest::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post assignment on variables x.
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
Test::Assign::IntTest::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post assignment on variables x.
Test::Assign::SetTest::arity
int arity
Number of variables.
Definition:
assign.hh:106
Gecode::IntVarArray
Integer variable array.
Definition:
int.hh:744
Test::Assign::FloatTest::FloatTest
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d)
Construct and register test.
Test::Assign::SetTest::run
virtual bool run(void)
Perform test.
Test::Base
Base class for all tests to be run
Definition:
test.hh:107
Gecode::IntSet
Integer sets.
Definition:
int.hh:174
Test::Assign::SetTest::post
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post assignment on variables x.
Gecode::BoolVarArray
Boolean variable array.
Definition:
int.hh:789
x
Node * x
Pointer to corresponding Boolean expression node.
Definition:
bool-expr.cpp:253
Test::Assign::FloatTest::arity
int arity
Number of variables.
Definition:
assign.hh:129
test.hh
float.hh
a
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
Test::Assign::BoolTest::BoolTest
BoolTest(const std::string &s, int a)
Construct and register test.
Test::Assign::IntTest
Base class for tests for assigning integer variables
Definition:
assign.hh:65
Test::Assign::SetTest::dom
Gecode::IntSet dom
Upper bound of variable domains.
Definition:
assign.hh:108
Test::Assign::FloatTest::dom
Gecode::FloatVal dom
Domain of variables.
Definition:
assign.hh:131
Test::Assign::FloatTest::run
virtual bool run(void)
Perform test.
Gecode::FloatVal
Float value type.
Definition:
float.hh:338
Test::Assign::BoolTest::post
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post assignment on variables x.
Test::Assign::BoolTest::run
virtual bool run(void)
Perform test.
Test::Assign::FloatTest
Base class for tests for branching on float variables
Definition:
assign.hh:126
Test::Int::Distinct::d
Gecode::IntSet d(v, 7)
Test::Assign::IntTest::arity
int arity
Number of variables.
Definition:
assign.hh:68
Test::Assign::SetTest::SetTest
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Gecode::FloatVarArray
Float variable array.
Definition:
float.hh:1031
set.hh
Test
General test support.
Definition:
afc.cpp:43
Gecode::SetVarArray
Set variable array
Definition:
set.hh:572