Scippy

SCIP

Solving Constraint Integer Programs

intervalarith.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip/intervalarith.h
17  * @brief interval arithmetics for provable bounds
18  * @author Tobias Achterberg
19  * @author Stefan Vigerske
20  * @author Kati Wolter
21  */
22 
23 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
24 
25 #ifndef __SCIP_INTERVALARITH_H__
26 #define __SCIP_INTERVALARITH_H__
27 
28 
29 #include "scip/def.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 /** interval given by infimum and supremum */
37 {
38  SCIP_Real inf; /**< infimum (lower bound) of interval */
39  SCIP_Real sup; /**< supremum (upper bound) of interval */
40 };
42 
43 /** rounding mode of floating point operations (upwards, downwards, nearest, ...)
44  * exact values depend on machine and compiler, so we define a corresponding enum in the header file */
45 typedef int SCIP_ROUNDMODE;
46 
47 /*
48  * Interval arithmetic operations
49  */
50 
51 /** returns whether rounding mode control is available */
52 extern
54  void
55  );
56 
57 /** sets rounding mode of floating point operations */
58 extern
60  SCIP_ROUNDMODE roundmode /**< rounding mode to activate */
61  );
62 
63 /** gets current rounding mode of floating point operations */
64 extern
65 SCIP_ROUNDMODE SCIPintervalGetRoundingMode(
66  void
67  );
68 
69 /** sets rounding mode of floating point operations to downwards rounding */
70 extern
72  void
73  );
74 
75 /** sets rounding mode of floating point operations to upwards rounding */
76 extern
78  void
79  );
80 
81 /** sets rounding mode of floating point operations to nearest rounding */
82 extern
84  void
85  );
86 
87 /** sets rounding mode of floating point operations to towards zero rounding */
88 extern
90  void
91  );
92 
93 /** negates a number in a way that the compiler does not optimize it away */
94 extern
96  SCIP_Real x /**< number to negate */
97  );
98 
99 /** returns infimum of interval */
100 extern
102  SCIP_INTERVAL interval /**< interval */
103  );
104 
105 /** returns supremum of interval */
106 extern
108  SCIP_INTERVAL interval /**< interval */
109  );
110 
111 /** stores given value as interval */
112 extern
113 void SCIPintervalSet(
114  SCIP_INTERVAL* resultant, /**< interval to store value into */
115  SCIP_Real value /**< value to store */
116  );
117 
118 /** stores given infimum and supremum as interval */
119 extern
121  SCIP_INTERVAL* resultant, /**< interval to store value into */
122  SCIP_Real inf, /**< value to store as infimum */
123  SCIP_Real sup /**< value to store as supremum */
124  );
125 
126 /** sets interval to empty interval, which will be [1.0, -1.0] */
127 extern
129  SCIP_INTERVAL* resultant /**< resultant interval of operation */
130  );
131 
132 /** indicates whether interval is empty, i.e., whether inf > sup */
133 extern
135  SCIP_Real infinity, /**< value for infinity */
136  SCIP_INTERVAL operand /**< operand of operation */
137  );
138 
139 /** sets interval to entire [-infinity, +infinity] */
140 extern
142  SCIP_Real infinity, /**< value for infinity */
143  SCIP_INTERVAL* resultant /**< resultant interval of operation */
144  );
145 
146 /** indicates whether interval is entire, i.e., whether inf <= -infinity and sup >= infinity */
147 extern
149  SCIP_Real infinity, /**< value for infinity */
150  SCIP_INTERVAL operand /**< operand of operation */
151  );
152 
153 /** indicates whether interval is positive infinity, i.e., [infinity, infinity] */
154 extern
156  SCIP_Real infinity, /**< value for infinity */
157  SCIP_INTERVAL operand /**< operand of operation */
158  );
159 
160 /** indicates whether interval is negative infinity, i.e., [-infinity, -infinity] */
161 extern
163  SCIP_Real infinity, /**< value for infinity */
164  SCIP_INTERVAL operand /**< operand of operation */
165  );
166 
167 #ifdef NDEBUG
168 
169 /* In optimized mode, some function calls are overwritten by defines to reduce the number of function calls and
170  * speed up the algorithms.
171  * With SCIPintervalSetBounds we need to be a bit careful, since i and s could use resultant->inf and resultant->sup,
172  * e.g., SCIPintervalSetBounds(&resultant, -resultant->sup, -resultant->inf).
173  * So we need to make sure that we first evaluate both terms before setting resultant.
174  */
175 
176 #define SCIPintervalGetInf(interval) (interval).inf
177 #define SCIPintervalGetSup(interval) (interval).sup
178 #define SCIPintervalSet(resultant, value) do { (resultant)->inf = (value); (resultant)->sup = (resultant)->inf; } while( FALSE )
179 #define SCIPintervalSetBounds(resultant, i, s) do { SCIP_Real scipintervaltemp; scipintervaltemp = (s); (resultant)->inf = (i); (resultant)->sup = scipintervaltemp; } while( FALSE )
180 #define SCIPintervalSetEmpty(resultant) do { (resultant)->inf = 1.0; (resultant)->sup = -1.0; } while( FALSE )
181 #define SCIPintervalSetEntire(infinity, resultant) do { (resultant)->inf = -(infinity); (resultant)->sup = (infinity); } while( FALSE )
182 #define SCIPintervalIsEmpty(infinity, operand) ( (operand).inf > -(infinity) && (operand).sup < (infinity) && (operand).sup < (operand).inf )
183 #define SCIPintervalIsEntire(infinity, operand) ( (operand).inf <= -(infinity) && (operand).sup >= (infinity) )
184 #define SCIPintervalIsPositiveInfinity(infinity, operand) ( (operand).inf >= (infinity) && (operand).sup >= (operand).inf )
185 #define SCIPintervalIsNegativeInfinity(infinity, operand) ( (operand).sup <= -(infinity) && (operand).sup >= (operand).inf )
186 
187 #endif
188 
189 /** indicates whether operand1 is contained in operand2 */
190 extern
192  SCIP_Real infinity, /**< value for infinity */
193  SCIP_INTERVAL operand1, /**< first operand of operation */
194  SCIP_INTERVAL operand2 /**< second operand of operation */
195  );
196 
197 /** indicates whether operand1 and operand2 are disjoint */
198 extern
200  SCIP_INTERVAL operand1, /**< first operand of operation */
201  SCIP_INTERVAL operand2 /**< second operand of operation */
202  );
203 
204 /** intersection of two intervals */
205 extern
207  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
208  SCIP_INTERVAL operand1, /**< first operand of operation */
209  SCIP_INTERVAL operand2 /**< second operand of operation */
210  );
211 
212 /** interval enclosure of the union of two intervals */
213 extern
214 void SCIPintervalUnify(
215  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
216  SCIP_INTERVAL operand1, /**< first operand of operation */
217  SCIP_INTERVAL operand2 /**< second operand of operation */
218  );
219 
220 /** adds operand1 and operand2 and stores infimum of result in infimum of resultant */
221 extern
222 void SCIPintervalAddInf(
223  SCIP_Real infinity, /**< value for infinity */
224  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
225  SCIP_INTERVAL operand1, /**< first operand of operation */
226  SCIP_INTERVAL operand2 /**< second operand of operation */
227  );
228 
229 /** adds operand1 and operand2 and stores supremum of result in supremum of resultant */
230 extern
231 void SCIPintervalAddSup(
232  SCIP_Real infinity, /**< value for infinity */
233  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
234  SCIP_INTERVAL operand1, /**< first operand of operation */
235  SCIP_INTERVAL operand2 /**< second operand of operation */
236  );
237 
238 /** adds operand1 and operand2 and stores result in resultant */
239 extern
240 void SCIPintervalAdd(
241  SCIP_Real infinity, /**< value for infinity */
242  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
243  SCIP_INTERVAL operand1, /**< first operand of operation */
244  SCIP_INTERVAL operand2 /**< second operand of operation */
245  );
246 
247 /** adds operand1 and scalar operand2 and stores result in resultant */
248 extern
250  SCIP_Real infinity, /**< value for infinity */
251  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
252  SCIP_INTERVAL operand1, /**< first operand of operation */
253  SCIP_Real operand2 /**< second operand of operation */
254  );
255 
256 /** adds vector operand1 and vector operand2 and stores result in vector resultant */
257 extern
259  SCIP_Real infinity, /**< value for infinity */
260  SCIP_INTERVAL* resultant, /**< array of resultant intervals of operation */
261  int length, /**< length of arrays */
262  SCIP_INTERVAL* operand1, /**< array of first operands of operation */
263  SCIP_INTERVAL* operand2 /**< array of second operands of operation */
264  );
265 
266 /** subtracts operand2 from operand1 and stores result in resultant */
267 extern
268 void SCIPintervalSub(
269  SCIP_Real infinity, /**< value for infinity */
270  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
271  SCIP_INTERVAL operand1, /**< first operand of operation */
272  SCIP_INTERVAL operand2 /**< second operand of operation */
273  );
274 
275 /** subtracts scalar operand2 from operand1 and stores result in resultant */
276 extern
278  SCIP_Real infinity, /**< value for infinity */
279  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
280  SCIP_INTERVAL operand1, /**< first operand of operation */
281  SCIP_Real operand2 /**< second operand of operation */
282  );
283 
284 /** multiplies operand1 with operand2 and stores infimum of result in infimum of resultant */
285 extern
286 void SCIPintervalMulInf(
287  SCIP_Real infinity, /**< value for infinity */
288  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
289  SCIP_INTERVAL operand1, /**< first operand of operation; can be +/-inf */
290  SCIP_INTERVAL operand2 /**< second operand of operation; can be +/-inf */
291  );
292 
293 /** multiplies operand1 with operand2 and stores supremum of result in supremum of resultant */
294 extern
295 void SCIPintervalMulSup(
296  SCIP_Real infinity, /**< value for infinity */
297  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
298  SCIP_INTERVAL operand1, /**< first operand of operation; can be +/-inf */
299  SCIP_INTERVAL operand2 /**< second operand of operation; can be +/-inf */
300  );
301 
302 /** multiplies operand1 with operand2 and stores result in resultant */
303 extern
304 void SCIPintervalMul(
305  SCIP_Real infinity, /**< value for infinity */
306  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
307  SCIP_INTERVAL operand1, /**< first operand of operation */
308  SCIP_INTERVAL operand2 /**< second operand of operation */
309  );
310 
311 /** multiplies operand1 with scalar operand2 and stores infimum of result in infimum of resultant */
312 extern
314  SCIP_Real infinity, /**< value for infinity */
315  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
316  SCIP_INTERVAL operand1, /**< first operand of operation */
317  SCIP_Real operand2 /**< second operand of operation; can be +/- inf */
318  );
319 
320 /** multiplies operand1 with scalar operand2 and stores supremum of result in supremum of resultant */
321 extern
323  SCIP_Real infinity, /**< value for infinity */
324  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
325  SCIP_INTERVAL operand1, /**< first operand of operation */
326  SCIP_Real operand2 /**< second operand of operation; can be +/- inf */
327  );
328 
329 /** multiplies operand1 with scalar operand2 and stores result in resultant */
330 extern
332  SCIP_Real infinity, /**< value for infinity */
333  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
334  SCIP_INTERVAL operand1, /**< first operand of operation */
335  SCIP_Real operand2 /**< second operand of operation */
336  );
337 
338 /** divides operand1 by operand2 and stores result in resultant */
339 extern
340 void SCIPintervalDiv(
341  SCIP_Real infinity, /**< value for infinity */
342  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
343  SCIP_INTERVAL operand1, /**< first operand of operation */
344  SCIP_INTERVAL operand2 /**< second operand of operation */
345  );
346 
347 /** divides operand1 by scalar operand2 and stores result in resultant */
348 extern
350  SCIP_Real infinity, /**< value for infinity */
351  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
352  SCIP_INTERVAL operand1, /**< first operand of operation */
353  SCIP_Real operand2 /**< second operand of operation */
354  );
355 
356 /** computes the scalar product of two vectors of intervals and stores result in resultant */
357 extern
359  SCIP_Real infinity, /**< value for infinity */
360  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
361  int length, /**< length of vectors */
362  SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
363  SCIP_INTERVAL* operand2 /**< second vector as array of intervals */
364  );
365 
366 /** computes the scalar product of a vector of intervals and a vector of scalars and stores infimum of result in infimum
367  * of resultant
368  */
369 extern
371  SCIP_Real infinity, /**< value for infinity */
372  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
373  int length, /**< length of vectors */
374  SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
375  SCIP_Real* operand2 /**< second vector as array of scalars; can have +/-inf entries */
376  );
377 
378 /** computes the scalar product of a vector of intervals and a vector of scalars and stores supremum of result in supremum
379  * of resultant
380  */
381 extern
383  SCIP_Real infinity, /**< value for infinity */
384  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
385  int length, /**< length of vectors */
386  SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
387  SCIP_Real* operand2 /**< second vector as array of scalars; can have +/-inf entries */
388  );
389 
390 /** computes the scalar product of a vector of intervals and a vector of scalars and stores result in resultant */
391 extern
393  SCIP_Real infinity, /**< value for infinity */
394  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
395  int length, /**< length of vectors */
396  SCIP_INTERVAL* operand1, /**< first vector as array of intervals */
397  SCIP_Real* operand2 /**< second vector as array of scalars; can have +/-inf entries */
398  );
399 
400 /** squares operand and stores result in resultant */
401 extern
402 void SCIPintervalSquare(
403  SCIP_Real infinity, /**< value for infinity */
404  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
405  SCIP_INTERVAL operand /**< operand of operation */
406  );
407 
408 /** stores (positive part of) square root of operand in resultant
409  * @attention we assume a correctly rounded sqrt(double) function when rounding is to nearest
410  */
411 extern
413  SCIP_Real infinity, /**< value for infinity */
414  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
415  SCIP_INTERVAL operand /**< operand of operation */
416  );
417 
418 /** stores operand1 to the power of operand2 in resultant
419  *
420  * uses SCIPintervalPowerScalar if operand2 is a scalar, otherwise computes exp(op2*log(op1))
421  */
422 extern
423 void SCIPintervalPower(
424  SCIP_Real infinity, /**< value for infinity */
425  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
426  SCIP_INTERVAL operand1, /**< first operand of operation */
427  SCIP_INTERVAL operand2 /**< second operand of operation */
428  );
429 
430 /** stores operand1 to the power of the scalar operand2 in resultant */
431 extern
433  SCIP_Real infinity, /**< value for infinity */
434  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
435  SCIP_INTERVAL operand1, /**< first operand of operation */
436  SCIP_Real operand2 /**< second operand of operation */
437  );
438 
439 /** stores bounds on the power of a scalar operand1 to a scalar operand2 in resultant
440  * both operands need to be finite numbers
441  * need to have operand1 >= 0 or operand2 integer and need to have operand2 >= 0 if operand1 == 0
442  * @attention we assume a correctly rounded pow(double) function when rounding is to nearest
443  */
444 extern
446  SCIP_INTERVAL* resultant, /**< resultant of operation */
447  SCIP_Real operand1, /**< first operand of operation */
448  SCIP_Real operand2 /**< second operand of operation */
449  );
450 
451 /** computes lower bound on power of a scalar operand1 to an integer operand2
452  * both operands need to be finite numbers
453  * need to have operand1 >= 0 and need to have operand2 >= 0 if operand1 == 0
454  */
455 extern
457  SCIP_Real operand1, /**< first operand of operation */
458  int operand2 /**< second operand of operation */
459  );
460 
461 /** computes upper bound on power of a scalar operand1 to an integer operand2
462  * both operands need to be finite numbers
463  * need to have operand1 >= 0 and need to have operand2 >= 0 if operand1 == 0
464  */
465 extern
467  SCIP_Real operand1, /**< first operand of operation */
468  int operand2 /**< second operand of operation */
469  );
470 
471 /** computes bounds on power of a scalar operand1 to an integer operand2
472  * both operands need to be finite numbers
473  * need to have operand1 >= 0 and need to have operand2 >= 0 if operand1 == 0
474  */
475 extern
477  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
478  SCIP_Real operand1, /**< first operand of operation */
479  int operand2 /**< second operand of operation */
480  );
481 
482 /** given an interval for the image of a power operation, computes an interval for the origin
483  * that is, for y = x^p with p = exponent a given scalar and y = image a given interval,
484  * computes a subinterval x of basedomain such that y in x^p and such that for all z in basedomain less x, z^p not in y
485  */
486 extern
488  SCIP_Real infinity, /**< value for infinity */
489  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
490  SCIP_INTERVAL basedomain, /**< domain of base */
491  SCIP_Real exponent, /**< exponent */
492  SCIP_INTERVAL image /**< interval image of power */
493  );
494 
495 /** stores operand1 to the signed power of the scalar positive operand2 in resultant
496  *
497  * the signed power of x w.r.t. an exponent n >= 0 is given as sign(x) * abs(x)^n
498  *
499  * @attention we assume correctly rounded sqrt(double) and pow(double) functions when rounding is to nearest
500  */
501 extern
503  SCIP_Real infinity, /**< value for infinity */
504  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
505  SCIP_INTERVAL operand1, /**< first operand of operation */
506  SCIP_Real operand2 /**< second operand of operation */
507  );
508 
509 /** computes the reciprocal of an interval
510  */
511 extern
513  SCIP_Real infinity, /**< value for infinity */
514  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
515  SCIP_INTERVAL operand /**< operand of operation */
516  );
517 
518 /** stores exponential of operand in resultant
519  * @attention we assume a correctly rounded exp(double) function when rounding is to nearest
520  */
521 extern
522 void SCIPintervalExp(
523  SCIP_Real infinity, /**< value for infinity */
524  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
525  SCIP_INTERVAL operand /**< operand of operation */
526  );
527 
528 /** stores natural logarithm of operand in resultant
529  * @attention we assume a correctly rounded log(double) function when rounding is to nearest
530  */
531 extern
532 void SCIPintervalLog(
533  SCIP_Real infinity, /**< value for infinity */
534  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
535  SCIP_INTERVAL operand /**< operand of operation */
536  );
537 
538 /** stores minimum of operands in resultant */
539 extern
540 void SCIPintervalMin(
541  SCIP_Real infinity, /**< value for infinity */
542  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
543  SCIP_INTERVAL operand1, /**< first operand of operation */
544  SCIP_INTERVAL operand2 /**< second operand of operation */
545  );
546 
547 /** stores maximum of operands in resultant */
548 extern
549 void SCIPintervalMax(
550  SCIP_Real infinity, /**< value for infinity */
551  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
552  SCIP_INTERVAL operand1, /**< first operand of operation */
553  SCIP_INTERVAL operand2 /**< second operand of operation */
554  );
555 
556 /** stores absolute value of operand in resultant */
557 extern
558 void SCIPintervalAbs(
559  SCIP_Real infinity, /**< value for infinity */
560  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
561  SCIP_INTERVAL operand /**< operand of operation */
562  );
563 
564 /** stores sign of operand in resultant */
565 extern
566 void SCIPintervalSign(
567  SCIP_Real infinity, /**< value for infinity */
568  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
569  SCIP_INTERVAL operand /**< operand of operation */
570  );
571 
572 /** computes exact upper bound on \f$ a x^2 + b x \f$ for x in [xlb, xub], b an interval, and a scalar
573  *
574  * Uses Algorithm 2.2 from Domes and Neumaier: Constraint propagation on quadratic constraints (2008) */
575 extern
577  SCIP_Real infinity, /**< value for infinity */
578  SCIP_Real a, /**< coefficient of x^2 */
579  SCIP_INTERVAL b, /**< coefficient of x */
580  SCIP_INTERVAL xrng /**< range of x */
581  );
582 
583 /** stores range of quadratic term in resultant
584  *
585  * given scalar a and intervals b and x, computes interval for \f$ a x^2 + b x \f$ */
586 extern
587 void SCIPintervalQuad(
588  SCIP_Real infinity, /**< value for infinity */
589  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
590  SCIP_Real sqrcoeff, /**< coefficient of x^2 */
591  SCIP_INTERVAL lincoeff, /**< coefficient of x */
592  SCIP_INTERVAL xrng /**< range of x */
593  );
594 
595 
596 /** computes interval with positive solutions of a quadratic equation with interval coefficients
597  *
598  * Given intervals a, b, and c, this function computes an interval that contains all positive solutions of \f$ a x^2 + b x \in c\f$.
599  */
600 extern
602  SCIP_Real infinity, /**< value for infinity */
603  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
604  SCIP_INTERVAL sqrcoeff, /**< coefficient of x^2 */
605  SCIP_INTERVAL lincoeff, /**< coefficient of x */
606  SCIP_INTERVAL rhs /**< right hand side of equation */
607  );
608 
609 /** computes positive solutions of a quadratic equation with scalar coefficients
610  *
611  * Given scalar a, b, and c, this function computes an interval that contains all positive solutions of \f$ a x^2 + b x \geq c\f$.
612  * Implements Algorithm 3.2 from Domes and Neumaier: Constraint propagation on quadratic constraints (2008).
613  */
614 extern
616  SCIP_Real infinity, /**< value for infinity */
617  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
618  SCIP_Real sqrcoeff, /**< coefficient of x^2 */
619  SCIP_Real lincoeff, /**< coefficient of x */
620  SCIP_Real rhs /**< right hand side of equation */
621  );
622 
623 /** solves a quadratic equation with interval coefficients
624  *
625  * Given intervals a, b and c, this function computes an interval that contains all solutions of \f$ a x^2 + b x \in c\f$
626  */
627 extern
629  SCIP_Real infinity, /**< value for infinity */
630  SCIP_INTERVAL* resultant, /**< resultant interval of operation */
631  SCIP_INTERVAL sqrcoeff, /**< coefficient of x^2 */
632  SCIP_INTERVAL lincoeff, /**< coefficient of x */
633  SCIP_INTERVAL rhs /**< right hand side of equation */
634  );
635 
636 /** stores range of bivariate quadratic term in resultant
637  * given scalars ax, ay, axy, bx, and by and intervals for x and y, computes interval for \f$ ax x^2 + ay y^2 + axy x y + bx x + by y \f$
638  * NOTE: the operations are not applied rounding-safe here
639  */
640 extern
642  SCIP_Real infinity, /**< value for infinity in interval arithmetics */
643  SCIP_INTERVAL* resultant, /**< buffer where to store result of operation */
644  SCIP_Real ax, /**< square coefficient of x */
645  SCIP_Real ay, /**< square coefficient of y */
646  SCIP_Real axy, /**< bilinear coefficients */
647  SCIP_Real bx, /**< linear coefficient of x */
648  SCIP_Real by, /**< linear coefficient of y */
649  SCIP_INTERVAL xbnds, /**< bounds on x */
650  SCIP_INTERVAL ybnds /**< bounds on y */
651  );
652 
653 /** solves a bivariate quadratic equation for the first variable
654  * given scalars ax, ay, axy, bx and by, and intervals for x, y, and rhs,
655  * computes \f$ \{ x \in \mathbf{x} : \exists y \in \mathbf{y} : a_x x^2 + a_y y^2 + a_{xy} x y + b_x x + b_y y \in \mathbf{\mbox{rhs}} \} \f$
656  * NOTE: the operations are not applied rounding-safe here
657  */
658 extern
660  SCIP_Real infinity, /**< value for infinity in interval arithmetics */
661  SCIP_INTERVAL* resultant, /**< buffer where to store result of operation */
662  SCIP_Real ax, /**< square coefficient of x */
663  SCIP_Real ay, /**< square coefficient of y */
664  SCIP_Real axy, /**< bilinear coefficients */
665  SCIP_Real bx, /**< linear coefficient of x */
666  SCIP_Real by, /**< linear coefficient of y */
667  SCIP_INTERVAL rhs, /**< right-hand-side of equation */
668  SCIP_INTERVAL xbnds, /**< bounds on x */
669  SCIP_INTERVAL ybnds /**< bounds on y */
670  );
671 
672 #ifdef __cplusplus
673 }
674 #endif
675 
676 #endif
void SCIPintervalSetRoundingMode(SCIP_ROUNDMODE roundmode)
SCIP_Real SCIPintervalNegateReal(SCIP_Real x)
SCIP_ROUNDMODE SCIPintervalGetRoundingMode(void)
void SCIPintervalMulInf(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalAddInf(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
SCIP_Bool SCIPintervalIsNegativeInfinity(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalPowerScalarInverse(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL basedomain, SCIP_Real exponent, SCIP_INTERVAL image)
void SCIPintervalMax(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalScalprodScalarsSup(SCIP_Real infinity, SCIP_INTERVAL *resultant, int length, SCIP_INTERVAL *operand1, SCIP_Real *operand2)
void SCIPintervalAddSup(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_Real SCIPintervalPowerScalarIntegerInf(SCIP_Real operand1, int operand2)
void SCIPintervalQuad(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_Real sqrcoeff, SCIP_INTERVAL lincoeff, SCIP_INTERVAL xrng)
void SCIPintervalMul(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalAddVectors(SCIP_Real infinity, SCIP_INTERVAL *resultant, int length, SCIP_INTERVAL *operand1, SCIP_INTERVAL *operand2)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
SCIP_Bool SCIPintervalIsEntire(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalPowerScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_Real inf
Definition: intervalarith.h:38
void SCIPintervalScalprod(SCIP_Real infinity, SCIP_INTERVAL *resultant, int length, SCIP_INTERVAL *operand1, SCIP_INTERVAL *operand2)
void SCIPintervalMin(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalScalprodScalarsInf(SCIP_Real infinity, SCIP_INTERVAL *resultant, int length, SCIP_INTERVAL *operand1, SCIP_Real *operand2)
SCIP_Real SCIPintervalQuadUpperBound(SCIP_Real infinity, SCIP_Real a, SCIP_INTERVAL b, SCIP_INTERVAL xrng)
void SCIPintervalSolveUnivariateQuadExpression(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL sqrcoeff, SCIP_INTERVAL lincoeff, SCIP_INTERVAL rhs)
void SCIPintervalSquareRoot(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalDiv(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_Bool SCIPintervalAreDisjoint(SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
SCIP_Bool SCIPintervalIsPositiveInfinity(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalPowerScalarScalar(SCIP_INTERVAL *resultant, SCIP_Real operand1, SCIP_Real operand2)
SCIP_Real sup
Definition: intervalarith.h:39
void SCIPintervalSetRoundingModeTowardsZero(void)
void SCIPintervalSolveUnivariateQuadExpressionPositiveAllScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_Real sqrcoeff, SCIP_Real lincoeff, SCIP_Real rhs)
void SCIPintervalLog(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalSquare(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalScalprodScalars(SCIP_Real infinity, SCIP_INTERVAL *resultant, int length, SCIP_INTERVAL *operand1, SCIP_Real *operand2)
#define SCIP_Bool
Definition: def.h:53
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
void SCIPintervalSolveBivariateQuadExpressionAllScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_Real ax, SCIP_Real ay, SCIP_Real axy, SCIP_Real bx, SCIP_Real by, SCIP_INTERVAL rhs, SCIP_INTERVAL xbnds, SCIP_INTERVAL ybnds)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalAbs(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalPowerScalarInteger(SCIP_INTERVAL *resultant, SCIP_Real operand1, int operand2)
void SCIPintervalQuadBivar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_Real ax, SCIP_Real ay, SCIP_Real axy, SCIP_Real bx, SCIP_Real by, SCIP_INTERVAL xbnds, SCIP_INTERVAL ybnds)
SCIP_Real SCIPintervalPowerScalarIntegerSup(SCIP_Real operand1, int operand2)
void SCIPintervalIntersect(SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalMulScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalExp(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalSub(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
#define SCIP_Real
Definition: def.h:127
void SCIPintervalMulScalarInf(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalSetRoundingModeToNearest(void)
void SCIPintervalReciprocal(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
SCIP_Bool SCIPintervalHasRoundingControl(void)
void SCIPintervalSetEntire(SCIP_Real infinity, SCIP_INTERVAL *resultant)
void SCIPintervalAdd(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalUnify(SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalMulScalarSup(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalSetRoundingModeUpwards(void)
int SCIP_ROUNDMODE
Definition: intervalarith.h:45
SCIP_Bool SCIPintervalIsSubsetEQ(SCIP_Real infinity, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
common defines and data types used in all packages of SCIP
void SCIPintervalSubScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalAddScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalSolveUnivariateQuadExpressionPositive(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL sqrcoeff, SCIP_INTERVAL lincoeff, SCIP_INTERVAL rhs)
void SCIPintervalSign(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalSignPowerScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalDivScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalPower(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSetRoundingModeDownwards(void)
void SCIPintervalMulSup(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)