Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
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
38namespace 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
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
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
66 return LinFloatRel((const LinFloatExpr&)l,FRT_EQ,r);
67 }
68 LinFloatRel
70 return LinFloatRel(l,FRT_EQ,(const LinFloatExpr&)r);
71 }
72 LinFloatRel
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
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
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
99 return LinFloatRel((const LinFloatExpr&)l,FRT_NQ,r);
100 }
101 LinFloatRel
103 return LinFloatRel(l,FRT_NQ,(const LinFloatExpr&)r);
104 }
105 LinFloatRel
107 return LinFloatRel(l,FRT_NQ,r);
108 }
109
111 operator <=(const FloatVal& l, const FloatVar& r) {
112 return LinFloatRel(l,FRT_LQ,(const LinFloatExpr&)r);
113 }
115 operator <=(const FloatVal& l, const LinFloatExpr& r) {
116 return LinFloatRel(l,FRT_LQ,r);
117 }
119 operator <=(const FloatVar& l, const FloatVal& r) {
120 return LinFloatRel(l,FRT_LQ,r);
121 }
123 operator <=(const LinFloatExpr& l, const FloatVal& r) {
124 return LinFloatRel(l,FRT_LQ,r);
125 }
127 operator <=(const FloatVar& l, const FloatVar& r) {
128 return LinFloatRel((const LinFloatExpr&)l,FRT_LQ,(const LinFloatExpr&)r);
129 }
131 operator <=(const FloatVar& l, const LinFloatExpr& r) {
132 return LinFloatRel((const LinFloatExpr&)l,FRT_LQ,r);
133 }
135 operator <=(const LinFloatExpr& l, const FloatVar& r) {
136 return LinFloatRel(l,FRT_LQ,(const LinFloatExpr&)r);
137 }
139 operator <=(const LinFloatExpr& l, const LinFloatExpr& r) {
140 return LinFloatRel(l,FRT_LQ,r);
141 }
142
144 operator <(const FloatVal& l, const FloatVar& r) {
145 return LinFloatRel(l,FRT_LE,(const LinFloatExpr&)r);
146 }
148 operator <(const FloatVal& l, const LinFloatExpr& r) {
149 return LinFloatRel(l,FRT_LE,r);
150 }
152 operator <(const FloatVar& l, const FloatVal& r) {
153 return LinFloatRel(l,FRT_LE,r);
154 }
156 operator <(const LinFloatExpr& l, const FloatVal& r) {
157 return LinFloatRel(l,FRT_LE,r);
158 }
160 operator <(const FloatVar& l, const FloatVar& r) {
161 return LinFloatRel((const LinFloatExpr&)l,FRT_LE,(const LinFloatExpr&)r);
162 }
164 operator <(const FloatVar& l, const LinFloatExpr& r) {
165 return LinFloatRel((const LinFloatExpr&)l,FRT_LE,r);
166 }
168 operator <(const LinFloatExpr& l, const FloatVar& r) {
169 return LinFloatRel(l,FRT_LE,(const LinFloatExpr&)r);
170 }
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
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
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
198 return LinFloatRel((const LinFloatExpr&)l,FRT_GQ,r);
199 }
200 LinFloatRel
202 return LinFloatRel(l,FRT_GQ,(const LinFloatExpr&)r);
203 }
204 LinFloatRel
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
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
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
231 return LinFloatRel((const LinFloatExpr&)l,FRT_GR,r);
232 }
233 LinFloatRel
235 return LinFloatRel(l,FRT_GR,(const LinFloatExpr&)r);
236 }
237 LinFloatRel
239 return LinFloatRel(l,FRT_GR,r);
240 }
241
242}
243
244#endif
245
246// STATISTICS: minimodel-any
NNF * l
Left subtree.
Float value type.
Definition float.hh:334
Float variables.
Definition float.hh:870
Float expressions
Definition minimodel.hh:822
Linear relations.
Definition minimodel.hh:896
@ FRT_EQ
Equality ( )
Definition float.hh:1069
@ FRT_GR
Greater ( )
Definition float.hh:1074
@ FRT_NQ
Disequality ( )
Definition float.hh:1070
@ FRT_LE
Less ( )
Definition float.hh:1072
@ FRT_LQ
Less or equal ( )
Definition float.hh:1071
@ FRT_GQ
Greater or equal ( )
Definition float.hh:1073
Gecode toplevel namespace
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition val.hpp:243
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition set.hh:767
bool operator<(const FloatVal &x, const FloatVal &y)
Definition val.hpp:226
bool operator>(const FloatVal &x, const FloatVal &y)
Definition val.hpp:260
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition val.hpp:277
bool operator==(const FloatVal &x, const FloatVal &y)
Definition val.hpp:294
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition val.hpp:317