main page
modules
namespaces
classes
files
Gecode home
Generated on Tue Jan 28 2020 00:00:00 for Gecode by
doxygen
1.8.17
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
* Last modified:
12
* $Date: 2012-04-06 13:04:47 +0200 (Fri, 06 Apr 2012) $ by $Author: schulte $
13
* $Revision: 12711 $
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
namespace
Gecode
{
namespace
Float {
41
42
/*
43
* Constructors and initialization
44
*
45
*/
46
forceinline
47
FloatView::FloatView
(
void
) {}
48
forceinline
49
FloatView::FloatView
(
const
FloatVar
&
y
)
50
:
VarImpView
<
FloatVar
>(
y
.varimp()) {}
51
forceinline
52
FloatView::FloatView
(
FloatVarImp
*
y
)
53
:
VarImpView
<
FloatVar
>(
y
) {}
54
55
/*
56
* Value access
57
*
58
*/
59
forceinline
FloatVal
60
FloatView::domain
(
void
)
const
{
61
return
x
->domain();
62
}
63
forceinline
FloatNum
64
FloatView::min
(
void
)
const
{
65
return
x
->min();
66
}
67
forceinline
FloatNum
68
FloatView::max
(
void
)
const
{
69
return
x
->max();
70
}
71
forceinline
FloatNum
72
FloatView::med
(
void
)
const
{
73
return
x
->med();
74
}
75
forceinline
FloatVal
76
FloatView::val
(
void
)
const
{
77
return
x
->val();
78
}
79
80
forceinline
FloatNum
81
FloatView::size
(
void
)
const
{
82
return
x
->size();
83
}
84
85
86
/*
87
* Domain tests
88
*
89
*/
90
forceinline
bool
91
FloatView::zero_in
(
void
)
const
{
92
return
x
->zero_in();
93
}
94
forceinline
bool
95
FloatView::in
(
FloatNum
n
)
const
{
96
return
x
->in(
n
);
97
}
98
forceinline
bool
99
FloatView::in
(
const
FloatVal
&
n
)
const
{
100
return
x
->in(
n
);
101
}
102
103
104
/*
105
* Domain update by value
106
*
107
*/
108
forceinline
ModEvent
109
FloatView::lq
(
Space
& home,
int
n
) {
110
return
x
->lq(home,
n
);
111
}
112
forceinline
ModEvent
113
FloatView::lq
(
Space
& home,
FloatNum
n
) {
114
return
x
->lq(home,
n
);
115
}
116
forceinline
ModEvent
117
FloatView::lq
(
Space
& home,
FloatVal
n
) {
118
return
x
->lq(home,
n
);
119
}
120
121
forceinline
ModEvent
122
FloatView::gq
(
Space
& home,
int
n
) {
123
return
x
->gq(home,
n
);
124
}
125
forceinline
ModEvent
126
FloatView::gq
(
Space
& home,
FloatNum
n
) {
127
return
x
->gq(home,
n
);
128
}
129
forceinline
ModEvent
130
FloatView::gq
(
Space
& home,
FloatVal
n
) {
131
return
x
->gq(home,
n
);
132
}
133
134
forceinline
ModEvent
135
FloatView::eq
(
Space
& home,
int
n
) {
136
return
x
->eq(home,
n
);
137
}
138
forceinline
ModEvent
139
FloatView::eq
(
Space
& home,
FloatNum
n
) {
140
return
x
->eq(home,
n
);
141
}
142
forceinline
ModEvent
143
FloatView::eq
(
Space
& home,
const
FloatVal
&
n
) {
144
return
x
->eq(home,
n
);
145
}
146
147
148
149
/*
150
* Delta information for advisors
151
*
152
*/
153
forceinline
FloatNum
154
FloatView::min
(
const
Delta
&
d
)
const
{
155
return
FloatVarImp::min
(
d
);
156
}
157
forceinline
FloatNum
158
FloatView::max
(
const
Delta
&
d
)
const
{
159
return
FloatVarImp::max
(
d
);
160
}
161
162
163
forceinline
ModEventDelta
164
FloatView::med
(
ModEvent
me) {
165
return
VarImpView<FloatVar>::med
(
me
);
166
}
167
168
}}
169
170
// STATISTICS: float-var
171
Gecode::VarImpView< FloatVar >::x
VarImpType * x
Pointer to variable implementation.
Definition:
view.hpp:131
Gecode::y
Post propagator for SetVar SetOpType SetVar y
Definition:
set.hh:784
Gecode::Float::FloatView::in
bool in(FloatNum n) const
Test whether n is contained in domain.
Definition:
float.hpp:95
forceinline
#define forceinline
Definition:
config.hpp:173
Gecode::Float::FloatView::val
FloatVal val(void) const
Return assigned value.
Definition:
float.hpp:76
Gecode::Float::FloatView::FloatView
FloatView(void)
Default constructor.
Definition:
float.hpp:47
Gecode::Float::FloatView::lq
ModEvent lq(Space &home, int n)
Restrict domain values to be less or equal than n.
Definition:
float.hpp:109
Gecode::Float::FloatView::med
FloatNum med(void) const
Return median of domain (closest representation)
Definition:
float.hpp:72
Gecode::Space
Computation spaces.
Definition:
core.hpp:1748
Gecode::Float::FloatVarImp::max
FloatNum max(void) const
Return maximum of domain.
Definition:
float.hpp:75
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:122
Gecode::Float::FloatView::min
FloatNum min(void) const
Return minimum of domain.
Definition:
float.hpp:64
Gecode::Float::FloatVarImp
Float variable implementation.
Definition:
var-imp.hpp:80
Gecode::Delta
Generic domain change information to be supplied to advisors.
Definition:
core.hpp:281
Gecode::VarImpView< FloatVar >::me
static ModEvent me(const ModEventDelta &med)
Return modification event for view type in med.
Gecode::Float::FloatView::size
FloatNum size(void) const
Return size of domain (distance between maximum and minimum)
Definition:
float.hpp:81
Gecode::FloatNum
double FloatNum
Floating point number base type.
Definition:
float.hh:110
Gecode::Float::FloatVarImp::min
FloatNum min(void) const
Return minimum of domain.
Definition:
float.hpp:71
Gecode::ModEvent
int ModEvent
Type for modification events.
Definition:
core.hpp:142
Gecode::FloatVal
Float value type.
Definition:
float.hh:338
Gecode::VarImpView::med
static ModEventDelta med(ModEvent me)
Translate modification event me to modification event delta for view.
Gecode::FloatVar
Float variables.
Definition:
float.hh:874
Test::Int::Distinct::d
Gecode::IntSet d(v, 7)
Gecode::Float::FloatView::max
FloatNum max(void) const
Return maximum of domain.
Definition:
float.hpp:68
Gecode::Float::FloatView::eq
ModEvent eq(Space &home, int n)
Restrict domain values to be equal to n.
Definition:
float.hpp:135
Gecode::Float::FloatView::domain
FloatVal domain(void) const
Return domain.
Definition:
float.hpp:60
Gecode::Float::FloatView::zero_in
bool zero_in(void) const
Test whether 0 is contained in domain.
Definition:
float.hpp:91
n
int n
Number of negative literals for node type.
Definition:
bool-expr.cpp:238
Gecode::ModEventDelta
int ModEventDelta
Modification event deltas.
Definition:
core.hpp:169
Gecode::VarImpView
Base-class for variable implementation views.
Definition:
view.hpp:123