main page
modules
namespaces
classes
files
Gecode home
Generated on Sun Aug 9 2020 05:34:08 for Gecode by
doxygen
1.8.18
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
* This file is part of Gecode, the generic constraint
14
* development environment:
15
* http://www.gecode.org
16
*
17
* Permission is hereby granted, free of charge, to any person obtaining
18
* a copy of this software and associated documentation files (the
19
* "Software"), to deal in the Software without restriction, including
20
* without limitation the rights to use, copy, modify, merge, publish,
21
* distribute, sublicense, and/or sell copies of the Software, and to
22
* permit persons to whom the Software is furnished to do so, subject to
23
* the following conditions:
24
*
25
* The above copyright notice and this permission notice shall be
26
* included in all copies or substantial portions of the Software.
27
*
28
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
*
36
*/
37
38
#ifndef __GECODE_TEST_ASSIGN_HH__
39
#define __GECODE_TEST_ASSIGN_HH__
40
41
#include <
gecode/kernel.hh
>
42
#include <
gecode/int.hh
>
43
#ifdef GECODE_HAS_SET_VARS
44
#include <
gecode/set.hh
>
45
#endif
46
#ifdef GECODE_HAS_FLOAT_VARS
47
#include <
gecode/float.hh
>
48
#endif
49
50
#include "
test/test.hh
"
51
52
namespace
Test
{
53
55
namespace
Assign {
56
61
class
IntTest
:
public
Base
{
62
protected
:
64
int
arity
;
66
Gecode::IntSet
dom
;
67
public
:
69
IntTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
71
virtual
bool
run
(
void
);
73
virtual
void
post
(
Gecode::Space
& home,
Gecode::IntVarArray
&
x
) = 0;
74
};
75
80
class
BoolTest
:
public
Base
{
81
protected
:
83
int
arity
;
84
public
:
86
BoolTest
(
const
std::string& s,
int
a
);
88
virtual
bool
run
(
void
);
90
virtual
void
post
(
Gecode::Space
& home,
Gecode::BoolVarArray
&
x
) = 0;
91
};
92
93
#ifdef GECODE_HAS_SET_VARS
94
99
class
SetTest
:
public
Base
{
100
protected
:
102
int
arity
;
104
Gecode::IntSet
dom
;
105
public
:
107
SetTest
(
const
std::string& s,
int
a
,
const
Gecode::IntSet
&
d
);
109
virtual
bool
run
(
void
);
111
virtual
void
post
(
Gecode::Space
& home,
Gecode::SetVarArray
&
x
) = 0;
112
};
113
114
#endif
115
116
#ifdef GECODE_HAS_FLOAT_VARS
117
122
class
FloatTest
:
public
Base
{
123
protected
:
125
int
arity
;
127
Gecode::FloatVal
dom
;
128
public
:
130
FloatTest
(
const
std::string& s,
int
a
,
const
Gecode::FloatVal
&
d
);
132
virtual
bool
run
(
void
);
134
virtual
void
post
(
Gecode::Space
& home,
Gecode::FloatVarArray
&
x
) = 0;
135
};
136
137
#endif
138
139
}
140
141
}
142
143
#endif
144
145
// STATISTICS: test-branch
kernel.hh
Test::Assign::IntTest::dom
Gecode::IntSet dom
Domain of variables.
Definition:
assign.hh:66
Test::Assign::SetTest
Base class for tests for branching on set variables
Definition:
assign.hh:99
Test::Assign::IntTest::run
virtual bool run(void)
Perform test.
Test::Assign::BoolTest::arity
int arity
Number of variables.
Definition:
assign.hh:83
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:80
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:1742
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:102
Gecode::IntVarArray
Integer variable array.
Definition:
int.hh:763
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:103
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:808
x
Node * x
Pointer to corresponding Boolean expression node.
Definition:
bool-expr.cpp:249
Test::Assign::FloatTest::arity
int arity
Number of variables.
Definition:
assign.hh:125
test.hh
float.hh
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:61
Test::Assign::SetTest::dom
Gecode::IntSet dom
Upper bound of variable domains.
Definition:
assign.hh:104
Test::Assign::FloatTest::dom
Gecode::FloatVal dom
Domain of variables.
Definition:
assign.hh:127
Test::Assign::FloatTest::run
virtual bool run(void)
Perform test.
a
struct Gecode::@602::NNF::@65::@67 a
For atomic nodes.
Gecode::FloatVal
Float value type.
Definition:
float.hh:334
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:122
Test::Int::Distinct::d
Gecode::IntSet d(v, 7)
Test::Assign::IntTest::arity
int arity
Number of variables.
Definition:
assign.hh:64
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:1030
set.hh
Test
General test support.
Definition:
afc.cpp:39
Gecode::SetVarArray
Set variable array
Definition:
set.hh:570