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-2019 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 scip.zib.de. */
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 Robert Lion 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  * @return primal feasibility tolerance of LP solver
90  */
93  SCIP* scip /**< SCIP data structure */
94  );
95 
96 /** returns feasibility tolerance for reduced costs
97  *
98  * @return feasibility tolerance for reduced costs
99  */
102  SCIP* scip /**< SCIP data structure */
103  );
104 
105 /** returns convergence tolerance used in barrier algorithm
106  *
107  * @return convergence tolerance used in barrier algorithm
108  */
111  SCIP* scip /**< SCIP data structure */
112  );
113 
114 /** return the cutoff bound delta
115  *
116  * @return cutoff bound data
117  */
120  SCIP* scip /**< SCIP data structure */
121  );
122 
123 /** return the relaxation primal feasibility tolerance
124  *
125  * @see SCIPchgRelaxfeastol
126  * @return relaxfeastol
127  */
130  SCIP* scip /**< SCIP data structure */
131  );
132 
133 /** sets the feasibility tolerance for constraints
134  *
135  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
136  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
137  */
140  SCIP* scip, /**< SCIP data structure */
141  SCIP_Real feastol /**< new feasibility tolerance for constraints */
142  );
143 
144 /** sets the primal feasibility tolerance of LP solver
145  *
146  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
147  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
148  */
151  SCIP* scip, /**< SCIP data structure */
152  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
153  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
154  );
155 
156 /** sets the feasibility tolerance for reduced costs
157  *
158  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
159  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
160  */
163  SCIP* scip, /**< SCIP data structure */
164  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
165  );
166 
167 /** sets the convergence tolerance used in barrier algorithm
168  *
169  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
170  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
171  */
174  SCIP* scip, /**< SCIP data structure */
175  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
176  );
177 
178 /** sets the primal feasibility tolerance of relaxations
179  *
180  * This tolerance value is used by the SCIP core and plugins to tighten then feasibility tolerance on relaxations
181  * (especially the LP relaxation) during a solve. It is set to SCIP_INVALID initially, which means that only the
182  * feasibility tolerance of the particular relaxation is taken into account. If set to a valid value, however,
183  * then this value should be used to reduce the primal feasibility tolerance of a relaxation (thus, use the
184  * minimum of relaxfeastol and the relaxations primal feastol).
185  *
186  * @pre The value of relaxfeastol is reset to SCIP_INVALID when initializing the solve (INITSOL).
187  * Therefore, this method can only be called in one of the following stages of the SCIP solving process:
188  * - \ref SCIP_STAGE_INITSOLVE
189  * - \ref SCIP_STAGE_SOLVING
190  *
191  * @return previous value of relaxfeastol
192  */
195  SCIP* scip, /**< SCIP data structure */
196  SCIP_Real relaxfeastol /**< new primal feasibility tolerance of relaxations */
197  );
198 
199 /** marks that some limit parameter was changed */
202  SCIP* scip /**< SCIP data structure */
203  );
204 
205 /** returns value treated as infinity */
208  SCIP* scip /**< SCIP data structure */
209  );
210 
211 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
212  * computation)
213  */
216  SCIP* scip /**< SCIP data structure */
217  );
218 
219 /** checks, if values are in range of epsilon */
222  SCIP* scip, /**< SCIP data structure */
223  SCIP_Real val1, /**< first value to be compared */
224  SCIP_Real val2 /**< second value to be compared */
225  );
226 
227 /** checks, if val1 is (more than epsilon) lower than val2 */
230  SCIP* scip, /**< SCIP data structure */
231  SCIP_Real val1, /**< first value to be compared */
232  SCIP_Real val2 /**< second value to be compared */
233  );
234 
235 /** checks, if val1 is not (more than epsilon) greater than val2 */
238  SCIP* scip, /**< SCIP data structure */
239  SCIP_Real val1, /**< first value to be compared */
240  SCIP_Real val2 /**< second value to be compared */
241  );
242 
243 /** checks, if val1 is (more than epsilon) greater than val2 */
246  SCIP* scip, /**< SCIP data structure */
247  SCIP_Real val1, /**< first value to be compared */
248  SCIP_Real val2 /**< second value to be compared */
249  );
250 
251 /** checks, if val1 is not (more than epsilon) lower than val2 */
254  SCIP* scip, /**< SCIP data structure */
255  SCIP_Real val1, /**< first value to be compared */
256  SCIP_Real val2 /**< second value to be compared */
257  );
258 
259 /** checks, if value is (positive) infinite */
262  SCIP* scip, /**< SCIP data structure */
263  SCIP_Real val /**< value to be compared against infinity */
264  );
265 
266 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
269  SCIP* scip, /**< SCIP data structure */
270  SCIP_Real val /**< value to be checked whether it is huge */
271  );
272 
273 /** checks, if value is in range epsilon of 0.0 */
276  SCIP* scip, /**< SCIP data structure */
277  SCIP_Real val /**< value to process */
278  );
279 
280 /** checks, if value is greater than epsilon */
283  SCIP* scip, /**< SCIP data structure */
284  SCIP_Real val /**< value to process */
285  );
286 
287 /** checks, if value is lower than -epsilon */
290  SCIP* scip, /**< SCIP data structure */
291  SCIP_Real val /**< value to process */
292  );
293 
294 /** checks, if value is integral within epsilon */
297  SCIP* scip, /**< SCIP data structure */
298  SCIP_Real val /**< value to process */
299  );
300 
301 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
304  SCIP* scip, /**< SCIP data structure */
305  SCIP_Real val, /**< unscaled value to check for scaled integrality */
306  SCIP_Real scalar /**< value to scale val with for checking for integrality */
307  );
308 
309 /** checks, if given fractional part is smaller than epsilon */
312  SCIP* scip, /**< SCIP data structure */
313  SCIP_Real val /**< value to process */
314  );
315 
316 /** rounds value + epsilon down to the next integer */
319  SCIP* scip, /**< SCIP data structure */
320  SCIP_Real val /**< value to process */
321  );
322 
323 /** rounds value - epsilon up to the next integer */
326  SCIP* scip, /**< SCIP data structure */
327  SCIP_Real val /**< value to process */
328  );
329 
330 /** rounds value to the nearest integer with epsilon tolerance */
333  SCIP* scip, /**< SCIP data structure */
334  SCIP_Real val /**< value to process */
335  );
336 
337 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
340  SCIP* scip, /**< SCIP data structure */
341  SCIP_Real val /**< value to return fractional part for */
342  );
343 
344 /** checks, if values are in range of sumepsilon */
347  SCIP* scip, /**< SCIP data structure */
348  SCIP_Real val1, /**< first value to be compared */
349  SCIP_Real val2 /**< second value to be compared */
350  );
351 
352 /** checks, if val1 is (more than sumepsilon) lower than val2 */
355  SCIP* scip, /**< SCIP data structure */
356  SCIP_Real val1, /**< first value to be compared */
357  SCIP_Real val2 /**< second value to be compared */
358  );
359 
360 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
363  SCIP* scip, /**< SCIP data structure */
364  SCIP_Real val1, /**< first value to be compared */
365  SCIP_Real val2 /**< second value to be compared */
366  );
367 
368 /** checks, if val1 is (more than sumepsilon) greater than val2 */
371  SCIP* scip, /**< SCIP data structure */
372  SCIP_Real val1, /**< first value to be compared */
373  SCIP_Real val2 /**< second value to be compared */
374  );
375 
376 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
379  SCIP* scip, /**< SCIP data structure */
380  SCIP_Real val1, /**< first value to be compared */
381  SCIP_Real val2 /**< second value to be compared */
382  );
383 
384 /** checks, if value is in range sumepsilon of 0.0 */
387  SCIP* scip, /**< SCIP data structure */
388  SCIP_Real val /**< value to process */
389  );
390 
391 /** checks, if value is greater than sumepsilon */
394  SCIP* scip, /**< SCIP data structure */
395  SCIP_Real val /**< value to process */
396  );
397 
398 /** checks, if value is lower than -sumepsilon */
401  SCIP* scip, /**< SCIP data structure */
402  SCIP_Real val /**< value to process */
403  );
404 
405 /** checks, if relative difference of values is in range of feasibility tolerance */
408  SCIP* scip, /**< SCIP data structure */
409  SCIP_Real val1, /**< first value to be compared */
410  SCIP_Real val2 /**< second value to be compared */
411  );
412 
413 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
416  SCIP* scip, /**< SCIP data structure */
417  SCIP_Real val1, /**< first value to be compared */
418  SCIP_Real val2 /**< second value to be compared */
419  );
420 
421 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
424  SCIP* scip, /**< SCIP data structure */
425  SCIP_Real val1, /**< first value to be compared */
426  SCIP_Real val2 /**< second value to be compared */
427  );
428 
429 /** checks, if relative difference of val1 and val2 is greater than feastol */
432  SCIP* scip, /**< SCIP data structure */
433  SCIP_Real val1, /**< first value to be compared */
434  SCIP_Real val2 /**< second value to be compared */
435  );
436 
437 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
440  SCIP* scip, /**< SCIP data structure */
441  SCIP_Real val1, /**< first value to be compared */
442  SCIP_Real val2 /**< second value to be compared */
443  );
444 
445 /** checks, if value is in range feasibility tolerance of 0.0 */
448  SCIP* scip, /**< SCIP data structure */
449  SCIP_Real val /**< value to process */
450  );
451 
452 /** checks, if value is greater than feasibility tolerance */
455  SCIP* scip, /**< SCIP data structure */
456  SCIP_Real val /**< value to process */
457  );
458 
459 /** checks, if value is lower than -feasibility tolerance */
462  SCIP* scip, /**< SCIP data structure */
463  SCIP_Real val /**< value to process */
464  );
465 
466 /** checks, if value is integral within the LP feasibility bounds */
469  SCIP* scip, /**< SCIP data structure */
470  SCIP_Real val /**< value to process */
471  );
472 
473 /** checks, if given fractional part is smaller than feastol */
476  SCIP* scip, /**< SCIP data structure */
477  SCIP_Real val /**< value to process */
478  );
479 
480 /** rounds value + feasibility tolerance down to the next integer */
483  SCIP* scip, /**< SCIP data structure */
484  SCIP_Real val /**< value to process */
485  );
486 
487 /** rounds value - feasibility tolerance up to the next integer */
490  SCIP* scip, /**< SCIP data structure */
491  SCIP_Real val /**< value to process */
492  );
493 
494 /** rounds value to the nearest integer in feasibility tolerance */
497  SCIP* scip, /**< SCIP data structure */
498  SCIP_Real val /**< value to process */
499  );
500 
501 /** returns fractional part of value, i.e. x - floor(x) */
504  SCIP* scip, /**< SCIP data structure */
505  SCIP_Real val /**< value to process */
506  );
507 
508 /** checks, if relative difference of values is in range of dual feasibility tolerance */
511  SCIP* scip, /**< SCIP data structure */
512  SCIP_Real val1, /**< first value to be compared */
513  SCIP_Real val2 /**< second value to be compared */
514  );
515 
516 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
519  SCIP* scip, /**< SCIP data structure */
520  SCIP_Real val1, /**< first value to be compared */
521  SCIP_Real val2 /**< second value to be compared */
522  );
523 
524 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
527  SCIP* scip, /**< SCIP data structure */
528  SCIP_Real val1, /**< first value to be compared */
529  SCIP_Real val2 /**< second value to be compared */
530  );
531 
532 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
535  SCIP* scip, /**< SCIP data structure */
536  SCIP_Real val1, /**< first value to be compared */
537  SCIP_Real val2 /**< second value to be compared */
538  );
539 
540 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
543  SCIP* scip, /**< SCIP data structure */
544  SCIP_Real val1, /**< first value to be compared */
545  SCIP_Real val2 /**< second value to be compared */
546  );
547 
548 /** checks, if value is in range dual feasibility tolerance of 0.0 */
551  SCIP* scip, /**< SCIP data structure */
552  SCIP_Real val /**< value to process */
553  );
554 
555 /** checks, if value is greater than dual feasibility tolerance */
558  SCIP* scip, /**< SCIP data structure */
559  SCIP_Real val /**< value to process */
560  );
561 
562 /** checks, if value is lower than -dual feasibility tolerance */
565  SCIP* scip, /**< SCIP data structure */
566  SCIP_Real val /**< value to process */
567  );
568 
569 /** checks, if value is integral within the LP dual feasibility tolerance */
572  SCIP* scip, /**< SCIP data structure */
573  SCIP_Real val /**< value to process */
574  );
575 
576 /** checks, if given fractional part is smaller than dual feasibility tolerance */
579  SCIP* scip, /**< SCIP data structure */
580  SCIP_Real val /**< value to process */
581  );
582 
583 /** rounds value + dual feasibility tolerance down to the next integer */
586  SCIP* scip, /**< SCIP data structure */
587  SCIP_Real val /**< value to process */
588  );
589 
590 /** rounds value - dual feasibility tolerance up to the next integer */
593  SCIP* scip, /**< SCIP data structure */
594  SCIP_Real val /**< value to process */
595  );
596 
597 /** rounds value to the nearest integer in dual feasibility tolerance */
600  SCIP* scip, /**< SCIP data structure */
601  SCIP_Real val /**< value to process */
602  );
603 
604 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
607  SCIP* scip, /**< SCIP data structure */
608  SCIP_Real val /**< value to process */
609  );
610 
611 /** checks, if the given new lower bound is tighter (w.r.t. bound strengthening epsilon) than the old one */
614  SCIP* scip, /**< SCIP data structure */
615  SCIP_Real newlb, /**< new lower bound */
616  SCIP_Real oldlb, /**< old lower bound */
617  SCIP_Real oldub /**< old upper bound */
618  );
619 
620 /** checks, if the given new upper bound is tighter (w.r.t. bound strengthening epsilon) than the old one */
623  SCIP* scip, /**< SCIP data structure */
624  SCIP_Real newub, /**< new upper bound */
625  SCIP_Real oldlb, /**< old lower bound */
626  SCIP_Real oldub /**< old upper bound */
627  );
628 
629 /** checks, if relative difference of values is in range of epsilon */
632  SCIP* scip, /**< SCIP data structure */
633  SCIP_Real val1, /**< first value to be compared */
634  SCIP_Real val2 /**< second value to be compared */
635  );
636 
637 /** checks, if relative difference of val1 and val2 is lower than epsilon */
640  SCIP* scip, /**< SCIP data structure */
641  SCIP_Real val1, /**< first value to be compared */
642  SCIP_Real val2 /**< second value to be compared */
643  );
644 
645 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
648  SCIP* scip, /**< SCIP data structure */
649  SCIP_Real val1, /**< first value to be compared */
650  SCIP_Real val2 /**< second value to be compared */
651  );
652 
653 /** checks, if relative difference of val1 and val2 is greater than epsilon */
656  SCIP* scip, /**< SCIP data structure */
657  SCIP_Real val1, /**< first value to be compared */
658  SCIP_Real val2 /**< second value to be compared */
659  );
660 
661 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
664  SCIP* scip, /**< SCIP data structure */
665  SCIP_Real val1, /**< first value to be compared */
666  SCIP_Real val2 /**< second value to be compared */
667  );
668 
669 /** checks, if relative difference of values is in range of sumepsilon */
672  SCIP* scip, /**< SCIP data structure */
673  SCIP_Real val1, /**< first value to be compared */
674  SCIP_Real val2 /**< second value to be compared */
675  );
676 
677 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
680  SCIP* scip, /**< SCIP data structure */
681  SCIP_Real val1, /**< first value to be compared */
682  SCIP_Real val2 /**< second value to be compared */
683  );
684 
685 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
688  SCIP* scip, /**< SCIP data structure */
689  SCIP_Real val1, /**< first value to be compared */
690  SCIP_Real val2 /**< second value to be compared */
691  );
692 
693 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
696  SCIP* scip, /**< SCIP data structure */
697  SCIP_Real val1, /**< first value to be compared */
698  SCIP_Real val2 /**< second value to be compared */
699  );
700 
701 /**! [SnippetCodeStyleNaming] */
702 
703 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
706  SCIP* scip, /**< SCIP data structure */
707  SCIP_Real val1, /**< first value to be compared */
708  SCIP_Real val2 /**< second value to be compared */
709  );
710 
711 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
712  * performance; in debug mode we check some additional conditions
713  */
716  SCIP* scip, /**< SCIP data structure */
717  SCIP_Real real /**< double bound to convert */
718  );
719 
720 /**! [SnippetCodeStyleNaming] */
721 
722 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
723  * performance; in debug mode we check some additional conditions
724  */
727  SCIP* scip, /**< SCIP data structure */
728  SCIP_Real real /**< double bound to convert */
729  );
730 
731 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
732  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
733  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
734  * were canceled out when increasing the value and are random after decreasing it.
735  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
736  * be expressed using fixed precision floating point arithmetic, anymore.
737  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
738  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
739  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
740  * "lp/recompfac" and should be recomputed.
741  */
744  SCIP* scip, /**< SCIP data structure */
745  SCIP_Real newvalue, /**< new value after update */
746  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
747  );
748 
749 #ifdef NDEBUG
750 
751 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
752  * speed up the algorithms.
753  */
754 
755 #define SCIPinfinity(scip) SCIPsetInfinity((scip)->set)
756 #define SCIPisInfinity(scip, val) SCIPsetIsInfinity((scip)->set, val)
757 #define SCIPisHugeValue(scip, val) SCIPsetIsHugeValue((scip)->set, val)
758 #define SCIPgetHugeValue(scip) SCIPsetGetHugeValue((scip)->set)
759 #define SCIPisEQ(scip, val1, val2) SCIPsetIsEQ((scip)->set, val1, val2)
760 #define SCIPisLT(scip, val1, val2) SCIPsetIsLT((scip)->set, val1, val2)
761 #define SCIPisLE(scip, val1, val2) SCIPsetIsLE((scip)->set, val1, val2)
762 #define SCIPisGT(scip, val1, val2) SCIPsetIsGT((scip)->set, val1, val2)
763 #define SCIPisGE(scip, val1, val2) SCIPsetIsGE((scip)->set, val1, val2)
764 #define SCIPisZero(scip, val) SCIPsetIsZero((scip)->set, val)
765 #define SCIPisPositive(scip, val) SCIPsetIsPositive((scip)->set, val)
766 #define SCIPisNegative(scip, val) SCIPsetIsNegative((scip)->set, val)
767 #define SCIPisIntegral(scip, val) SCIPsetIsIntegral((scip)->set, val)
768 #define SCIPisScalingIntegral(scip, val, scalar) SCIPsetIsScalingIntegral((scip)->set, val, scalar)
769 #define SCIPisFracIntegral(scip, val) SCIPsetIsFracIntegral((scip)->set, val)
770 #define SCIPfloor(scip, val) SCIPsetFloor((scip)->set, val)
771 #define SCIPceil(scip, val) SCIPsetCeil((scip)->set, val)
772 #define SCIPround(scip, val) SCIPsetRound((scip)->set, val)
773 #define SCIPfrac(scip, val) SCIPsetFrac((scip)->set, val)
774 
775 #define SCIPisSumEQ(scip, val1, val2) SCIPsetIsSumEQ((scip)->set, val1, val2)
776 #define SCIPisSumLT(scip, val1, val2) SCIPsetIsSumLT((scip)->set, val1, val2)
777 #define SCIPisSumLE(scip, val1, val2) SCIPsetIsSumLE((scip)->set, val1, val2)
778 #define SCIPisSumGT(scip, val1, val2) SCIPsetIsSumGT((scip)->set, val1, val2)
779 #define SCIPisSumGE(scip, val1, val2) SCIPsetIsSumGE((scip)->set, val1, val2)
780 #define SCIPisSumZero(scip, val) SCIPsetIsSumZero((scip)->set, val)
781 #define SCIPisSumPositive(scip, val) SCIPsetIsSumPositive((scip)->set, val)
782 #define SCIPisSumNegative(scip, val) SCIPsetIsSumNegative((scip)->set, val)
783 
784 #define SCIPisFeasEQ(scip, val1, val2) SCIPsetIsFeasEQ((scip)->set, val1, val2)
785 #define SCIPisFeasLT(scip, val1, val2) SCIPsetIsFeasLT((scip)->set, val1, val2)
786 #define SCIPisFeasLE(scip, val1, val2) SCIPsetIsFeasLE((scip)->set, val1, val2)
787 #define SCIPisFeasGT(scip, val1, val2) SCIPsetIsFeasGT((scip)->set, val1, val2)
788 #define SCIPisFeasGE(scip, val1, val2) SCIPsetIsFeasGE((scip)->set, val1, val2)
789 #define SCIPisFeasZero(scip, val) SCIPsetIsFeasZero((scip)->set, val)
790 #define SCIPisFeasPositive(scip, val) SCIPsetIsFeasPositive((scip)->set, val)
791 #define SCIPisFeasNegative(scip, val) SCIPsetIsFeasNegative((scip)->set, val)
792 #define SCIPisFeasIntegral(scip, val) SCIPsetIsFeasIntegral((scip)->set, val)
793 #define SCIPisFeasFracIntegral(scip, val) SCIPsetIsFeasFracIntegral((scip)->set, val)
794 #define SCIPfeasFloor(scip, val) SCIPsetFeasFloor((scip)->set, val)
795 #define SCIPfeasCeil(scip, val) SCIPsetFeasCeil((scip)->set, val)
796 #define SCIPfeasRound(scip, val) SCIPsetFeasRound((scip)->set, val)
797 #define SCIPfeasFrac(scip, val) SCIPsetFeasFrac((scip)->set, val)
798 
799 #define SCIPisDualfeasEQ(scip, val1, val2) SCIPsetIsDualfeasEQ((scip)->set, val1, val2)
800 #define SCIPisDualfeasLT(scip, val1, val2) SCIPsetIsDualfeasLT((scip)->set, val1, val2)
801 #define SCIPisDualfeasLE(scip, val1, val2) SCIPsetIsDualfeasLE((scip)->set, val1, val2)
802 #define SCIPisDualfeasGT(scip, val1, val2) SCIPsetIsDualfeasGT((scip)->set, val1, val2)
803 #define SCIPisDualfeasGE(scip, val1, val2) SCIPsetIsDualfeasGE((scip)->set, val1, val2)
804 #define SCIPisDualfeasZero(scip, val) SCIPsetIsDualfeasZero((scip)->set, val)
805 #define SCIPisDualfeasPositive(scip, val) SCIPsetIsDualfeasPositive((scip)->set, val)
806 #define SCIPisDualfeasNegative(scip, val) SCIPsetIsDualfeasNegative((scip)->set, val)
807 #define SCIPisDualfeasIntegral(scip, val) SCIPsetIsDualfeasIntegral((scip)->set, val)
808 #define SCIPisDualfeasFracIntegral(scip, val) SCIPsetIsDualfeasFracIntegral((scip)->set, val)
809 #define SCIPdualfeasFloor(scip, val) SCIPsetDualfeasFloor((scip)->set, val)
810 #define SCIPdualfeasCeil(scip, val) SCIPsetDualfeasCeil((scip)->set, val)
811 #define SCIPdualfeasRound(scip, val) SCIPsetDualfeasRound((scip)->set, val)
812 #define SCIPdualfeasFrac(scip, val) SCIPsetDualfeasFrac((scip)->set, val)
813 
814 #define SCIPisLbBetter(scip, newlb, oldlb, oldub) SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub)
815 #define SCIPisUbBetter(scip, newub, oldlb, oldub) SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub)
816 
817 #define SCIPisRelEQ(scip, val1, val2) SCIPsetIsRelEQ((scip)->set, val1, val2)
818 #define SCIPisRelLT(scip, val1, val2) SCIPsetIsRelLT((scip)->set, val1, val2)
819 #define SCIPisRelLE(scip, val1, val2) SCIPsetIsRelLE((scip)->set, val1, val2)
820 #define SCIPisRelGT(scip, val1, val2) SCIPsetIsRelGT((scip)->set, val1, val2)
821 #define SCIPisRelGE(scip, val1, val2) SCIPsetIsRelGE((scip)->set, val1, val2)
822 
823 #define SCIPisSumRelEQ(scip, val1, val2) SCIPsetIsSumRelEQ((scip)->set, val1, val2)
824 #define SCIPisSumRelLT(scip, val1, val2) SCIPsetIsSumRelLT((scip)->set, val1, val2)
825 #define SCIPisSumRelLE(scip, val1, val2) SCIPsetIsSumRelLE((scip)->set, val1, val2)
826 #define SCIPisSumRelGT(scip, val1, val2) SCIPsetIsSumRelGT((scip)->set, val1, val2)
827 #define SCIPisSumRelGE(scip, val1, val2) SCIPsetIsSumRelGE((scip)->set, val1, val2)
828 #define SCIPconvertRealToInt(scip, real) ((int)((real) < 0 ? ((real) - 0.5) : ((real) + 0.5)))
829 #define SCIPconvertRealToLongint(scip, real) ((SCIP_Longint)((real) < 0 ? ((real) - 0.5) : ((real) + 0.5)))
830 
831 #define SCIPisUpdateUnreliable(scip, newval, oldval) SCIPsetIsUpdateUnreliable((scip)->set, newval, oldval)
832 
833 #endif
834 
835 /** outputs a real number, or "+infinity", or "-infinity" to a file */
837 void SCIPprintReal(
838  SCIP* scip, /**< SCIP data structure */
839  FILE* file, /**< output file (or NULL for standard output) */
840  SCIP_Real val, /**< value to print */
841  int width, /**< width of the field */
842  int precision /**< number of significant digits printed */
843  );
844 
845 /** parse a real value that was written with SCIPprintReal() */
848  SCIP* scip, /**< SCIP data structure */
849  const char* str, /**< string to search */
850  SCIP_Real* value, /**< pointer to store the parsed value */
851  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
852  );
853 
854 /**@} */
855 
856 #ifdef __cplusplus
857 }
858 #endif
859 
860 #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:98
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:53
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:164
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:149
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)