Scippy

SCIP

Solving Constraint Integer Programs

scip_numerics.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-2020 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 visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_numerics.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public methods for numerical tolerances
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Leona Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_NUMERICS_H__
32 #define __SCIP_SCIP_NUMERICS_H__
33 
34 
35 #include "scip/def.h"
36 #include "scip/type_retcode.h"
37 #include "scip/type_scip.h"
38 
39 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
40  * this structure except the interface methods in scip.c.
41  * In optimized mode, the structure is included in scip.h, because some of the methods
42  * are implemented as defines for performance reasons (e.g. the numerical comparisons).
43  * Additionally, the internal "set.h" is included, such that the defines in set.h are
44  * available in optimized mode.
45  */
46 #ifdef NDEBUG
47 #include "scip/struct_scip.h"
48 #include "scip/set.h"
49 #endif
50 
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54 
55 /**@addtogroup PublicToleranceMethods
56  *
57  * @{
58  */
59 
60 /** returns value treated as zero
61  *
62  * @return value treated as zero
63  */
66  SCIP* scip /**< SCIP data structure */
67  );
68 
69 /** returns value treated as zero for sums of floating point values
70  *
71  * @return value treated as zero for sums of floating point values
72  */
75  SCIP* scip /**< SCIP data structure */
76  );
77 
78 /** returns feasibility tolerance for constraints
79  *
80  * @return feasibility tolerance for constraints
81  */
84  SCIP* scip /**< SCIP data structure */
85  );
86 
87 /** returns primal feasibility tolerance of LP solver
88  *
89  * @deprecated Please use SCIPgetLPFeastol().
90  *
91  * @return primal feasibility tolerance of LP solver
92  */
95  SCIP* scip /**< SCIP data structure */
96  );
97 
98 /** returns feasibility tolerance for reduced costs
99  *
100  * @return feasibility tolerance for reduced costs
101  */
104  SCIP* scip /**< SCIP data structure */
105  );
106 
107 /** returns convergence tolerance used in barrier algorithm
108  *
109  * @return convergence tolerance used in barrier algorithm
110  */
113  SCIP* scip /**< SCIP data structure */
114  );
115 
116 /** return the cutoff bound delta
117  *
118  * @return cutoff bound data
119  */
122  SCIP* scip /**< SCIP data structure */
123  );
124 
125 /** return the relaxation primal feasibility tolerance
126  *
127  * @see SCIPchgRelaxfeastol
128  * @return relaxfeastol
129  */
132  SCIP* scip /**< SCIP data structure */
133  );
134 
135 /** sets the feasibility tolerance for constraints
136  *
137  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
138  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
139  */
142  SCIP* scip, /**< SCIP data structure */
143  SCIP_Real feastol /**< new feasibility tolerance for constraints */
144  );
145 
146 /** sets the primal feasibility tolerance of LP solver
147  *
148  * @deprecated Please use SCIPsetLPFeastol().
149  *
150  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
151  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
152  */
155  SCIP* scip, /**< SCIP data structure */
156  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
157  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
158  );
159 
160 /** sets the feasibility tolerance for reduced costs
161  *
162  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
163  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
164  */
167  SCIP* scip, /**< SCIP data structure */
168  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
169  );
170 
171 /** sets the convergence tolerance used in barrier algorithm
172  *
173  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
174  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
175  */
178  SCIP* scip, /**< SCIP data structure */
179  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
180  );
181 
182 /** sets the primal feasibility tolerance of relaxations
183  *
184  * This tolerance value is used by the SCIP core and plugins to tighten then feasibility tolerance on relaxations
185  * (especially the LP relaxation) during a solve. It is set to SCIP_INVALID initially, which means that only the
186  * feasibility tolerance of the particular relaxation is taken into account. If set to a valid value, however,
187  * then this value should be used to reduce the primal feasibility tolerance of a relaxation (thus, use the
188  * minimum of relaxfeastol and the relaxations primal feastol).
189  *
190  * @pre The value of relaxfeastol is reset to SCIP_INVALID when initializing the solve (INITSOL).
191  * Therefore, this method can only be called in one of the following stages of the SCIP solving process:
192  * - \ref SCIP_STAGE_INITSOLVE
193  * - \ref SCIP_STAGE_SOLVING
194  *
195  * @return previous value of relaxfeastol
196  */
199  SCIP* scip, /**< SCIP data structure */
200  SCIP_Real relaxfeastol /**< new primal feasibility tolerance of relaxations */
201  );
202 
203 /** marks that some limit parameter was changed */
206  SCIP* scip /**< SCIP data structure */
207  );
208 
209 /** returns value treated as infinity */
212  SCIP* scip /**< SCIP data structure */
213  );
214 
215 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
216  * computation)
217  */
220  SCIP* scip /**< SCIP data structure */
221  );
222 
223 /** checks, if values are in range of epsilon */
226  SCIP* scip, /**< SCIP data structure */
227  SCIP_Real val1, /**< first value to be compared */
228  SCIP_Real val2 /**< second value to be compared */
229  );
230 
231 /** checks, if val1 is (more than epsilon) lower than val2 */
234  SCIP* scip, /**< SCIP data structure */
235  SCIP_Real val1, /**< first value to be compared */
236  SCIP_Real val2 /**< second value to be compared */
237  );
238 
239 /** checks, if val1 is not (more than epsilon) greater than val2 */
242  SCIP* scip, /**< SCIP data structure */
243  SCIP_Real val1, /**< first value to be compared */
244  SCIP_Real val2 /**< second value to be compared */
245  );
246 
247 /** checks, if val1 is (more than epsilon) greater than val2 */
250  SCIP* scip, /**< SCIP data structure */
251  SCIP_Real val1, /**< first value to be compared */
252  SCIP_Real val2 /**< second value to be compared */
253  );
254 
255 /** checks, if val1 is not (more than epsilon) lower than val2 */
258  SCIP* scip, /**< SCIP data structure */
259  SCIP_Real val1, /**< first value to be compared */
260  SCIP_Real val2 /**< second value to be compared */
261  );
262 
263 /** checks, if value is (positive) infinite */
266  SCIP* scip, /**< SCIP data structure */
267  SCIP_Real val /**< value to be compared against infinity */
268  );
269 
270 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
273  SCIP* scip, /**< SCIP data structure */
274  SCIP_Real val /**< value to be checked whether it is huge */
275  );
276 
277 /** checks, if value is in range epsilon of 0.0 */
280  SCIP* scip, /**< SCIP data structure */
281  SCIP_Real val /**< value to process */
282  );
283 
284 /** checks, if value is greater than epsilon */
287  SCIP* scip, /**< SCIP data structure */
288  SCIP_Real val /**< value to process */
289  );
290 
291 /** checks, if value is lower than -epsilon */
294  SCIP* scip, /**< SCIP data structure */
295  SCIP_Real val /**< value to process */
296  );
297 
298 /** checks, if value is integral within epsilon */
301  SCIP* scip, /**< SCIP data structure */
302  SCIP_Real val /**< value to process */
303  );
304 
305 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
308  SCIP* scip, /**< SCIP data structure */
309  SCIP_Real val, /**< unscaled value to check for scaled integrality */
310  SCIP_Real scalar /**< value to scale val with for checking for integrality */
311  );
312 
313 /** checks, if given fractional part is smaller than epsilon */
316  SCIP* scip, /**< SCIP data structure */
317  SCIP_Real val /**< value to process */
318  );
319 
320 /** rounds value + epsilon down to the next integer */
323  SCIP* scip, /**< SCIP data structure */
324  SCIP_Real val /**< value to process */
325  );
326 
327 /** rounds value - epsilon up to the next integer */
330  SCIP* scip, /**< SCIP data structure */
331  SCIP_Real val /**< value to process */
332  );
333 
334 /** rounds value to the nearest integer with epsilon tolerance */
337  SCIP* scip, /**< SCIP data structure */
338  SCIP_Real val /**< value to process */
339  );
340 
341 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
344  SCIP* scip, /**< SCIP data structure */
345  SCIP_Real val /**< value to return fractional part for */
346  );
347 
348 /** checks, if values are in range of sumepsilon */
351  SCIP* scip, /**< SCIP data structure */
352  SCIP_Real val1, /**< first value to be compared */
353  SCIP_Real val2 /**< second value to be compared */
354  );
355 
356 /** checks, if val1 is (more than sumepsilon) lower than val2 */
359  SCIP* scip, /**< SCIP data structure */
360  SCIP_Real val1, /**< first value to be compared */
361  SCIP_Real val2 /**< second value to be compared */
362  );
363 
364 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
367  SCIP* scip, /**< SCIP data structure */
368  SCIP_Real val1, /**< first value to be compared */
369  SCIP_Real val2 /**< second value to be compared */
370  );
371 
372 /** checks, if val1 is (more than sumepsilon) greater than val2 */
375  SCIP* scip, /**< SCIP data structure */
376  SCIP_Real val1, /**< first value to be compared */
377  SCIP_Real val2 /**< second value to be compared */
378  );
379 
380 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
383  SCIP* scip, /**< SCIP data structure */
384  SCIP_Real val1, /**< first value to be compared */
385  SCIP_Real val2 /**< second value to be compared */
386  );
387 
388 /** checks, if value is in range sumepsilon of 0.0 */
391  SCIP* scip, /**< SCIP data structure */
392  SCIP_Real val /**< value to process */
393  );
394 
395 /** checks, if value is greater than sumepsilon */
398  SCIP* scip, /**< SCIP data structure */
399  SCIP_Real val /**< value to process */
400  );
401 
402 /** checks, if value is lower than -sumepsilon */
405  SCIP* scip, /**< SCIP data structure */
406  SCIP_Real val /**< value to process */
407  );
408 
409 /** checks, if relative difference of values is in range of feasibility tolerance */
412  SCIP* scip, /**< SCIP data structure */
413  SCIP_Real val1, /**< first value to be compared */
414  SCIP_Real val2 /**< second value to be compared */
415  );
416 
417 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
420  SCIP* scip, /**< SCIP data structure */
421  SCIP_Real val1, /**< first value to be compared */
422  SCIP_Real val2 /**< second value to be compared */
423  );
424 
425 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
428  SCIP* scip, /**< SCIP data structure */
429  SCIP_Real val1, /**< first value to be compared */
430  SCIP_Real val2 /**< second value to be compared */
431  );
432 
433 /** checks, if relative difference of val1 and val2 is greater than feastol */
436  SCIP* scip, /**< SCIP data structure */
437  SCIP_Real val1, /**< first value to be compared */
438  SCIP_Real val2 /**< second value to be compared */
439  );
440 
441 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
444  SCIP* scip, /**< SCIP data structure */
445  SCIP_Real val1, /**< first value to be compared */
446  SCIP_Real val2 /**< second value to be compared */
447  );
448 
449 /** checks, if value is in range feasibility tolerance of 0.0 */
452  SCIP* scip, /**< SCIP data structure */
453  SCIP_Real val /**< value to process */
454  );
455 
456 /** checks, if value is greater than feasibility tolerance */
459  SCIP* scip, /**< SCIP data structure */
460  SCIP_Real val /**< value to process */
461  );
462 
463 /** checks, if value is lower than -feasibility tolerance */
466  SCIP* scip, /**< SCIP data structure */
467  SCIP_Real val /**< value to process */
468  );
469 
470 /** checks, if value is integral within the LP feasibility bounds */
473  SCIP* scip, /**< SCIP data structure */
474  SCIP_Real val /**< value to process */
475  );
476 
477 /** checks, if given fractional part is smaller than feastol */
480  SCIP* scip, /**< SCIP data structure */
481  SCIP_Real val /**< value to process */
482  );
483 
484 /** rounds value + feasibility tolerance down to the next integer */
487  SCIP* scip, /**< SCIP data structure */
488  SCIP_Real val /**< value to process */
489  );
490 
491 /** rounds value - feasibility tolerance up to the next integer */
494  SCIP* scip, /**< SCIP data structure */
495  SCIP_Real val /**< value to process */
496  );
497 
498 /** rounds value to the nearest integer in feasibility tolerance */
501  SCIP* scip, /**< SCIP data structure */
502  SCIP_Real val /**< value to process */
503  );
504 
505 /** returns fractional part of value, i.e. x - floor(x) */
508  SCIP* scip, /**< SCIP data structure */
509  SCIP_Real val /**< value to process */
510  );
511 
512 /** checks, if relative difference of values is in range of dual feasibility tolerance */
515  SCIP* scip, /**< SCIP data structure */
516  SCIP_Real val1, /**< first value to be compared */
517  SCIP_Real val2 /**< second value to be compared */
518  );
519 
520 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
523  SCIP* scip, /**< SCIP data structure */
524  SCIP_Real val1, /**< first value to be compared */
525  SCIP_Real val2 /**< second value to be compared */
526  );
527 
528 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
531  SCIP* scip, /**< SCIP data structure */
532  SCIP_Real val1, /**< first value to be compared */
533  SCIP_Real val2 /**< second value to be compared */
534  );
535 
536 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
539  SCIP* scip, /**< SCIP data structure */
540  SCIP_Real val1, /**< first value to be compared */
541  SCIP_Real val2 /**< second value to be compared */
542  );
543 
544 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
547  SCIP* scip, /**< SCIP data structure */
548  SCIP_Real val1, /**< first value to be compared */
549  SCIP_Real val2 /**< second value to be compared */
550  );
551 
552 /** checks, if value is in range dual feasibility tolerance of 0.0 */
555  SCIP* scip, /**< SCIP data structure */
556  SCIP_Real val /**< value to process */
557  );
558 
559 /** checks, if value is greater than dual feasibility tolerance */
562  SCIP* scip, /**< SCIP data structure */
563  SCIP_Real val /**< value to process */
564  );
565 
566 /** checks, if value is lower than -dual feasibility tolerance */
569  SCIP* scip, /**< SCIP data structure */
570  SCIP_Real val /**< value to process */
571  );
572 
573 /** checks, if value is integral within the LP dual feasibility tolerance */
576  SCIP* scip, /**< SCIP data structure */
577  SCIP_Real val /**< value to process */
578  );
579 
580 /** checks, if given fractional part is smaller than dual feasibility tolerance */
583  SCIP* scip, /**< SCIP data structure */
584  SCIP_Real val /**< value to process */
585  );
586 
587 /** rounds value + dual feasibility tolerance down to the next integer */
590  SCIP* scip, /**< SCIP data structure */
591  SCIP_Real val /**< value to process */
592  );
593 
594 /** rounds value - dual feasibility tolerance up to the next integer */
597  SCIP* scip, /**< SCIP data structure */
598  SCIP_Real val /**< value to process */
599  );
600 
601 /** rounds value to the nearest integer in dual feasibility tolerance */
604  SCIP* scip, /**< SCIP data structure */
605  SCIP_Real val /**< value to process */
606  );
607 
608 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
611  SCIP* scip, /**< SCIP data structure */
612  SCIP_Real val /**< value to process */
613  );
614 
615 /** checks, if the given new lower bound is tighter (w.r.t. bound strengthening epsilon) than the old one */
618  SCIP* scip, /**< SCIP data structure */
619  SCIP_Real newlb, /**< new lower bound */
620  SCIP_Real oldlb, /**< old lower bound */
621  SCIP_Real oldub /**< old upper bound */
622  );
623 
624 /** checks, if the given new upper bound is tighter (w.r.t. bound strengthening epsilon) than the old one */
627  SCIP* scip, /**< SCIP data structure */
628  SCIP_Real newub, /**< new upper bound */
629  SCIP_Real oldlb, /**< old lower bound */
630  SCIP_Real oldub /**< old upper bound */
631  );
632 
633 /** checks, if relative difference of values is in range of epsilon */
636  SCIP* scip, /**< SCIP data structure */
637  SCIP_Real val1, /**< first value to be compared */
638  SCIP_Real val2 /**< second value to be compared */
639  );
640 
641 /** checks, if relative difference of val1 and val2 is lower than epsilon */
644  SCIP* scip, /**< SCIP data structure */
645  SCIP_Real val1, /**< first value to be compared */
646  SCIP_Real val2 /**< second value to be compared */
647  );
648 
649 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
652  SCIP* scip, /**< SCIP data structure */
653  SCIP_Real val1, /**< first value to be compared */
654  SCIP_Real val2 /**< second value to be compared */
655  );
656 
657 /** checks, if relative difference of val1 and val2 is greater than epsilon */
660  SCIP* scip, /**< SCIP data structure */
661  SCIP_Real val1, /**< first value to be compared */
662  SCIP_Real val2 /**< second value to be compared */
663  );
664 
665 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
668  SCIP* scip, /**< SCIP data structure */
669  SCIP_Real val1, /**< first value to be compared */
670  SCIP_Real val2 /**< second value to be compared */
671  );
672 
673 /** checks, if relative difference of values is in range of sumepsilon */
676  SCIP* scip, /**< SCIP data structure */
677  SCIP_Real val1, /**< first value to be compared */
678  SCIP_Real val2 /**< second value to be compared */
679  );
680 
681 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
684  SCIP* scip, /**< SCIP data structure */
685  SCIP_Real val1, /**< first value to be compared */
686  SCIP_Real val2 /**< second value to be compared */
687  );
688 
689 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
692  SCIP* scip, /**< SCIP data structure */
693  SCIP_Real val1, /**< first value to be compared */
694  SCIP_Real val2 /**< second value to be compared */
695  );
696 
697 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
700  SCIP* scip, /**< SCIP data structure */
701  SCIP_Real val1, /**< first value to be compared */
702  SCIP_Real val2 /**< second value to be compared */
703  );
704 
705 /**! [SnippetCodeStyleNaming] */
706 
707 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
710  SCIP* scip, /**< SCIP data structure */
711  SCIP_Real val1, /**< first value to be compared */
712  SCIP_Real val2 /**< second value to be compared */
713  );
714 
715 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
716  * performance; in debug mode we check some additional conditions
717  */
720  SCIP* scip, /**< SCIP data structure */
721  SCIP_Real real /**< double bound to convert */
722  );
723 
724 /**! [SnippetCodeStyleNaming] */
725 
726 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
727  * performance; in debug mode we check some additional conditions
728  */
731  SCIP* scip, /**< SCIP data structure */
732  SCIP_Real real /**< double bound to convert */
733  );
734 
735 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
736  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
737  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
738  * were canceled out when increasing the value and are random after decreasing it.
739  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
740  * be expressed using fixed precision floating point arithmetic, anymore.
741  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
742  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
743  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
744  * "lp/recompfac" and should be recomputed.
745  */
748  SCIP* scip, /**< SCIP data structure */
749  SCIP_Real newvalue, /**< new value after update */
750  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
751  );
752 
753 #ifdef NDEBUG
754 
755 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
756  * speed up the algorithms.
757  */
758 
759 #define SCIPinfinity(scip) SCIPsetInfinity((scip)->set)
760 #define SCIPisInfinity(scip, val) SCIPsetIsInfinity((scip)->set, val)
761 #define SCIPisHugeValue(scip, val) SCIPsetIsHugeValue((scip)->set, val)
762 #define SCIPgetHugeValue(scip) SCIPsetGetHugeValue((scip)->set)
763 #define SCIPisEQ(scip, val1, val2) SCIPsetIsEQ((scip)->set, val1, val2)
764 #define SCIPisLT(scip, val1, val2) SCIPsetIsLT((scip)->set, val1, val2)
765 #define SCIPisLE(scip, val1, val2) SCIPsetIsLE((scip)->set, val1, val2)
766 #define SCIPisGT(scip, val1, val2) SCIPsetIsGT((scip)->set, val1, val2)
767 #define SCIPisGE(scip, val1, val2) SCIPsetIsGE((scip)->set, val1, val2)
768 #define SCIPisZero(scip, val) SCIPsetIsZero((scip)->set, val)
769 #define SCIPisPositive(scip, val) SCIPsetIsPositive((scip)->set, val)
770 #define SCIPisNegative(scip, val) SCIPsetIsNegative((scip)->set, val)
771 #define SCIPisIntegral(scip, val) SCIPsetIsIntegral((scip)->set, val)
772 #define SCIPisScalingIntegral(scip, val, scalar) SCIPsetIsScalingIntegral((scip)->set, val, scalar)
773 #define SCIPisFracIntegral(scip, val) SCIPsetIsFracIntegral((scip)->set, val)
774 #define SCIPfloor(scip, val) SCIPsetFloor((scip)->set, val)
775 #define SCIPceil(scip, val) SCIPsetCeil((scip)->set, val)
776 #define SCIPround(scip, val) SCIPsetRound((scip)->set, val)
777 #define SCIPfrac(scip, val) SCIPsetFrac((scip)->set, val)
778 
779 #define SCIPisSumEQ(scip, val1, val2) SCIPsetIsSumEQ((scip)->set, val1, val2)
780 #define SCIPisSumLT(scip, val1, val2) SCIPsetIsSumLT((scip)->set, val1, val2)
781 #define SCIPisSumLE(scip, val1, val2) SCIPsetIsSumLE((scip)->set, val1, val2)
782 #define SCIPisSumGT(scip, val1, val2) SCIPsetIsSumGT((scip)->set, val1, val2)
783 #define SCIPisSumGE(scip, val1, val2) SCIPsetIsSumGE((scip)->set, val1, val2)
784 #define SCIPisSumZero(scip, val) SCIPsetIsSumZero((scip)->set, val)
785 #define SCIPisSumPositive(scip, val) SCIPsetIsSumPositive((scip)->set, val)
786 #define SCIPisSumNegative(scip, val) SCIPsetIsSumNegative((scip)->set, val)
787 
788 #define SCIPisFeasEQ(scip, val1, val2) SCIPsetIsFeasEQ((scip)->set, val1, val2)
789 #define SCIPisFeasLT(scip, val1, val2) SCIPsetIsFeasLT((scip)->set, val1, val2)
790 #define SCIPisFeasLE(scip, val1, val2) SCIPsetIsFeasLE((scip)->set, val1, val2)
791 #define SCIPisFeasGT(scip, val1, val2) SCIPsetIsFeasGT((scip)->set, val1, val2)
792 #define SCIPisFeasGE(scip, val1, val2) SCIPsetIsFeasGE((scip)->set, val1, val2)
793 #define SCIPisFeasZero(scip, val) SCIPsetIsFeasZero((scip)->set, val)
794 #define SCIPisFeasPositive(scip, val) SCIPsetIsFeasPositive((scip)->set, val)
795 #define SCIPisFeasNegative(scip, val) SCIPsetIsFeasNegative((scip)->set, val)
796 #define SCIPisFeasIntegral(scip, val) SCIPsetIsFeasIntegral((scip)->set, val)
797 #define SCIPisFeasFracIntegral(scip, val) SCIPsetIsFeasFracIntegral((scip)->set, val)
798 #define SCIPfeasFloor(scip, val) SCIPsetFeasFloor((scip)->set, val)
799 #define SCIPfeasCeil(scip, val) SCIPsetFeasCeil((scip)->set, val)
800 #define SCIPfeasRound(scip, val) SCIPsetFeasRound((scip)->set, val)
801 #define SCIPfeasFrac(scip, val) SCIPsetFeasFrac((scip)->set, val)
802 
803 #define SCIPisDualfeasEQ(scip, val1, val2) SCIPsetIsDualfeasEQ((scip)->set, val1, val2)
804 #define SCIPisDualfeasLT(scip, val1, val2) SCIPsetIsDualfeasLT((scip)->set, val1, val2)
805 #define SCIPisDualfeasLE(scip, val1, val2) SCIPsetIsDualfeasLE((scip)->set, val1, val2)
806 #define SCIPisDualfeasGT(scip, val1, val2) SCIPsetIsDualfeasGT((scip)->set, val1, val2)
807 #define SCIPisDualfeasGE(scip, val1, val2) SCIPsetIsDualfeasGE((scip)->set, val1, val2)
808 #define SCIPisDualfeasZero(scip, val) SCIPsetIsDualfeasZero((scip)->set, val)
809 #define SCIPisDualfeasPositive(scip, val) SCIPsetIsDualfeasPositive((scip)->set, val)
810 #define SCIPisDualfeasNegative(scip, val) SCIPsetIsDualfeasNegative((scip)->set, val)
811 #define SCIPisDualfeasIntegral(scip, val) SCIPsetIsDualfeasIntegral((scip)->set, val)
812 #define SCIPisDualfeasFracIntegral(scip, val) SCIPsetIsDualfeasFracIntegral((scip)->set, val)
813 #define SCIPdualfeasFloor(scip, val) SCIPsetDualfeasFloor((scip)->set, val)
814 #define SCIPdualfeasCeil(scip, val) SCIPsetDualfeasCeil((scip)->set, val)
815 #define SCIPdualfeasRound(scip, val) SCIPsetDualfeasRound((scip)->set, val)
816 #define SCIPdualfeasFrac(scip, val) SCIPsetDualfeasFrac((scip)->set, val)
817 
818 #define SCIPisLbBetter(scip, newlb, oldlb, oldub) SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub)
819 #define SCIPisUbBetter(scip, newub, oldlb, oldub) SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub)
820 
821 #define SCIPisRelEQ(scip, val1, val2) SCIPsetIsRelEQ((scip)->set, val1, val2)
822 #define SCIPisRelLT(scip, val1, val2) SCIPsetIsRelLT((scip)->set, val1, val2)
823 #define SCIPisRelLE(scip, val1, val2) SCIPsetIsRelLE((scip)->set, val1, val2)
824 #define SCIPisRelGT(scip, val1, val2) SCIPsetIsRelGT((scip)->set, val1, val2)
825 #define SCIPisRelGE(scip, val1, val2) SCIPsetIsRelGE((scip)->set, val1, val2)
826 
827 #define SCIPisSumRelEQ(scip, val1, val2) SCIPsetIsSumRelEQ((scip)->set, val1, val2)
828 #define SCIPisSumRelLT(scip, val1, val2) SCIPsetIsSumRelLT((scip)->set, val1, val2)
829 #define SCIPisSumRelLE(scip, val1, val2) SCIPsetIsSumRelLE((scip)->set, val1, val2)
830 #define SCIPisSumRelGT(scip, val1, val2) SCIPsetIsSumRelGT((scip)->set, val1, val2)
831 #define SCIPisSumRelGE(scip, val1, val2) SCIPsetIsSumRelGE((scip)->set, val1, val2)
832 #define SCIPconvertRealToInt(scip, real) ((int)((real) < 0 ? ((real) - 0.5) : ((real) + 0.5)))
833 #define SCIPconvertRealToLongint(scip, real) ((SCIP_Longint)((real) < 0 ? ((real) - 0.5) : ((real) + 0.5)))
834 
835 #define SCIPisUpdateUnreliable(scip, newval, oldval) SCIPsetIsUpdateUnreliable((scip)->set, newval, oldval)
836 
837 #endif
838 
839 /** outputs a real number, or "+infinity", or "-infinity" to a file */
841 void SCIPprintReal(
842  SCIP* scip, /**< SCIP data structure */
843  FILE* file, /**< output file (or NULL for standard output) */
844  SCIP_Real val, /**< value to print */
845  int width, /**< width of the field */
846  int precision /**< number of significant digits printed */
847  );
848 
849 /** parse a real value that was written with SCIPprintReal() */
852  SCIP* scip, /**< SCIP data structure */
853  const char* str, /**< string to search */
854  SCIP_Real* value, /**< pointer to store the parsed value */
855  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
856  );
857 
858 /**@} */
859 
860 #ifdef __cplusplus
861 }
862 #endif
863 
864 #endif
SCIP_EXPORT SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_EXPORT SCIP_RETCODE SCIPchgLpfeastol(SCIP *scip, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
SCIP_EXPORT SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPdualfeastol(SCIP *scip)
SCIP_EXPORT SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_EXPORT SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_EXPORT SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_EXPORT SCIP_Bool SCIPisSumPositive(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPdualfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPrelaxfeastol(SCIP *scip)
SCIP_EXPORT SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIP_EXPORT
Definition: def.h:100
SCIP_EXPORT SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_EXPORT SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPdualfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisSumRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPgetHugeValue(SCIP *scip)
SCIP_EXPORT SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue)
type definitions for SCIP&#39;s main datastructure
SCIP_EXPORT SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_EXPORT void SCIPprintReal(SCIP *scip, FILE *file, SCIP_Real val, int width, int precision)
SCIP_EXPORT SCIP_Bool SCIPisRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
internal methods for global SCIP settings
SCIP main data structure.
SCIP_EXPORT SCIP_Longint SCIPconvertRealToLongint(SCIP *scip, SCIP_Real real)
SCIP_EXPORT SCIP_Real SCIPdualfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
SCIP_EXPORT SCIP_Real SCIPdualfeasRound(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPinfinity(SCIP *scip)
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisSumNegative(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPchgRelaxfeastol(SCIP *scip, SCIP_Real relaxfeastol)
SCIP_EXPORT SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT void SCIPmarkLimitChanged(SCIP *scip)
SCIP_EXPORT int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
SCIP_EXPORT SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIP_Real
Definition: def.h:163
SCIP_EXPORT SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_EXPORT SCIP_Bool SCIPisDualfeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIP_Longint
Definition: def.h:148
SCIP_EXPORT SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_Real SCIPbarrierconvtol(SCIP *scip)
SCIP_EXPORT SCIP_Real SCIPlpfeastol(SCIP *scip)
SCIP_EXPORT SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_EXPORT SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol)
common defines and data types used in all packages of SCIP
SCIP_EXPORT SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
SCIP_EXPORT SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
SCIP_EXPORT SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
double real
SCIP_EXPORT SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
SCIP_EXPORT SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)