main page
modules
namespaces
classes
files
Gecode home
Generated on Wed Jan 1 2020 10:37:59 for Gecode by
doxygen
1.8.16
gecode
float
view
float.hpp
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
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
6
*
7
* Copyright:
8
* Christian Schulte, 2002
9
* Vincent Barichard, 2012
10
*
11
* This file is part of Gecode, the generic constraint
12
* development environment:
13
* http://www.gecode.org
14
*
15
* Permission is hereby granted, free of charge, to any person obtaining
16
* a copy of this software and associated documentation files (the
17
* "Software"), to deal in the Software without restriction, including
18
* without limitation the rights to use, copy, modify, merge, publish,
19
* distribute, sublicense, and/or sell copies of the Software, and to
20
* permit persons to whom the Software is furnished to do so, subject to
21
* the following conditions:
22
*
23
* The above copyright notice and this permission notice shall be
24
* included in all copies or substantial portions of the Software.
25
*
26
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
28
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
30
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
31
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
32
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
*
34
*/
35
36
namespace
Gecode
{
namespace
Float {
37
38
/*
39
* Constructors and initialization
40
*
41
*/
42
forceinline
43
FloatView::FloatView
(
void
) {}
44
forceinline
45
FloatView::FloatView
(
const
FloatVar
&
y
)
46
:
VarImpView
<
FloatVar
>(
y
.varimp()) {}
47
forceinline
48
FloatView::FloatView
(
FloatVarImp
*
y
)
49
:
VarImpView
<
FloatVar
>(
y
) {}
50
51
/*
52
* Value access
53
*
54
*/
55
forceinline
FloatVal
56
FloatView::domain
(
void
)
const
{
57
return
x
->domain();
58
}
59
forceinline
FloatNum
60
FloatView::min
(
void
)
const
{
61
return
x
->min();
62
}
63
forceinline
FloatNum
64
FloatView::max
(
void
)
const
{
65
return
x
->max();
66
}
67
forceinline
FloatNum
68
FloatView::med
(
void
)
const
{
69
return
x
->med();
70
}
71
forceinline
FloatVal
72
FloatView::val
(
void
)
const
{
73
return
x
->val();
74
}
75
76
forceinline
FloatNum
77
FloatView::size
(
void
)
const
{
78
return
x
->size();
79
}
80
81
82
/*
83
* Domain tests
84
*
85
*/
86
forceinline
bool
87
FloatView::zero_in
(
void
)
const
{
88
return
x
->zero_in();
89
}
90
forceinline
bool
91
FloatView::in
(
FloatNum
n
)
const
{
92
return
x
->in(
n
);
93
}
94
forceinline
bool
95
FloatView::in
(
const
FloatVal
&
n
)
const
{
96
return
x
->in(
n
);
97
}
98
99
100
/*
101
* Domain update by value
102
*
103
*/
104
forceinline
ModEvent
105
FloatView::lq
(
Space
& home,
int
n
) {
106
return
x
->lq(home,
n
);
107
}
108
forceinline
ModEvent
109
FloatView::lq
(
Space
& home,
FloatNum
n
) {
110
return
x
->lq(home,
n
);
111
}
112
forceinline
ModEvent
113
FloatView::lq
(
Space
& home,
FloatVal
n
) {
114
return
x
->lq(home,
n
);
115
}
116
117
forceinline
ModEvent
118
FloatView::gq
(
Space
& home,
int
n
) {
119
return
x
->gq(home,
n
);
120
}
121
forceinline
ModEvent
122
FloatView::gq
(
Space
& home,
FloatNum
n
) {
123
return
x
->gq(home,
n
);
124
}
125
forceinline
ModEvent
126
FloatView::gq
(
Space
& home,
FloatVal
n
) {
127
return
x
->gq(home,
n
);
128
}
129
130
forceinline
ModEvent
131
FloatView::eq
(
Space
& home,
int
n
) {
132
return
x
->eq(home,
n
);
133
}
134
forceinline
ModEvent
135
FloatView::eq
(
Space
& home,
FloatNum
n
) {
136
return
x
->eq(home,
n
);
137
}
138
forceinline
ModEvent
139
FloatView::eq
(
Space
& home,
const
FloatVal
&
n
) {
140
return
x
->eq(home,
n
);
141
}
142
143
144
145
/*
146
* Delta information for advisors
147
*
148
*/
149
forceinline
FloatNum
150
FloatView::min
(
const
Delta
&
d
)
const
{
151
return
FloatVarImp::min
(
d
);
152
}
153
forceinline
FloatNum
154
FloatView::max
(
const
Delta
&
d
)
const
{
155
return
FloatVarImp::max
(
d
);
156
}
157
158
159
forceinline
ModEventDelta
160
FloatView::med
(
ModEvent
me) {
161
return
VarImpView<FloatVar>::med
(
me
);
162
}
163
164
}}
165
166
// STATISTICS: float-var
167
Gecode::VarImpView< FloatVar >::x
VarImpType * x
Pointer to variable implementation.
Definition:
view.hpp:141
Gecode::y
Post propagator for SetVar SetOpType SetVar y
Definition:
set.hh:767
Gecode::Float::FloatView::in
bool in(FloatNum n) const
Test whether n is contained in domain.
Definition:
float.hpp:91
Gecode::Float::FloatView::val
FloatVal val(void) const
Return assigned value.
Definition:
float.hpp:72
Gecode::Float::FloatView::FloatView
FloatView(void)
Default constructor.
Definition:
float.hpp:43
Gecode::Float::FloatView::lq
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
Definition:
float.hpp:105
Gecode::Float::FloatView::med
FloatNum med(void) const
Return median of domain (closest representation)
Definition:
float.hpp:68
Gecode::Space
Computation spaces.
Definition:
core.hpp:1742
Gecode::Float::FloatVarImp::max
FloatNum max(void) const
Return maximum of domain.
Definition:
float.hpp:71
Gecode
Gecode toplevel namespace
Gecode::Float::FloatView::gq
ModEvent gq(Space &home, int n)
Restrict domain values to be greater or equal than n.
Definition:
float.hpp:118
Gecode::Float::FloatView::min
FloatNum min(void) const
Return minimum of domain.
Definition:
float.hpp:60
Gecode::Float::FloatVarImp
Float variable implementation.
Definition:
var-imp.hpp:76
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition:
core.hpp:204
Gecode::VarImpView< FloatVar >::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Definition:
view.hpp:552
Gecode::Float::FloatView::size
FloatNum size(void) const
Return size of domain (distance between maximum and minimum)
Definition:
float.hpp:77
Gecode::FloatNum
double FloatNum
Floating point number base type.
Definition:
float.hh:106
Gecode::Float::FloatVarImp::min
FloatNum min(void) const
Return minimum of domain.
Definition:
float.hpp:67
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition:
core.hpp:62
Gecode::FloatVal
Float value type.
Definition:
float.hh:334
Gecode::FloatVar
Float variables.
Definition:
float.hh:870
Test::Int::Distinct::d
Gecode::IntSet d(v, 7)
Gecode::Float::FloatView::max
FloatNum max(void) const
Return maximum of domain.
Definition:
float.hpp:64
forceinline
#define forceinline
Definition:
config.hpp:185
Gecode::VarImpView::med
static ModEventDelta med(ModEvent me)
Translate modification event me to modification event delta for view.
Definition:
view.hpp:557
Gecode::Float::FloatView::eq
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
Definition:
float.hpp:131
Gecode::Float::FloatView::domain
FloatVal domain(void) const
Return domain.
Definition:
float.hpp:56
Gecode::Float::FloatView::zero_in
bool zero_in(void) const
Test whether 0 is contained in domain.
Definition:
float.hpp:87
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:234
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition:
core.hpp:89
Gecode::VarImpView
Base-class for variable implementation views.
Definition:
view.hpp:133