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
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
* Last modified:
16
* $Date: 2012-04-05 12:00:11 +0200 (Thu, 05 Apr 2012) $ by $Author: vbarichard $
17
* $Revision: 12703 $
18
*
19
* This file is part of Gecode, the generic constraint
20
* development environment:
21
* http://www.gecode.org
22
*
23
* Permission is hereby granted, free of charge, to any person obtaining
24
* a copy of this software and associated documentation files (the
25
* "Software"), to deal in the Software without restriction, including
26
* without limitation the rights to use, copy, modify, merge, publish,
27
* distribute, sublicense, and/or sell copies of the Software, and to
28
* permit persons to whom the Software is furnished to do so, subject to
29
* the following conditions:
30
*
31
* The above copyright notice and this permission notice shall be
32
* included in all copies or substantial portions of the Software.
33
*
34
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
*
42
*/
43
44
#ifndef __GECODE_TEST_BRANCH_HH__
45
#define __GECODE_TEST_BRANCH_HH__
46
47
#include <
gecode/kernel.hh
>
48
49
#include <
gecode/int.hh
>
50
51
#ifdef GECODE_HAS_SET_VARS
52
#include <
gecode/set.hh
>
53
#endif
54
55
#ifdef GECODE_HAS_FLOAT_VARS
56
#include <
gecode/float.hh
>
57
#endif
58
59
#include "
test/test.hh
"
60
61
namespace
Test
{
62
64
namespace
Branch {
65
70
class
IntTest
:
public
Base
{
71
protected
:
73
int
arity
;
75
Gecode::IntSet
dom
;
76
public
:
78
IntTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
80
virtual
bool
run
(
void
);
82
virtual
void
post
(
Gecode::Space
& home,
Gecode::IntVarArray
&
x
) = 0;
83
};
84
89
class
BoolTest
:
public
Base
{
90
protected
:
92
int
arity
;
93
public
:
95
BoolTest
(
const
std::string& s,
int
a
);
97
virtual
bool
run
(
void
);
99
virtual
void
post
(
Gecode::Space
& home,
Gecode::BoolVarArray
&
x
) = 0;
100
};
101
102
#ifdef GECODE_HAS_SET_VARS
103
107
class
SetTest
:
public
Base
{
108
protected
:
110
int
arity
;
112
Gecode::IntSet
dom
;
113
public
:
115
SetTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
117
virtual
bool
run
(
void
);
119
virtual
void
post
(
Gecode::Space
& home,
Gecode::SetVarArray
&
x
) = 0;
120
};
121
#endif
122
123
#ifdef GECODE_HAS_FLOAT_VARS
124
128
class
FloatTest
:
public
Base
{
129
protected
:
131
int
arity
;
133
Gecode::FloatVal
dom
;
135
int
nbSols
;
136
public
:
138
FloatTest
(
const
std::string& s,
int
a
,
const
Gecode::FloatVal
&
d
,
int
nbs);
140
virtual
bool
run
(
void
);
142
virtual
void
post
(
Gecode::Space
& home,
Gecode::FloatVarArray
&
x
) = 0;
143
};
144
#endif
145
146
}
147
148
}
149
150
#endif
151
152
// 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:902
kernel.hh
Test::Branch::FloatTest::nbSols
int nbSols
Maximum number of solutions searched during solving.
Definition:
branch.hh:135
Test::Branch::IntTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:439
Test::Branch::SetTest::dom
Gecode::IntSet dom
Domain of variables.
Definition:
branch.hh:112
int.hh
Test::Branch::FloatTest::dom
Gecode::FloatVal dom
Domain of variables.
Definition:
branch.hh:133
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
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:128
Test::Branch::FloatTest::arity
int arity
Number of variables.
Definition:
branch.hh:131
Test::Branch::BoolTest
Base class for tests for branching on Boolean variables
Definition:
branch.hh:89
Gecode::IntVarArray
Integer variable array.
Definition:
int.hh:744
Test::Base
Base class for all tests to be run
Definition:
test.hh:107
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:92
Gecode::BoolVarArray
Boolean variable array.
Definition:
int.hh:789
x
Node * x
Pointer to corresponding Boolean expression node.
Definition:
bool-expr.cpp:253
test.hh
float.hh
a
struct Gecode::@579::NNF::@61::@63 a
For atomic nodes.
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:739
Test::Branch::SetTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:744
Test::Branch::IntTest::IntTest
IntTest(const std::string &s, int a, const Gecode::IntSet &d)
Construct and register test.
Definition:
branch.cpp:434
Test::Branch::BoolTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:613
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:338
Test::Branch::FloatTest::run
virtual bool run(void)
Perform test.
Definition:
branch.cpp:907
Test::Branch::IntTest::arity
int arity
Number of variables.
Definition:
branch.hh:73
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:608
Test::Branch::SetTest::arity
int arity
Number of variables.
Definition:
branch.hh:110
Test::Branch::SetTest
Base class for tests for branching on set variables
Definition:
branch.hh:107
Gecode::FloatVarArray
Float variable array.
Definition:
float.hh:1031
set.hh
Test
General test support.
Definition:
afc.cpp:43
Test::Branch::IntTest::dom
Gecode::IntSet dom
Domain of variables.
Definition:
branch.hh:75
Gecode::SetVarArray
Set variable array
Definition:
set.hh:572
Test::Branch::IntTest
Base class for tests for branching on integer variables
Definition:
branch.hh:70