Generated on Fri Jan 28 2022 04:43:06 for Gecode by doxygen 1.8.13
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  }
49  operator ==(const FloatVal& l, const LinFloatExpr& r) {
50  return LinFloatRel(l,FRT_EQ,r);
51  }
53  operator ==(const FloatVar& l, const FloatVal& r) {
54  return LinFloatRel((const LinFloatExpr&)l,FRT_EQ,r);
55  }
57  operator ==(const LinFloatExpr& l, const FloatVal& r) {
58  return LinFloatRel(l,FRT_EQ,r);
59  }
61  operator ==(const FloatVar& l, const FloatVar& r) {
62  return LinFloatRel((const LinFloatExpr&)l,FRT_EQ,(const LinFloatExpr&)r);
63  }
65  operator ==(const FloatVar& l, const LinFloatExpr& r) {
66  return LinFloatRel((const LinFloatExpr&)l,FRT_EQ,r);
67  }
69  operator ==(const LinFloatExpr& l, const FloatVar& r) {
70  return LinFloatRel(l,FRT_EQ,(const LinFloatExpr&)r);
71  }
74  return LinFloatRel(l,FRT_EQ,r);
75  }
76 
78  operator !=(const FloatVal& l, const FloatVar& r) {
79  return LinFloatRel(l,FRT_NQ,(const LinFloatExpr&)r);
80  }
82  operator !=(const FloatVal& l, const LinFloatExpr& r) {
83  return LinFloatRel(l,FRT_NQ,r);
84  }
86  operator !=(const FloatVar& l, const FloatVal& r) {
87  return LinFloatRel((const LinFloatExpr&)l,FRT_NQ,r);
88  }
90  operator !=(const LinFloatExpr& l, const FloatVal& r) {
91  return LinFloatRel(l,FRT_NQ,r);
92  }
94  operator !=(const FloatVar& l, const FloatVar& r) {
95  return LinFloatRel((const LinFloatExpr&)l,FRT_NQ,(const LinFloatExpr&)r);
96  }
98  operator !=(const FloatVar& l, const LinFloatExpr& r) {
99  return LinFloatRel((const LinFloatExpr&)l,FRT_NQ,r);
100  }
102  operator !=(const LinFloatExpr& l, const FloatVar& r) {
103  return LinFloatRel(l,FRT_NQ,(const LinFloatExpr&)r);
104  }
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  }
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  }
173  return LinFloatRel(l,FRT_LE,r);
174  }
175 
177  operator >=(const FloatVal& l, const FloatVar& r) {
178  return LinFloatRel(l,FRT_GQ,(const LinFloatExpr&)r);
179  }
181  operator >=(const FloatVal& l, const LinFloatExpr& r) {
182  return LinFloatRel(l,FRT_GQ,r);
183  }
185  operator >=(const FloatVar& l, const FloatVal& r) {
186  return LinFloatRel((const LinFloatExpr&)l,FRT_GQ,r);
187  }
189  operator >=(const LinFloatExpr& l, const FloatVal& r) {
190  return LinFloatRel(l,FRT_GQ,r);
191  }
193  operator >=(const FloatVar& l, const FloatVar& r) {
194  return LinFloatRel((const LinFloatExpr&)l,FRT_GQ,(const LinFloatExpr&)r);
195  }
197  operator >=(const FloatVar& l, const LinFloatExpr& r) {
198  return LinFloatRel((const LinFloatExpr&)l,FRT_GQ,r);
199  }
201  operator >=(const LinFloatExpr& l, const FloatVar& r) {
202  return LinFloatRel(l,FRT_GQ,(const LinFloatExpr&)r);
203  }
206  return LinFloatRel(l,FRT_GQ,r);
207  }
208 
210  operator >(const FloatVal& l, const FloatVar& r) {
211  return LinFloatRel(l,FRT_GR,(const LinFloatExpr&)r);
212  }
214  operator >(const FloatVal& l, const LinFloatExpr& r) {
215  return LinFloatRel(l,FRT_GR,r);
216  }
218  operator >(const FloatVar& l, const FloatVal& r) {
219  return LinFloatRel((const LinFloatExpr&)l,FRT_GR,r);
220  }
222  operator >(const LinFloatExpr& l, const FloatVal& r) {
223  return LinFloatRel(l,FRT_GR,r);
224  }
226  operator >(const FloatVar& l, const FloatVar& r) {
227  return LinFloatRel((const LinFloatExpr&)l,FRT_GR,(const LinFloatExpr&)r);
228  }
230  operator >(const FloatVar& l, const LinFloatExpr& r) {
231  return LinFloatRel((const LinFloatExpr&)l,FRT_GR,r);
232  }
234  operator >(const LinFloatExpr& l, const FloatVar& r) {
235  return LinFloatRel(l,FRT_GR,(const LinFloatExpr&)r);
236  }
239  return LinFloatRel(l,FRT_GR,r);
240  }
241 
242 }
243 
244 #endif
245 
246 // STATISTICS: minimodel-any
NNF * l
Left subtree.
Definition: bool-expr.cpp:240
Disequality ( )
Definition: float.hh:1070
Less or equal ( )
Definition: float.hh:1071
Less ( )
Definition: float.hh:1072
Greater or equal ( )
Definition: float.hh:1073
Linear relations.
Definition: minimodel.hh:792
bool operator!=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:317
Float expressions
Definition: minimodel.hh:718
Equality ( )
Definition: float.hh:1069
Greater ( )
Definition: float.hh:1074
Post propagator for SetVar SetOpType SetVar SetRelType r
Definition: set.hh:767
Float value type.
Definition: float.hh:334
bool operator>=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:277
Float variables.
Definition: float.hh:870
bool operator>(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:260
bool operator<(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:226
bool operator==(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:294
bool operator<=(const FloatVal &x, const FloatVal &y)
Definition: val.hpp:243
Gecode toplevel namespace