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