main page
modules
namespaces
classes
files
Gecode home
Generated on Fri Jan 10 2020 11:38:25 for Gecode by
doxygen
1.8.16
gecode
minimodel
float-rel.cpp
Go to the documentation of this file.
1
/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
/*
3
* Main authors:
4
* Vincent Barichard <Vincent.Barichard@univ-angers.fr>
5
*
6
* Copyright:
7
* Vincent Barichard, 2012
8
*
9
* This file is part of Gecode, the generic constraint
10
* development environment:
11
* http://www.gecode.org
12
*
13
* Permission is hereby granted, free of charge, to any person obtaining
14
* a copy of this software and associated documentation files (the
15
* "Software"), to deal in the Software without restriction, including
16
* without limitation the rights to use, copy, modify, merge, publish,
17
* distribute, sublicense, and/or sell copies of the Software, and to
18
* permit persons to whom the Software is furnished to do so, subject to
19
* the following conditions:
20
*
21
* The above copyright notice and this permission notice shall be
22
* included in all copies or substantial portions of the Software.
23
*
24
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
*
32
*/
33
34
#include <
gecode/minimodel.hh
>
35
36
#ifdef GECODE_HAS_FLOAT_VARS
37
38
namespace
Gecode
{
39
40
/*
41
* Construction of linear float relations
42
*
43
*/
44
LinFloatRel
45
operator ==
(
const
FloatVal
&
l
,
const
FloatVar
&
r
) {
46
return
LinFloatRel
(
l
,
FRT_EQ
,(
const
LinFloatExpr
&)
r
);
47
}
48
LinFloatRel
49
operator ==
(
const
FloatVal
&
l
,
const
LinFloatExpr
&
r
) {
50
return
LinFloatRel
(
l
,
FRT_EQ
,
r
);
51
}
52
LinFloatRel
53
operator ==
(
const
FloatVar
&
l
,
const
FloatVal
&
r
) {
54
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_EQ
,
r
);
55
}
56
LinFloatRel
57
operator ==
(
const
LinFloatExpr
&
l
,
const
FloatVal
&
r
) {
58
return
LinFloatRel
(
l
,
FRT_EQ
,
r
);
59
}
60
LinFloatRel
61
operator ==
(
const
FloatVar
&
l
,
const
FloatVar
&
r
) {
62
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_EQ
,(
const
LinFloatExpr
&)
r
);
63
}
64
LinFloatRel
65
operator ==
(
const
FloatVar
&
l
,
const
LinFloatExpr
&
r
) {
66
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_EQ
,
r
);
67
}
68
LinFloatRel
69
operator ==
(
const
LinFloatExpr
&
l
,
const
FloatVar
&
r
) {
70
return
LinFloatRel
(
l
,
FRT_EQ
,(
const
LinFloatExpr
&)
r
);
71
}
72
LinFloatRel
73
operator ==
(
const
LinFloatExpr
&
l
,
const
LinFloatExpr
&
r
) {
74
return
LinFloatRel
(
l
,
FRT_EQ
,
r
);
75
}
76
77
LinFloatRel
78
operator !=
(
const
FloatVal
&
l
,
const
FloatVar
&
r
) {
79
return
LinFloatRel
(
l
,
FRT_NQ
,(
const
LinFloatExpr
&)
r
);
80
}
81
LinFloatRel
82
operator !=
(
const
FloatVal
&
l
,
const
LinFloatExpr
&
r
) {
83
return
LinFloatRel
(
l
,
FRT_NQ
,
r
);
84
}
85
LinFloatRel
86
operator !=
(
const
FloatVar
&
l
,
const
FloatVal
&
r
) {
87
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_NQ
,
r
);
88
}
89
LinFloatRel
90
operator !=
(
const
LinFloatExpr
&
l
,
const
FloatVal
&
r
) {
91
return
LinFloatRel
(
l
,
FRT_NQ
,
r
);
92
}
93
LinFloatRel
94
operator !=
(
const
FloatVar
&
l
,
const
FloatVar
&
r
) {
95
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_NQ
,(
const
LinFloatExpr
&)
r
);
96
}
97
LinFloatRel
98
operator !=
(
const
FloatVar
&
l
,
const
LinFloatExpr
&
r
) {
99
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_NQ
,
r
);
100
}
101
LinFloatRel
102
operator !=
(
const
LinFloatExpr
&
l
,
const
FloatVar
&
r
) {
103
return
LinFloatRel
(
l
,
FRT_NQ
,(
const
LinFloatExpr
&)
r
);
104
}
105
LinFloatRel
106
operator !=
(
const
LinFloatExpr
&
l
,
const
LinFloatExpr
&
r
) {
107
return
LinFloatRel
(
l
,
FRT_NQ
,
r
);
108
}
109
110
LinFloatRel
111
operator <=
(
const
FloatVal
&
l
,
const
FloatVar
&
r
) {
112
return
LinFloatRel
(
l
,
FRT_LQ
,(
const
LinFloatExpr
&)
r
);
113
}
114
LinFloatRel
115
operator <=
(
const
FloatVal
&
l
,
const
LinFloatExpr
&
r
) {
116
return
LinFloatRel
(
l
,
FRT_LQ
,
r
);
117
}
118
LinFloatRel
119
operator <=
(
const
FloatVar
&
l
,
const
FloatVal
&
r
) {
120
return
LinFloatRel
(
l
,
FRT_LQ
,
r
);
121
}
122
LinFloatRel
123
operator <=
(
const
LinFloatExpr
&
l
,
const
FloatVal
&
r
) {
124
return
LinFloatRel
(
l
,
FRT_LQ
,
r
);
125
}
126
LinFloatRel
127
operator <=
(
const
FloatVar
&
l
,
const
FloatVar
&
r
) {
128
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_LQ
,(
const
LinFloatExpr
&)
r
);
129
}
130
LinFloatRel
131
operator <=
(
const
FloatVar
&
l
,
const
LinFloatExpr
&
r
) {
132
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_LQ
,
r
);
133
}
134
LinFloatRel
135
operator <=
(
const
LinFloatExpr
&
l
,
const
FloatVar
&
r
) {
136
return
LinFloatRel
(
l
,
FRT_LQ
,(
const
LinFloatExpr
&)
r
);
137
}
138
LinFloatRel
139
operator <=
(
const
LinFloatExpr
&
l
,
const
LinFloatExpr
&
r
) {
140
return
LinFloatRel
(
l
,
FRT_LQ
,
r
);
141
}
142
143
LinFloatRel
144
operator <
(
const
FloatVal
&
l
,
const
FloatVar
&
r
) {
145
return
LinFloatRel
(
l
,
FRT_LE
,(
const
LinFloatExpr
&)
r
);
146
}
147
LinFloatRel
148
operator <
(
const
FloatVal
&
l
,
const
LinFloatExpr
&
r
) {
149
return
LinFloatRel
(
l
,
FRT_LE
,
r
);
150
}
151
LinFloatRel
152
operator <
(
const
FloatVar
&
l
,
const
FloatVal
&
r
) {
153
return
LinFloatRel
(
l
,
FRT_LE
,
r
);
154
}
155
LinFloatRel
156
operator <
(
const
LinFloatExpr
&
l
,
const
FloatVal
&
r
) {
157
return
LinFloatRel
(
l
,
FRT_LE
,
r
);
158
}
159
LinFloatRel
160
operator <
(
const
FloatVar
&
l
,
const
FloatVar
&
r
) {
161
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_LE
,(
const
LinFloatExpr
&)
r
);
162
}
163
LinFloatRel
164
operator <
(
const
FloatVar
&
l
,
const
LinFloatExpr
&
r
) {
165
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_LE
,
r
);
166
}
167
LinFloatRel
168
operator <
(
const
LinFloatExpr
&
l
,
const
FloatVar
&
r
) {
169
return
LinFloatRel
(
l
,
FRT_LE
,(
const
LinFloatExpr
&)
r
);
170
}
171
LinFloatRel
172
operator <
(
const
LinFloatExpr
&
l
,
const
LinFloatExpr
&
r
) {
173
return
LinFloatRel
(
l
,
FRT_LE
,
r
);
174
}
175
176
LinFloatRel
177
operator >=
(
const
FloatVal
&
l
,
const
FloatVar
&
r
) {
178
return
LinFloatRel
(
l
,
FRT_GQ
,(
const
LinFloatExpr
&)
r
);
179
}
180
LinFloatRel
181
operator >=
(
const
FloatVal
&
l
,
const
LinFloatExpr
&
r
) {
182
return
LinFloatRel
(
l
,
FRT_GQ
,
r
);
183
}
184
LinFloatRel
185
operator >=
(
const
FloatVar
&
l
,
const
FloatVal
&
r
) {
186
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_GQ
,
r
);
187
}
188
LinFloatRel
189
operator >=
(
const
LinFloatExpr
&
l
,
const
FloatVal
&
r
) {
190
return
LinFloatRel
(
l
,
FRT_GQ
,
r
);
191
}
192
LinFloatRel
193
operator >=
(
const
FloatVar
&
l
,
const
FloatVar
&
r
) {
194
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_GQ
,(
const
LinFloatExpr
&)
r
);
195
}
196
LinFloatRel
197
operator >=
(
const
FloatVar
&
l
,
const
LinFloatExpr
&
r
) {
198
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_GQ
,
r
);
199
}
200
LinFloatRel
201
operator >=
(
const
LinFloatExpr
&
l
,
const
FloatVar
&
r
) {
202
return
LinFloatRel
(
l
,
FRT_GQ
,(
const
LinFloatExpr
&)
r
);
203
}
204
LinFloatRel
205
operator >=
(
const
LinFloatExpr
&
l
,
const
LinFloatExpr
&
r
) {
206
return
LinFloatRel
(
l
,
FRT_GQ
,
r
);
207
}
208
209
LinFloatRel
210
operator >
(
const
FloatVal
&
l
,
const
FloatVar
&
r
) {
211
return
LinFloatRel
(
l
,
FRT_GR
,(
const
LinFloatExpr
&)
r
);
212
}
213
LinFloatRel
214
operator >
(
const
FloatVal
&
l
,
const
LinFloatExpr
&
r
) {
215
return
LinFloatRel
(
l
,
FRT_GR
,
r
);
216
}
217
LinFloatRel
218
operator >
(
const
FloatVar
&
l
,
const
FloatVal
&
r
) {
219
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_GR
,
r
);
220
}
221
LinFloatRel
222
operator >
(
const
LinFloatExpr
&
l
,
const
FloatVal
&
r
) {
223
return
LinFloatRel
(
l
,
FRT_GR
,
r
);
224
}
225
LinFloatRel
226
operator >
(
const
FloatVar
&
l
,
const
FloatVar
&
r
) {
227
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_GR
,(
const
LinFloatExpr
&)
r
);
228
}
229
LinFloatRel
230
operator >
(
const
FloatVar
&
l
,
const
LinFloatExpr
&
r
) {
231
return
LinFloatRel
((
const
LinFloatExpr
&)
l
,
FRT_GR
,
r
);
232
}
233
LinFloatRel
234
operator >
(
const
LinFloatExpr
&
l
,
const
FloatVar
&
r
) {
235
return
LinFloatRel
(
l
,
FRT_GR
,(
const
LinFloatExpr
&)
r
);
236
}
237
LinFloatRel
238
operator >
(
const
LinFloatExpr
&
l
,
const
LinFloatExpr
&
r
) {
239
return
LinFloatRel
(
l
,
FRT_GR
,
r
);
240
}
241
242
}
243
244
#endif
245
246
// STATISTICS: minimodel-any
Gecode::FRT_LE
Less ( )
Definition:
float.hh:1072
Gecode::FRT_NQ
Disequality ( )
Definition:
float.hh:1070
minimodel.hh
Gecode::operator<
bool operator<(const FloatVal &x, const FloatVal &y)
Definition:
val.hpp:226
Gecode::FRT_GR
Greater ( )
Definition:
float.hh:1074
Gecode
Gecode toplevel namespace
Gecode::operator>
bool operator>(const FloatVal &x, const FloatVal &y)
Definition:
val.hpp:260
Gecode::operator>=
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition:
val.hpp:277
Gecode::r
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition:
set.hh:767
Gecode::FRT_LQ
Less or equal ( )
Definition:
float.hh:1071
Gecode::LinFloatRel
Linear relations.
Definition:
minimodel.hh:896
Gecode::operator!=
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition:
val.hpp:317
Gecode::operator<=
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition:
val.hpp:243
Gecode::FRT_EQ
Equality ( )
Definition:
float.hh:1069
Gecode::FloatVal
Float value type.
Definition:
float.hh:334
Gecode::FloatVar
Float variables.
Definition:
float.hh:870
Gecode::LinFloatExpr
Float expressions
Definition:
minimodel.hh:822
l
NNF * l
Left subtree.
Definition:
bool-expr.cpp:240
Gecode::FRT_GQ
Greater or equal ( )
Definition:
float.hh:1073
Gecode::operator==
bool operator==(const FloatVal &x, const FloatVal &y)
Definition:
val.hpp:294