Generated on for Gecode by doxygen 1.15.0
int-arith.cpp
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.dev>
5 *
6 * Contributing authors:
7 * Alexander Shepil <alexander.shepil@sap.com>
8 * Mikael Zayenz Lagerkvist <lagerkvist@gecode.dev>
9 *
10 * Copyright:
11 * Christian Schulte, 2006
12 * Alexander Shepil, 2024
13 * Mikael Zayenz Lagerkvist, 2026
14 *
15 * This file is part of Gecode, the generic constraint
16 * development environment:
17 * http://www.gecode.dev
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#include <gecode/minimodel.hh>
41
42namespace Gecode { namespace MiniModel {
43
46 public:
65 int n;
67 int aInt;
71 static LinIntExpr* allocate(int n) {
72 if (n == 0)
73 return nullptr;
74 LinIntExpr* a = static_cast<LinIntExpr*>
75 (heap.ralloc(sizeof(LinIntExpr)*n));
76 for (int i=0; i<n; i++)
77 (void) new (a+i) LinIntExpr(LinIntExpr::NoNode());
78 return a;
79 }
80
82 : t(t0), b(), n(n0), aInt(0), a(allocate(n0)) {}
83
85 : t(t0), b(), n(n0), aInt(a0), a(allocate(n0)) {}
86
88 : t(t0), b(b0), n(n0), aInt(0), a(allocate(n0)) {}
89
91 if (a != nullptr)
92 heap.free<LinIntExpr>(a,n);
93 }
94
95 virtual IntVar post(Home home, IntVar* ret,
96 const IntPropLevels& ipls) const {
97 IntVar y;
98 switch (t) {
99 case ANLE_ABS:
100 {
101 IntVar x = a[0].post(home, ipls);
102 if (x.min() >= 0)
103 y = result(home,ret,x);
104 else {
105 y = result(home,ret);
106 abs(home, x, y, ipls.abs());
107 }
108 }
109 break;
110 case ANLE_MIN:
111 if (n==1) {
112 y = result(home,ret, a[0].post(home, ipls));
113 } else if (n==2) {
114 IntVar x0 = a[0].post(home, ipls);
115 IntVar x1 = a[1].post(home, ipls);
116 if (x0.max() <= x1.min())
117 y = result(home,ret,x0);
118 else if (x1.max() <= x0.min())
119 y = result(home,ret,x1);
120 else {
121 y = result(home,ret);
122 min(home, x0, x1, y, ipls.min2());
123 }
124 } else {
125 IntVarArgs x(n);
126 for (int i=n; i--;)
127 x[i] = a[i].post(home, ipls);
128 y = result(home,ret);
129 min(home, x, y, ipls.min());
130 }
131 break;
132 case ANLE_MAX:
133 if (n==1) {
134 y = result(home,ret,a[0].post(home, ipls));
135 } else if (n==2) {
136 IntVar x0 = a[0].post(home, ipls);
137 IntVar x1 = a[1].post(home, ipls);
138 if (x0.max() <= x1.min())
139 y = result(home,ret,x1);
140 else if (x1.max() <= x0.min())
141 y = result(home,ret,x0);
142 else {
143 y = result(home,ret);
144 max(home, x0, x1, y, ipls.max2());
145 }
146 } else {
147 IntVarArgs x(n);
148 for (int i=n; i--;)
149 x[i] = a[i].post(home, ipls);
150 y = result(home,ret);
151 max(home, x, y, ipls.max());
152 }
153 break;
154 case ANLE_MULT:
155 {
156 assert(n == 2);
157 IntVar x0 = a[0].post(home, ipls);
158 IntVar x1 = a[1].post(home, ipls);
159 if (x0.assigned() && (x0.val() == 0))
160 y = result(home,ret,x0);
161 else if (x0.assigned() && (x0.val() == 1))
162 y = result(home,ret,x1);
163 else if (x1.assigned() && (x1.val() == 0))
164 y = result(home,ret,x1);
165 else if (x1.assigned() && (x1.val() == 1))
166 y = result(home,ret,x0);
167 else {
168 y = result(home,ret);
169 mult(home, x0, x1, y, ipls.mult());
170 }
171 }
172 break;
173 case ANLE_DIV:
174 {
175 assert(n == 2);
176 IntVar x0 = a[0].post(home, ipls);
177 IntVar x1 = a[1].post(home, ipls);
178 rel(home, x1, IRT_NQ, 0);
179 if (x1.assigned() && (x1.val() == 1))
180 y = result(home,ret,x0);
181 else if (x0.assigned() && (x0.val() == 0))
182 y = result(home,ret,x0);
183 else {
184 y = result(home,ret);
185 div(home, x0, x1, y, ipls.div());
186 }
187 }
188 break;
189 case ANLE_MOD:
190 {
191 assert(n == 2);
192 IntVar x0 = a[0].post(home, ipls);
193 IntVar x1 = a[1].post(home, ipls);
194 y = result(home,ret);
195 mod(home, x0, x1, y, ipls.mod());
196 }
197 break;
198 case ANLE_SQR:
199 {
200 assert(n == 1);
201 IntVar x = a[0].post(home, ipls);
202 if (x.assigned() && ((x.val() == 0) || (x.val() == 1)))
203 y = result(home,ret,x);
204 else {
205 y = result(home,ret);
206 sqr(home, x, y, ipls.sqr());
207 }
208 }
209 break;
210 case ANLE_SQRT:
211 {
212 assert(n == 1);
213 IntVar x = a[0].post(home, ipls);
214 if (x.assigned() && ((x.val() == 0) || (x.val() == 1)))
215 y = result(home,ret,x);
216 else {
217 y = result(home,ret);
218 sqrt(home, x, y, ipls.sqrt());
219 }
220 }
221 break;
222 case ANLE_POW:
223 {
224 assert(n == 1);
225 IntVar x = a[0].post(home, ipls);
226 if (x.assigned() && (aInt > 0) &&
227 ((x.val() == 0) || (x.val() == 1)))
228 y = result(home,ret,x);
229 else {
230 y = result(home,ret);
231 pow(home, x, aInt, y, ipls.pow());
232 }
233 }
234 break;
235 case ANLE_NROOT:
236 {
237 assert(n == 1);
238 IntVar x = a[0].post(home, ipls);
239 if (x.assigned() && (aInt > 0) &&
240 ((x.val() == 0) || (x.val() == 1)))
241 y = result(home,ret,x);
242 else {
243 y = result(home,ret);
244 nroot(home, x, aInt, y, ipls.nroot());
245 }
246 }
247 break;
248 case ANLE_ELMNT:
249 {
250 IntVar z = a[n-1].post(home, ipls);
251 if (z.assigned() && z.val() >= 0 && z.val() < n-1) {
252 y = result(home,ret,a[z.val()].post(home, ipls));
253 } else {
254 IntVarArgs x(n-1);
255 bool assigned = true;
256 for (int i=n-1; i--;) {
257 x[i] = a[i].post(home, ipls);
258 if (!x[i].assigned())
259 assigned = false;
260 }
261 y = result(home,ret);
262 if (assigned) {
263 IntArgs xa(n-1);
264 for (int i=n-1; i--;)
265 xa[i] = x[i].val();
266 element(home, xa, z, y, ipls.element());
267 } else {
268 element(home, x, z, y, ipls.element());
269 }
270 }
271 }
272 break;
273 case ANLE_ITE:
274 {
275 assert(n == 2);
276 BoolVar c = b.expr(home, ipls);
277 IntVar x0 = a[0].post(home, ipls);
278 IntVar x1 = a[1].post(home, ipls);
279 y = result(home,ret);
280 ite(home, c, x0, x1, y, ipls.ite());
281 }
282 break;
283 default:
285 }
286 return y;
287 }
288 virtual void post(Home home, IntRelType irt, int c,
289 const IntPropLevels& ipls) const {
290 if ((t == ANLE_MIN && (irt == IRT_GQ || irt == IRT_GR)) ||
291 (t == ANLE_MAX && (irt == IRT_LQ || irt == IRT_LE)) ) {
292 IntVarArgs x(n);
293 for (int i=n; i--;)
294 x[i] = a[i].post(home, ipls);
295 rel(home, x, irt, c);
296 } else {
297 rel(home, post(home,nullptr,ipls), irt, c);
298 }
299 }
300 virtual void post(Home home, IntRelType irt, int c, BoolVar b,
301 const IntPropLevels& ipls) const {
302 rel(home, post(home,nullptr,ipls), irt, c, b);
303 }
304 };
305
307 return e.nle() &&
308 dynamic_cast<ArithNonLinIntExpr*>(e.nle()) != nullptr &&
309 dynamic_cast<ArithNonLinIntExpr*>(e.nle())->t == t;
310 }
311
313 private:
315 public:
318 delete e;
319 }
320 void release(void) {
321 e = nullptr;
322 }
323 };
324
325}}
326
327namespace Gecode {
328
330 abs(const LinIntExpr& e) {
331 using namespace MiniModel;
332 if (hasType(e, ArithNonLinIntExpr::ANLE_ABS))
333 return e;
334 ArithNonLinIntExpr* ae =
335 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ABS,1);
336 ArithNonLinIntExprGuard g(ae);
337 ae->a[0] = e;
338 g.release();
339 LinIntExpr r(ae);
340 return r;
341 }
342
343 LinIntExpr
344 min(const LinIntExpr& e0, const LinIntExpr& e1) {
345 using namespace MiniModel;
346 int n = 0;
347 if (hasType(e0, ArithNonLinIntExpr::ANLE_MIN))
348 n += static_cast<ArithNonLinIntExpr*>(e0.nle())->n;
349 else
350 n += 1;
351 if (hasType(e1, ArithNonLinIntExpr::ANLE_MIN))
352 n += static_cast<ArithNonLinIntExpr*>(e1.nle())->n;
353 else
354 n += 1;
355 ArithNonLinIntExpr* ae =
356 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MIN,n);
357 ArithNonLinIntExprGuard g(ae);
358 int i=0;
359 if (hasType(e0, ArithNonLinIntExpr::ANLE_MIN)) {
360 ArithNonLinIntExpr* e0e = static_cast<ArithNonLinIntExpr*>(e0.nle());
361 for (; i<e0e->n; i++)
362 ae->a[i] = e0e->a[i];
363 } else {
364 ae->a[i++] = e0;
365 }
366 if (hasType(e1, ArithNonLinIntExpr::ANLE_MIN)) {
367 ArithNonLinIntExpr* e1e = static_cast<ArithNonLinIntExpr*>(e1.nle());
368 int curN = i;
369 for (; i<curN+e1e->n; i++)
370 ae->a[i] = e1e->a[i-curN];
371 } else {
372 ae->a[i++] = e1;
373 }
374 g.release();
375 LinIntExpr r(ae);
376 return r;
377 }
378
379 LinIntExpr
380 max(const LinIntExpr& e0, const LinIntExpr& e1) {
381 using namespace MiniModel;
382 int n = 0;
383 if (hasType(e0, ArithNonLinIntExpr::ANLE_MAX))
384 n += static_cast<ArithNonLinIntExpr*>(e0.nle())->n;
385 else
386 n += 1;
387 if (hasType(e1, ArithNonLinIntExpr::ANLE_MAX))
388 n += static_cast<ArithNonLinIntExpr*>(e1.nle())->n;
389 else
390 n += 1;
391 ArithNonLinIntExpr* ae =
392 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MAX,n);
393 ArithNonLinIntExprGuard g(ae);
394 int i=0;
395 if (hasType(e0, ArithNonLinIntExpr::ANLE_MAX)) {
396 ArithNonLinIntExpr* e0e = static_cast<ArithNonLinIntExpr*>(e0.nle());
397 for (; i<e0e->n; i++)
398 ae->a[i] = e0e->a[i];
399 } else {
400 ae->a[i++] = e0;
401 }
402 if (hasType(e1, ArithNonLinIntExpr::ANLE_MAX)) {
403 ArithNonLinIntExpr* e1e = static_cast<ArithNonLinIntExpr*>(e1.nle());
404 int curN = i;
405 for (; i<curN+e1e->n; i++)
406 ae->a[i] = e1e->a[i-curN];
407 } else {
408 ae->a[i++] = e1;
409 }
410 g.release();
411 LinIntExpr r(ae);
412 return r;
413 }
414
415 LinIntExpr
416 min(const IntVarArgs& x) {
417 using namespace MiniModel;
418 ArithNonLinIntExpr* ae =
419 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MIN,x.size());
420 ArithNonLinIntExprGuard g(ae);
421 for (int i=x.size(); i--;)
422 ae->a[i] = x[i];
423 g.release();
424 LinIntExpr r(ae);
425 return r;
426 }
427
428 LinIntExpr
429 max(const IntVarArgs& x) {
430 using namespace MiniModel;
431 ArithNonLinIntExpr* ae =
432 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MAX,x.size());
433 ArithNonLinIntExprGuard g(ae);
434 for (int i=x.size(); i--;)
435 ae->a[i] = x[i];
436 g.release();
437 LinIntExpr r(ae);
438 return r;
439 }
440
441 LinIntExpr
442 operator *(const LinIntExpr& e0, const LinIntExpr& e1) {
443 using namespace MiniModel;
444 ArithNonLinIntExpr* ae =
445 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MULT,2);
446 ArithNonLinIntExprGuard g(ae);
447 ae->a[0] = e0;
448 ae->a[1] = e1;
449 g.release();
450 LinIntExpr r(ae);
451 return r;
452 }
453
454 LinIntExpr
455 sqr(const LinIntExpr& e) {
456 using namespace MiniModel;
457 ArithNonLinIntExpr* ae =
458 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_SQR,1);
459 ArithNonLinIntExprGuard g(ae);
460 ae->a[0] = e;
461 g.release();
462 LinIntExpr r(ae);
463 return r;
464 }
465
466 LinIntExpr
467 sqrt(const LinIntExpr& e) {
468 using namespace MiniModel;
469 ArithNonLinIntExpr* ae =
470 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_SQRT,1);
471 ArithNonLinIntExprGuard g(ae);
472 ae->a[0] = e;
473 g.release();
474 LinIntExpr r(ae);
475 return r;
476 }
477
478 LinIntExpr
479 pow(const LinIntExpr& e, int n) {
480 using namespace MiniModel;
481 ArithNonLinIntExpr* ae =
482 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_POW,1,n);
483 ArithNonLinIntExprGuard g(ae);
484 ae->a[0] = e;
485 g.release();
486 LinIntExpr r(ae);
487 return r;
488 }
489
490 LinIntExpr
491 nroot(const LinIntExpr& e, int n) {
492 using namespace MiniModel;
493 ArithNonLinIntExpr* ae =
494 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_NROOT,1,n);
495 ArithNonLinIntExprGuard g(ae);
496 ae->a[0] = e;
497 g.release();
498 LinIntExpr r(ae);
499 return r;
500 }
501
502 LinIntExpr
503 operator /(const LinIntExpr& e0, const LinIntExpr& e1) {
504 using namespace MiniModel;
505 ArithNonLinIntExpr* ae =
506 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_DIV,2);
507 ArithNonLinIntExprGuard g(ae);
508 ae->a[0] = e0;
509 ae->a[1] = e1;
510 g.release();
511 LinIntExpr r(ae);
512 return r;
513 }
514
515 LinIntExpr
516 operator %(const LinIntExpr& e0, const LinIntExpr& e1) {
517 using namespace MiniModel;
518 ArithNonLinIntExpr* ae =
519 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_MOD,2);
520 ArithNonLinIntExprGuard g(ae);
521 ae->a[0] = e0;
522 ae->a[1] = e1;
523 g.release();
524 LinIntExpr r(ae);
525 return r;
526 }
527
528 LinIntExpr
529 element(const IntVarArgs& x, const LinIntExpr& e) {
530 using namespace MiniModel;
531 ArithNonLinIntExpr* ae =
532 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ELMNT,x.size()+1);
533 ArithNonLinIntExprGuard g(ae);
534 for (int i=x.size(); i--;)
535 ae->a[i] = x[i];
536 ae->a[x.size()] = e;
537 g.release();
538 LinIntExpr r(ae);
539 return r;
540 }
541
542 LinIntExpr
543 element(const IntArgs& x, const LinIntExpr& e) {
544 using namespace MiniModel;
545 ArithNonLinIntExpr* ae =
546 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ELMNT,x.size()+1);
547 ArithNonLinIntExprGuard g(ae);
548 for (int i=x.size(); i--;)
549 ae->a[i] = x[i];
550 ae->a[x.size()] = e;
551 g.release();
552 LinIntExpr r(ae);
553 return r;
554 }
555
556 LinIntExpr
557 ite(const BoolExpr& b, const LinIntExpr& e0, const LinIntExpr& e1) {
558 using namespace MiniModel;
559 ArithNonLinIntExpr* ae =
560 new ArithNonLinIntExpr(ArithNonLinIntExpr::ANLE_ITE,2,b);
561 ArithNonLinIntExprGuard g(ae);
562 ae->a[0] = e0;
563 ae->a[1] = e1;
564 g.release();
565 LinIntExpr r(ae);
566 return r;
567 }
568
569}
570
571// STATISTICS: minimodel-any
T * a
Element array.
Definition array.hpp:548
int n
Number of elements.
Definition array.hpp:544
int size(void) const
Return size of array (number of elements).
Definition array.hpp:1597
Boolean expressions.
Boolean integer variables.
Definition int.hh:533
Home class for posting propagators
Definition core.hpp:863
Passing integer arguments.
Definition int.hh:652
Class for specifying integer propagation levels used by minimodel.
Definition minimodel.hh:109
IntPropLevel div(void) const
Return integer propagation level for division constraints.
Definition ipl.hpp:114
IntPropLevel element(void) const
Return integer propagation level for element constraints.
Definition ipl.hpp:164
IntPropLevel mod(void) const
Return integer propagation level for modulo constraints.
Definition ipl.hpp:122
IntPropLevel max2(void) const
Return integer propagation level for binary maximum constraints.
Definition ipl.hpp:73
IntPropLevel ite(void) const
Return integer propagation level for if-then-else constraints.
Definition ipl.hpp:173
IntPropLevel mult(void) const
Return integer propagation level for multiplication constraints.
Definition ipl.hpp:106
IntPropLevel min(void) const
Return integer propagation level for non-binary minimum constraints.
Definition ipl.hpp:97
IntPropLevel nroot(void) const
Return integer propagation level for root constraints.
Definition ipl.hpp:155
IntPropLevel abs(void) const
Return integer propagation level for absolute value constraints.
Definition ipl.hpp:64
IntPropLevel sqrt(void) const
Return integer propagation level for square root constraints.
Definition ipl.hpp:139
IntPropLevel min2(void) const
Return integer propagation level for binary minimum constraints.
Definition ipl.hpp:89
IntPropLevel pow(void) const
Return integer propagation level for power constraints.
Definition ipl.hpp:147
IntPropLevel max(void) const
Return integer propagation level for non-binary maximum constraints.
Definition ipl.hpp:81
IntPropLevel sqr(void) const
Return integer propagation level for square constraints.
Definition ipl.hpp:131
Passing integer variables.
Definition int.hh:680
Integer variables.
Definition int.hh:389
int min(void) const
Return minimum of domain.
Definition int.hpp:62
int val(void) const
Return assigned value.
Definition int.hpp:56
int max(void) const
Return maximum of domain.
Definition int.hpp:70
Linear expressions over integer variables.
Definition minimodel.hh:257
NonLinIntExpr * nle(void) const
Return non-linear expression inside, or null if not non-linear.
Definition int-expr.cpp:394
ArithNonLinIntExprGuard(ArithNonLinIntExpr *e0)
Non-linear arithmetic expressions over integer variables.
Definition int-arith.cpp:45
static LinIntExpr * allocate(int n)
Allocate internal expression slots without public default nodes.
Definition int-arith.cpp:71
virtual void post(Home home, IntRelType irt, int c, const IntPropLevels &ipls) const
Post expression to be in relation irt with c.
BoolExpr b
Boolean expression argument (used in ite for example).
Definition int-arith.cpp:63
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0)
Constructor.
Definition int-arith.cpp:81
int aInt
Integer argument (used in nroot for example).
Definition int-arith.cpp:67
virtual void post(Home home, IntRelType irt, int c, BoolVar b, const IntPropLevels &ipls) const
Post reified expression to be in relation irt with c.
enum Gecode::MiniModel::ArithNonLinIntExpr::ArithNonLinIntExprType t
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, int a0)
Constructor.
Definition int-arith.cpp:84
ArithNonLinIntExprType
The expression type.
Definition int-arith.cpp:48
@ ANLE_MULT
Multiplication expression.
Definition int-arith.cpp:52
@ ANLE_SQRT
Square root expression.
Definition int-arith.cpp:56
@ ANLE_ABS
Absolute value expression.
Definition int-arith.cpp:49
@ ANLE_ITE
If-then-else expression.
Definition int-arith.cpp:60
virtual IntVar post(Home home, IntVar *ret, const IntPropLevels &ipls) const
Post expression.
Definition int-arith.cpp:95
ArithNonLinIntExpr(ArithNonLinIntExprType t0, int n0, const BoolExpr &b0)
Constructor.
Definition int-arith.cpp:87
int n
Size of variable array.
Definition int-arith.cpp:65
Base class for non-linear expressions over integer variables.
Definition minimodel.hh:223
static IntVar result(Home home, IntVar *x)
Return fresh variable if x is null, x otherwise.
Definition int-expr.hpp:40
bool assigned(void) const
Test whether view is assigned.
Definition var.hpp:111
Heap heap
The single global heap.
Definition heap.cpp:44
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
void ite(Home home, BoolVar b, FloatVar x, FloatVar y, FloatVar z)
Post propagator for if-then-else constraint.
Definition bool.cpp:39
IntRelType
Relation types for integers.
Definition int.hh:959
@ IRT_NQ
Disequality ( ).
Definition int.hh:961
@ IRT_GQ
Greater or equal ( ).
Definition int.hh:964
@ IRT_LE
Less ( ).
Definition int.hh:963
@ IRT_GR
Greater ( ).
Definition int.hh:965
@ IRT_LQ
Less or equal ( ).
Definition int.hh:962
#define GECODE_MINIMODEL_EXPORT
Definition minimodel.hh:86
Minimalistic modeling support.
Definition minimodel.hh:100
bool hasType(const LinFloatExpr &e, ArithNonLinFloatExpr::ArithNonLinFloatExprType t)
Check if e is of type t.
Gecode toplevel namespace
FloatVal operator/(const FloatVal &x, const FloatVal &y)
Definition val.hpp:230
void mod(Home home, IntVar x0, IntVar x1, IntVar x2, IntPropLevel ipl=IPL_DEF)
Post propagator for .
void sqr(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void min(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void abs(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void div(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void element(Home home, IntSharedArray n, IntVar x0, IntVar x1, IntPropLevel ipl=IPL_DEF)
Post domain consistent propagator for .
Definition element.cpp:39
void mult(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void sqrt(Home home, FloatVar x0, FloatVar x1)
Post propagator for .
void max(Home home, FloatVar x0, FloatVar x1, FloatVar x2)
Post propagator for .
void pow(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for .
FloatVal operator*(const FloatVal &x, const FloatVal &y)
Definition val.hpp:217
void nroot(Home home, FloatVar x0, int n, FloatVar x1)
Post propagator for for .
LinIntExpr operator%(const LinIntExpr &x, const LinIntExpr &y)
Return expression for .
#define GECODE_NEVER
Assert that this command is never executed.
Definition macros.hpp:56