main page
modules
namespaces
classes
files
Gecode home
Generated on Mon Feb 8 2021 00:00:00 for Gecode by
doxygen
1.8.20
test
branch.hh
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Mikael Lagerkvist <lagerkvist@gecode.org>
5
* Christian Schulte <schulte@gecode.org>
6
*
7
* Contributing authors:
8
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
9
*
10
* Copyright:
11
* Mikael Lagerkvist, 2006
12
* Christian Schulte, 2009
13
* Vincent Barichard, 2012
14
*
15
* This file is part of Gecode, the generic constraint
16
* development environment:
17
* http://www.gecode.org
18
*
19
* Permission is hereby granted, free of charge, to any person obtaining
20
* a copy of this software and associated documentation files (the
21
* "Software"), to deal in the Software without restriction, including
22
* without limitation the rights to use, copy, modify, merge, publish,
23
* distribute, sublicense, and/or sell copies of the Software, and to
24
* permit persons to whom the Software is furnished to do so, subject to
25
* the following conditions:
26
*
27
* The above copyright notice and this permission notice shall be
28
* included in all copies or substantial portions of the Software.
29
*
30
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
33
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
34
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
35
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
*
38
*/
39
40
#ifndef __GECODE_TEST_BRANCH_HH__
41
#define __GECODE_TEST_BRANCH_HH__
42
43
#include <
gecode/kernel.hh
>
44
45
#include <
gecode/int.hh
>
46
47
#ifdef GECODE_HAS_SET_VARS
48
#include <
gecode/set.hh
>
49
#endif
50
51
#ifdef GECODE_HAS_FLOAT_VARS
52
#include <
gecode/float.hh
>
53
#endif
54
55
#include "
test/test.hh
"
56
57
namespace
Test
{
58
60
namespace
Branch {
61
66
class
IntTest
:
public
Base
{
67
protected
:
69
int
arity
;
71
Gecode::IntSet
dom
;
72
public
:
74
IntTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
76
virtual
bool
run
(
void
);
78
virtual
void
post
(
Gecode::Space
& home,
Gecode::IntVarArray
&
x
) = 0;
79
};
80
85
class
BoolTest
:
public
Base
{
86
protected
:
88
int
arity
;
89
public
:
91
BoolTest
(
const
std::string& s,
int
a
);
93
virtual
bool
run
(
void
);
95
virtual
void
post
(
Gecode::Space
& home,
Gecode::BoolVarArray
&
x
) = 0;
96
};
97
98
#ifdef GECODE_HAS_SET_VARS
99
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
#endif
118
119
#ifdef GECODE_HAS_FLOAT_VARS
120
124
class
FloatTest
:
public
Base
{
125
protected
:
127
int
arity
;
129
Gecode::FloatVal
dom
;
131
int
nbSols
;
132
public
:
134
FloatTest
(
const
std::string& s,
int
a
,
const
Gecode::FloatVal
&
d
,
int
nbs);
136
virtual
bool
run
(
void
);
138
virtual
void
post
(
Gecode::Space
& home,
Gecode::FloatVarArray
&
x
) = 0;
139
};
140
#endif
141
142
}
143
144
}
145
146
#endif
147
148
// STATISTICS: test-branch
Test::Branch::FloatTest::FloatTest
FloatTest(const std::string &s, int a, const Gecode::FloatVal &d, int nbs)
Construct and register test.
Definition:
branch.cpp:898
kernel.hh
Test::Branch::FloatTest::nbSols
int nbSols
Maximum number of solutions searched during solving.
Definition:
branch.hh:131
Test::Branch::IntTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:435
Test::Branch::SetTest::dom
Gecode::IntSet dom
Domain of variables.
Definition:
branch.hh:108
int.hh
Test::Branch::FloatTest::dom
Gecode::FloatVal dom
Domain of variables.
Definition:
branch.hh:129
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Test::Branch::BoolTest::post
virtual void post(Gecode::Space &home, Gecode::BoolVarArray &x)=0
Post propagators on variables x.
Test::Branch::FloatTest
Base class for tests for branching on float variables
Definition:
branch.hh:124
Test::Branch::FloatTest::arity
int arity
Number of variables.
Definition:
branch.hh:127
Test::Branch::BoolTest
Base class for tests for branching on Boolean variables
Definition:
branch.hh:85
Gecode::IntVarArray
Integer variable array.
Definition:
int.hh:763
Test::Base
Base class for all tests to be run
Definition:
test.hh:103
Gecode::IntSet
Integer sets.
Definition:
int.hh:174
Test::Branch::SetTest::post
virtual void post(Gecode::Space &home, Gecode::SetVarArray &x)=0
Post propagators on variables x.
Test::Branch::BoolTest::arity
int arity
Number of variables.
Definition:
branch.hh:88
Gecode::BoolVarArray
Boolean variable array.
Definition:
int.hh:808
x
Node * x
Pointer to corresponding Boolean expression node.
Definition:
bool-expr.cpp:249
test.hh
float.hh
Test::Branch::FloatTest::post
virtual void post(Gecode::Space &home, Gecode::FloatVarArray &x)=0
Post propagators on variables x.
Test::Branch::SetTest::SetTest
SetTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition:
branch.cpp:735
Test::Branch::SetTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:740
Test::Branch::IntTest::IntTest
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition:
branch.cpp:430
Test::Branch::BoolTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:609
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Test::Branch::IntTest::post
virtual void post(Gecode::Space &home, Gecode::IntVarArray &x)=0
Post propagators on variables x.
Gecode::FloatVal
Float value type.
Definition:
float.hh:334
Test::Branch::FloatTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:903
Test::Branch::IntTest::arity
int arity
Number of variables.
Definition:
branch.hh:69
Test::Int::Distinct::d
Gecode::IntSet d(v, 7)
Test::Branch::BoolTest::BoolTest
BoolTest(const std::string &s, int a)
Construct and register test.
Definition:
branch.cpp:604
Test::Branch::SetTest::arity
int arity
Number of variables.
Definition:
branch.hh:106
Test::Branch::SetTest
Base class for tests for branching on set variables
Definition:
branch.hh:103
Gecode::FloatVarArray
Float variable array.
Definition:
float.hh:1030
set.hh
Test
General test support.
Definition:
afc.cpp:39
Test::Branch::IntTest::dom
Gecode::IntSet dom
Domain of variables.
Definition:
branch.hh:71
Gecode::SetVarArray
Set variable array
Definition:
set.hh:570
Test::Branch::IntTest
Base class for tests for branching on integer variables
Definition:
branch.hh:66