Scippy

SCIP

Solving Constraint Integer Programs

scip_numerics.c
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.c
17  * @brief public methods for numerical tolerances
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include "scip/debug.h"
37 #include "scip/pub_message.h"
38 #include "scip/pub_misc.h"
39 #include "scip/scip_numerics.h"
40 #include "scip/set.h"
41 #include "scip/struct_lp.h"
42 #include "scip/struct_scip.h"
43 #include <string.h>
44 
45 
46 /* In debug mode, the following methods are implemented as function calls to ensure
47  * type validity.
48  * In optimized mode, the methods are implemented as defines to improve performance.
49  * However, we want to have them in the library anyways, so we have to undef the defines.
50  */
51 
52 #undef SCIPinfinity
53 #undef SCIPisInfinity
54 #undef SCIPisEQ
55 #undef SCIPisLT
56 #undef SCIPisLE
57 #undef SCIPisGT
58 #undef SCIPisGE
59 #undef SCIPisZero
60 #undef SCIPisPositive
61 #undef SCIPisNegative
62 #undef SCIPisIntegral
63 #undef SCIPisScalingIntegral
64 #undef SCIPisFracIntegral
65 #undef SCIPfloor
66 #undef SCIPceil
67 #undef SCIPround
68 #undef SCIPfrac
69 #undef SCIPisSumEQ
70 #undef SCIPisSumLT
71 #undef SCIPisSumLE
72 #undef SCIPisSumGT
73 #undef SCIPisSumGE
74 #undef SCIPisSumZero
75 #undef SCIPisSumPositive
76 #undef SCIPisSumNegative
77 #undef SCIPisFeasEQ
78 #undef SCIPisFeasLT
79 #undef SCIPisFeasLE
80 #undef SCIPisFeasGT
81 #undef SCIPisFeasGE
82 #undef SCIPisFeasZero
83 #undef SCIPisFeasPositive
84 #undef SCIPisFeasNegative
85 #undef SCIPisFeasIntegral
86 #undef SCIPisFeasFracIntegral
87 #undef SCIPfeasFloor
88 #undef SCIPfeasCeil
89 #undef SCIPfeasRound
90 #undef SCIPfeasFrac
91 #undef SCIPisDualfeasEQ
92 #undef SCIPisDualfeasLT
93 #undef SCIPisDualfeasLE
94 #undef SCIPisDualfeasGT
95 #undef SCIPisDualfeasGE
96 #undef SCIPisDualfeasZero
97 #undef SCIPisDualfeasPositive
98 #undef SCIPisDualfeasNegative
99 #undef SCIPisDualfeasIntegral
100 #undef SCIPisDualfeasFracIntegral
101 #undef SCIPdualfeasFloor
102 #undef SCIPdualfeasCeil
103 #undef SCIPdualfeasRound
104 #undef SCIPdualfeasFrac
105 #undef SCIPisLbBetter
106 #undef SCIPisUbBetter
107 #undef SCIPisRelEQ
108 #undef SCIPisRelLT
109 #undef SCIPisRelLE
110 #undef SCIPisRelGT
111 #undef SCIPisRelGE
112 #undef SCIPisSumRelEQ
113 #undef SCIPisSumRelLT
114 #undef SCIPisSumRelLE
115 #undef SCIPisSumRelGT
116 #undef SCIPisSumRelGE
117 #undef SCIPconvertRealToInt
118 #undef SCIPconvertRealToLongint
119 #undef SCIPisUpdateUnreliable
120 #undef SCIPisHugeValue
121 #undef SCIPgetHugeValue
122 
123 /** returns value treated as zero
124  *
125  * @return value treated as zero
126  */
128  SCIP* scip /**< SCIP data structure */
129  )
130 {
131  assert(scip != NULL);
132  assert(scip->set != NULL);
133 
134  return SCIPsetEpsilon(scip->set);
135 }
136 
137 /** returns value treated as zero for sums of floating point values
138  *
139  * @return value treated as zero for sums of floating point values
140  */
142  SCIP* scip /**< SCIP data structure */
143  )
144 {
145  assert(scip != NULL);
146  assert(scip->set != NULL);
147 
148  return SCIPsetSumepsilon(scip->set);
149 }
150 
151 /** returns feasibility tolerance for constraints
152  *
153  * @return feasibility tolerance for constraints
154  */
156  SCIP* scip /**< SCIP data structure */
157  )
158 {
159  assert(scip != NULL);
160  assert(scip->set != NULL);
161 
162  return SCIPsetFeastol(scip->set);
163 }
164 
165 /** returns primal feasibility tolerance of LP solver
166  *
167  * @return primal feasibility tolerance of LP solver
168  */
170  SCIP* scip /**< SCIP data structure */
171  )
172 {
173  assert(scip != NULL);
174  assert(scip->set != NULL);
175 
176  return SCIPsetLpfeastol(scip->set);
177 }
178 
179 /** returns feasibility tolerance for reduced costs
180  *
181  * @return feasibility tolerance for reduced costs
182  */
184  SCIP* scip /**< SCIP data structure */
185  )
186 {
187  assert(scip != NULL);
188  assert(scip->set != NULL);
189 
190  return SCIPsetDualfeastol(scip->set);
191 }
192 
193 /** returns convergence tolerance used in barrier algorithm
194  *
195  * @return convergence tolerance used in barrier algorithm
196  */
198  SCIP* scip /**< SCIP data structure */
199  )
200 {
201  assert(scip != NULL);
202  assert(scip->set != NULL);
203 
204  return SCIPsetBarrierconvtol(scip->set);
205 }
206 
207 /** return the cutoff bound delta
208  *
209  * @return cutoff bound data
210  */
212  SCIP* scip /**< SCIP data structure */
213  )
214 {
215  assert(scip != NULL);
216  assert(scip->set != NULL);
217 
218  return SCIPsetCutoffbounddelta(scip->set);
219 }
220 
221 /** return the relaxation primal feasibility tolerance
222  *
223  * @see SCIPchgRelaxfeastol
224  * @return relaxfeastol
225  */
227  SCIP* scip /**< SCIP data structure */
228  )
229 {
230  assert(scip != NULL);
231  assert(scip->set != NULL);
232 
233  return SCIPsetRelaxfeastol(scip->set);
234 }
235 
236 /** sets the feasibility tolerance for constraints
237  *
238  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
239  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
240  */
242  SCIP* scip, /**< SCIP data structure */
243  SCIP_Real feastol /**< new feasibility tolerance for constraints */
244  )
245 {
246  assert(scip != NULL);
247 
248  /* change the settings */
249  SCIP_CALL( SCIPsetSetFeastol(scip->set, feastol) );
250 
251  return SCIP_OKAY;
252 }
253 
254 /** sets the primal feasibility tolerance of LP solver
255  *
256  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
257  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
258  */
260  SCIP* scip, /**< SCIP data structure */
261  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
262  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
263  )
264 {
265  assert(scip != NULL);
266 
267  /* mark the LP unsolved, if the primal feasibility tolerance was tightened */
268  if( scip->lp != NULL && lpfeastol < SCIPsetLpfeastol(scip->set) )
269  {
270  scip->lp->solved = FALSE;
272  }
273 
274  /* change the settings */
275  SCIP_CALL( SCIPsetSetLpfeastol(scip->set, lpfeastol, printnewvalue) );
276 
277  return SCIP_OKAY;
278 }
279 
280 /** sets the feasibility tolerance for reduced costs
281  *
282  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
283  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
284  */
286  SCIP* scip, /**< SCIP data structure */
287  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
288  )
289 {
290  assert(scip != NULL);
291 
292  /* mark the LP unsolved, if the dual feasibility tolerance was tightened */
293  if( scip->lp != NULL && dualfeastol < SCIPsetDualfeastol(scip->set) )
294  {
295  scip->lp->solved = FALSE;
297  }
298 
299  /* change the settings */
300  SCIP_CALL( SCIPsetSetDualfeastol(scip->set, dualfeastol) );
301 
302  return SCIP_OKAY;
303 }
304 
305 /** sets the convergence tolerance used in barrier algorithm
306  *
307  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
308  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
309  */
311  SCIP* scip, /**< SCIP data structure */
312  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
313  )
314 {
315  assert(scip != NULL);
316 
317  /* mark the LP unsolved, if the convergence tolerance was tightened, and the LP was solved with the barrier algorithm */
318  if( scip->lp != NULL && barrierconvtol < SCIPsetBarrierconvtol(scip->set)
320  scip->lp->solved = FALSE;
321 
322  /* change the settings */
323  SCIP_CALL( SCIPsetSetBarrierconvtol(scip->set, barrierconvtol) );
324 
325  return SCIP_OKAY;
326 }
327 
328 /** sets the primal feasibility tolerance of relaxations
329  *
330  * This tolerance value is used by the SCIP core and plugins to tighten then feasibility tolerance on relaxations
331  * (especially the LP relaxation) during a solve. It is set to SCIP_INVALID initially, which means that only the
332  * feasibility tolerance of the particular relaxation is taken into account. If set to a valid value, however,
333  * then this value should be used to reduce the primal feasibility tolerance of a relaxation (thus, use the
334  * minimum of relaxfeastol and the relaxations primal feastol).
335  *
336  * @pre The value of relaxfeastol is reset to SCIP_INVALID when initializing the solve (INITSOL).
337  * Therefore, this method can only be called in one of the following stages of the SCIP solving process:
338  * - \ref SCIP_STAGE_INITSOLVE
339  * - \ref SCIP_STAGE_SOLVING
340  *
341  * @return previous value of relaxfeastol
342  */
344  SCIP* scip, /**< SCIP data structure */
345  SCIP_Real relaxfeastol /**< new primal feasibility tolerance of relaxations */
346  )
347 {
348  assert(scip != NULL);
349  assert(scip->set != NULL);
350 
351  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPchgRelaxfeastol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
352 
353  return SCIPsetSetRelaxfeastol(scip->set, relaxfeastol);
354 }
355 
356 /** marks that some limit parameter was changed */
358  SCIP* scip /**< SCIP data structure */
359  )
360 {
361  assert(scip != NULL);
362 
363  /* change the settings */
365 }
366 
367 /** outputs a real number, or "+infinity", or "-infinity" to a file */
369  SCIP* scip, /**< SCIP data structure */
370  FILE* file, /**< output file (or NULL for standard output) */
371  SCIP_Real val, /**< value to print */
372  int width, /**< width of the field */
373  int precision /**< number of significant digits printed */
374  )
375 {
376  char s[SCIP_MAXSTRLEN];
377  char strformat[SCIP_MAXSTRLEN];
378 
379  assert(scip != NULL);
380 
381  if( SCIPsetIsInfinity(scip->set, val) )
382  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "+infinity");
383  else if( SCIPsetIsInfinity(scip->set, -val) )
384  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "-infinity");
385  else
386  {
387  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%.%dg", precision);
388  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, (const char*)strformat, val);
389  }
390  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%%ds", width);
391  SCIPmessageFPrintInfo(scip->messagehdlr, file, (const char*)strformat, s);
392 }
393 
394 /** parse a real value that was written with SCIPprintReal() */
396  SCIP* scip, /**< SCIP data structure */
397  const char* str, /**< string to search */
398  SCIP_Real* value, /**< pointer to store the parsed value */
399  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
400  )
401 {
402  char* localstr;
403 
404  assert(scip != NULL);
405  assert(str != NULL);
406  assert(value != NULL);
407  assert(endptr != NULL);
408 
409  localstr = (char*)str;
410 
411  /* ignore white space */
412  while(isspace((unsigned char)*localstr))
413  ++localstr;
414 
415  /* test for a special infinity first */
416  if( strncmp(localstr, "+infinity", 9) == 0 )
417  {
418  *value = SCIPinfinity(scip);
419  *endptr = (char*)(localstr + 9);
420  return TRUE;
421  }
422  else if( strncmp(localstr, "-infinity", 9) == 0 )
423  {
424  *value = -SCIPinfinity(scip);
425  *endptr = (char*)(localstr + 9);
426  return TRUE;
427  }
428  else
429  {
430  /* parse a finite value */
431  return SCIPstrToRealValue(str, value, endptr);
432  }
433 }
434 
435 /** checks, if values are in range of epsilon */
437  SCIP* scip, /**< SCIP data structure */
438  SCIP_Real val1, /**< first value to be compared */
439  SCIP_Real val2 /**< second value to be compared */
440  )
441 {
442  assert(scip != NULL);
443  assert(scip->set != NULL);
444 
445  return SCIPsetIsEQ(scip->set, val1, val2);
446 }
447 
448 /** checks, if val1 is (more than epsilon) lower than val2 */
450  SCIP* scip, /**< SCIP data structure */
451  SCIP_Real val1, /**< first value to be compared */
452  SCIP_Real val2 /**< second value to be compared */
453  )
454 {
455  assert(scip != NULL);
456  assert(scip->set != NULL);
457 
458  return SCIPsetIsLT(scip->set, val1, val2);
459 }
460 
461 /** checks, if val1 is not (more than epsilon) greater than val2 */
463  SCIP* scip, /**< SCIP data structure */
464  SCIP_Real val1, /**< first value to be compared */
465  SCIP_Real val2 /**< second value to be compared */
466  )
467 {
468  assert(scip != NULL);
469  assert(scip->set != NULL);
470 
471  return SCIPsetIsLE(scip->set, val1, val2);
472 }
473 
474 /** checks, if val1 is (more than epsilon) greater than val2 */
476  SCIP* scip, /**< SCIP data structure */
477  SCIP_Real val1, /**< first value to be compared */
478  SCIP_Real val2 /**< second value to be compared */
479  )
480 {
481  assert(scip != NULL);
482  assert(scip->set != NULL);
483 
484  return SCIPsetIsGT(scip->set, val1, val2);
485 }
486 
487 /** checks, if val1 is not (more than epsilon) lower than val2 */
489  SCIP* scip, /**< SCIP data structure */
490  SCIP_Real val1, /**< first value to be compared */
491  SCIP_Real val2 /**< second value to be compared */
492  )
493 {
494  assert(scip != NULL);
495  assert(scip->set != NULL);
496 
497  return SCIPsetIsGE(scip->set, val1, val2);
498 }
499 
500 /** returns value treated as infinity */
502  SCIP* scip /**< SCIP data structure */
503  )
504 {
505  assert(scip != NULL);
506  assert(scip->set != NULL);
507 
508  return SCIPsetInfinity(scip->set);
509 }
510 
511 /** checks, if value is (positive) infinite */
513  SCIP* scip, /**< SCIP data structure */
514  SCIP_Real val /**< value to be compared against infinity */
515  )
516 {
517  assert(scip != NULL);
518  assert(scip->set != NULL);
519 
520  return SCIPsetIsInfinity(scip->set, val);
521 }
522 
523 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
525  SCIP* scip, /**< SCIP data structure */
526  SCIP_Real val /**< value to be checked whether it is huge */
527  )
528 {
529  assert(scip != NULL);
530  assert(scip->set != NULL);
531 
532  return SCIPsetIsHugeValue(scip->set, val);
533 }
534 
535 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
536  * computation)
537  */
539  SCIP* scip /**< SCIP data structure */
540  )
541 {
542  assert(scip != NULL);
543  assert(scip->set != NULL);
544 
545  return SCIPsetGetHugeValue(scip->set);
546 }
547 
548 /** checks, if value is in range epsilon of 0.0 */
550  SCIP* scip, /**< SCIP data structure */
551  SCIP_Real val /**< value to process */
552  )
553 {
554  assert(scip != NULL);
555  assert(scip->set != NULL);
556 
557  return SCIPsetIsZero(scip->set, val);
558 }
559 
560 /** checks, if value is greater than epsilon */
562  SCIP* scip, /**< SCIP data structure */
563  SCIP_Real val /**< value to process */
564  )
565 {
566  assert(scip != NULL);
567  assert(scip->set != NULL);
568 
569  return SCIPsetIsPositive(scip->set, val);
570 }
571 
572 /** checks, if value is lower than -epsilon */
574  SCIP* scip, /**< SCIP data structure */
575  SCIP_Real val /**< value to process */
576  )
577 {
578  assert(scip != NULL);
579  assert(scip->set != NULL);
580 
581  return SCIPsetIsNegative(scip->set, val);
582 }
583 
584 /** checks, if value is integral within epsilon */
586  SCIP* scip, /**< SCIP data structure */
587  SCIP_Real val /**< value to process */
588  )
589 {
590  assert(scip != NULL);
591  assert(scip->set != NULL);
592 
593  return SCIPsetIsIntegral(scip->set, val);
594 }
595 
596 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
598  SCIP* scip, /**< SCIP data structure */
599  SCIP_Real val, /**< unscaled value to check for scaled integrality */
600  SCIP_Real scalar /**< value to scale val with for checking for integrality */
601  )
602 {
603  assert(scip != NULL);
604  assert(scip->set != NULL);
605 
606  return SCIPsetIsScalingIntegral(scip->set, val, scalar);
607 }
608 
609 /** checks, if given fractional part is smaller than epsilon */
611  SCIP* scip, /**< SCIP data structure */
612  SCIP_Real val /**< value to process */
613  )
614 {
615  assert(scip != NULL);
616  assert(scip->set != NULL);
617 
618  return SCIPsetIsFracIntegral(scip->set, val);
619 }
620 
621 /** rounds value + epsilon down to the next integer */
623  SCIP* scip, /**< SCIP data structure */
624  SCIP_Real val /**< value to process */
625  )
626 {
627  assert(scip != NULL);
628  assert(scip->set != NULL);
629 
630  return SCIPsetFloor(scip->set, val);
631 }
632 
633 /** rounds value - epsilon up to the next integer */
635  SCIP* scip, /**< SCIP data structure */
636  SCIP_Real val /**< value to process */
637  )
638 {
639  assert(scip != NULL);
640  assert(scip->set != NULL);
641 
642  return SCIPsetCeil(scip->set, val);
643 }
644 
645 /** rounds value to the nearest integer with epsilon tolerance */
647  SCIP* scip, /**< SCIP data structure */
648  SCIP_Real val /**< value to process */
649  )
650 {
651  assert(scip != NULL);
652  assert(scip->set != NULL);
653 
654  return SCIPsetRound(scip->set, val);
655 }
656 
657 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
659  SCIP* scip, /**< SCIP data structure */
660  SCIP_Real val /**< value to return fractional part for */
661  )
662 {
663  assert(scip != NULL);
664  assert(scip->set != NULL);
665 
666  return SCIPsetFrac(scip->set, val);
667 }
668 
669 /** checks, if values are in range of sumepsilon */
671  SCIP* scip, /**< SCIP data structure */
672  SCIP_Real val1, /**< first value to be compared */
673  SCIP_Real val2 /**< second value to be compared */
674  )
675 {
676  assert(scip != NULL);
677  assert(scip->set != NULL);
678 
679  return SCIPsetIsSumEQ(scip->set, val1, val2);
680 }
681 
682 /** checks, if val1 is (more than sumepsilon) lower than val2 */
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  assert(scip != NULL);
690  assert(scip->set != NULL);
691 
692  return SCIPsetIsSumLT(scip->set, val1, val2);
693 }
694 
695 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
697  SCIP* scip, /**< SCIP data structure */
698  SCIP_Real val1, /**< first value to be compared */
699  SCIP_Real val2 /**< second value to be compared */
700  )
701 {
702  assert(scip != NULL);
703  assert(scip->set != NULL);
704 
705  return SCIPsetIsSumLE(scip->set, val1, val2);
706 }
707 
708 /** checks, if val1 is (more than sumepsilon) greater than val2 */
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  assert(scip != NULL);
716  assert(scip->set != NULL);
717 
718  return SCIPsetIsSumGT(scip->set, val1, val2);
719 }
720 
721 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
723  SCIP* scip, /**< SCIP data structure */
724  SCIP_Real val1, /**< first value to be compared */
725  SCIP_Real val2 /**< second value to be compared */
726  )
727 {
728  assert(scip != NULL);
729  assert(scip->set != NULL);
730 
731  return SCIPsetIsSumGE(scip->set, val1, val2);
732 }
733 
734 /** checks, if value is in range sumepsilon of 0.0 */
736  SCIP* scip, /**< SCIP data structure */
737  SCIP_Real val /**< value to process */
738  )
739 {
740  assert(scip != NULL);
741  assert(scip->set != NULL);
742 
743  return SCIPsetIsSumZero(scip->set, val);
744 }
745 
746 /** checks, if value is greater than sumepsilon */
748  SCIP* scip, /**< SCIP data structure */
749  SCIP_Real val /**< value to process */
750  )
751 {
752  assert(scip != NULL);
753  assert(scip->set != NULL);
754 
755  return SCIPsetIsSumPositive(scip->set, val);
756 }
757 
758 /** checks, if value is lower than -sumepsilon */
760  SCIP* scip, /**< SCIP data structure */
761  SCIP_Real val /**< value to process */
762  )
763 {
764  assert(scip != NULL);
765  assert(scip->set != NULL);
766 
767  return SCIPsetIsSumNegative(scip->set, val);
768 }
769 
770 /** checks, if relative difference of values is in range of feasibility tolerance */
772  SCIP* scip, /**< SCIP data structure */
773  SCIP_Real val1, /**< first value to be compared */
774  SCIP_Real val2 /**< second value to be compared */
775  )
776 {
777  assert(scip != NULL);
778  assert(scip->set != NULL);
779 
780  return SCIPsetIsFeasEQ(scip->set, val1, val2);
781 }
782 
783 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
785  SCIP* scip, /**< SCIP data structure */
786  SCIP_Real val1, /**< first value to be compared */
787  SCIP_Real val2 /**< second value to be compared */
788  )
789 {
790  assert(scip != NULL);
791  assert(scip->set != NULL);
792 
793  return SCIPsetIsFeasLT(scip->set, val1, val2);
794 }
795 
796 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
798  SCIP* scip, /**< SCIP data structure */
799  SCIP_Real val1, /**< first value to be compared */
800  SCIP_Real val2 /**< second value to be compared */
801  )
802 {
803  assert(scip != NULL);
804  assert(scip->set != NULL);
805 
806  return SCIPsetIsFeasLE(scip->set, val1, val2);
807 }
808 
809 /** checks, if relative difference of val1 and val2 is greater than feastol */
811  SCIP* scip, /**< SCIP data structure */
812  SCIP_Real val1, /**< first value to be compared */
813  SCIP_Real val2 /**< second value to be compared */
814  )
815 {
816  assert(scip != NULL);
817  assert(scip->set != NULL);
818 
819  return SCIPsetIsFeasGT(scip->set, val1, val2);
820 }
821 
822 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
824  SCIP* scip, /**< SCIP data structure */
825  SCIP_Real val1, /**< first value to be compared */
826  SCIP_Real val2 /**< second value to be compared */
827  )
828 {
829  assert(scip != NULL);
830  assert(scip->set != NULL);
831 
832  return SCIPsetIsFeasGE(scip->set, val1, val2);
833 }
834 
835 /** checks, if value is in range feasibility tolerance of 0.0 */
837  SCIP* scip, /**< SCIP data structure */
838  SCIP_Real val /**< value to process */
839  )
840 {
841  assert(scip != NULL);
842  assert(scip->set != NULL);
843 
844  return SCIPsetIsFeasZero(scip->set, val);
845 }
846 
847 /** checks, if value is greater than feasibility tolerance */
849  SCIP* scip, /**< SCIP data structure */
850  SCIP_Real val /**< value to process */
851  )
852 {
853  assert(scip != NULL);
854  assert(scip->set != NULL);
855 
856  return SCIPsetIsFeasPositive(scip->set, val);
857 }
858 
859 /** checks, if value is lower than -feasibility tolerance */
861  SCIP* scip, /**< SCIP data structure */
862  SCIP_Real val /**< value to process */
863  )
864 {
865  assert(scip != NULL);
866  assert(scip->set != NULL);
867 
868  return SCIPsetIsFeasNegative(scip->set, val);
869 }
870 
871 /** checks, if value is integral within the LP feasibility bounds */
873  SCIP* scip, /**< SCIP data structure */
874  SCIP_Real val /**< value to process */
875  )
876 {
877  assert(scip != NULL);
878  assert(scip->set != NULL);
879 
880  return SCIPsetIsFeasIntegral(scip->set, val);
881 }
882 
883 /** checks, if given fractional part is smaller than feastol */
885  SCIP* scip, /**< SCIP data structure */
886  SCIP_Real val /**< value to process */
887  )
888 {
889  assert(scip != NULL);
890  assert(scip->set != NULL);
891 
892  return SCIPsetIsFeasFracIntegral(scip->set, val);
893 }
894 
895 /** rounds value + feasibility tolerance down to the next integer */
897  SCIP* scip, /**< SCIP data structure */
898  SCIP_Real val /**< value to process */
899  )
900 {
901  assert(scip != NULL);
902  assert(scip->set != NULL);
903 
904  return SCIPsetFeasFloor(scip->set, val);
905 }
906 
907 /** rounds value - feasibility tolerance up to the next integer */
909  SCIP* scip, /**< SCIP data structure */
910  SCIP_Real val /**< value to process */
911  )
912 {
913  assert(scip != NULL);
914  assert(scip->set != NULL);
915 
916  return SCIPsetFeasCeil(scip->set, val);
917 }
918 
919 /** rounds value to the nearest integer in feasibility tolerance */
921  SCIP* scip, /**< SCIP data structure */
922  SCIP_Real val /**< value to process */
923  )
924 {
925  assert(scip != NULL);
926  assert(scip->set != NULL);
927 
928  return SCIPsetFeasRound(scip->set, val);
929 }
930 
931 /** returns fractional part of value, i.e. x - floor(x) in feasibility tolerance */
933  SCIP* scip, /**< SCIP data structure */
934  SCIP_Real val /**< value to process */
935  )
936 {
937  assert(scip != NULL);
938  assert(scip->set != NULL);
939 
940  return SCIPsetFeasFrac(scip->set, val);
941 }
942 
943 /** checks, if relative difference of values is in range of dual feasibility tolerance */
945  SCIP* scip, /**< SCIP data structure */
946  SCIP_Real val1, /**< first value to be compared */
947  SCIP_Real val2 /**< second value to be compared */
948  )
949 {
950  assert(scip != NULL);
951  assert(scip->set != NULL);
952 
953  return SCIPsetIsDualfeasEQ(scip->set, val1, val2);
954 }
955 
956 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
958  SCIP* scip, /**< SCIP data structure */
959  SCIP_Real val1, /**< first value to be compared */
960  SCIP_Real val2 /**< second value to be compared */
961  )
962 {
963  assert(scip != NULL);
964  assert(scip->set != NULL);
965 
966  return SCIPsetIsDualfeasLT(scip->set, val1, val2);
967 }
968 
969 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
971  SCIP* scip, /**< SCIP data structure */
972  SCIP_Real val1, /**< first value to be compared */
973  SCIP_Real val2 /**< second value to be compared */
974  )
975 {
976  assert(scip != NULL);
977  assert(scip->set != NULL);
978 
979  return SCIPsetIsDualfeasLE(scip->set, val1, val2);
980 }
981 
982 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
984  SCIP* scip, /**< SCIP data structure */
985  SCIP_Real val1, /**< first value to be compared */
986  SCIP_Real val2 /**< second value to be compared */
987  )
988 {
989  assert(scip != NULL);
990  assert(scip->set != NULL);
991 
992  return SCIPsetIsDualfeasGT(scip->set, val1, val2);
993 }
994 
995 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
997  SCIP* scip, /**< SCIP data structure */
998  SCIP_Real val1, /**< first value to be compared */
999  SCIP_Real val2 /**< second value to be compared */
1000  )
1001 {
1002  assert(scip != NULL);
1003  assert(scip->set != NULL);
1004 
1005  return SCIPsetIsDualfeasGE(scip->set, val1, val2);
1006 }
1007 
1008 /** checks, if value is in range dual feasibility tolerance of 0.0 */
1010  SCIP* scip, /**< SCIP data structure */
1011  SCIP_Real val /**< value to process */
1012  )
1013 {
1014  assert(scip != NULL);
1015  assert(scip->set != NULL);
1016 
1017  return SCIPsetIsDualfeasZero(scip->set, val);
1018 }
1019 
1020 /** checks, if value is greater than dual feasibility tolerance */
1022  SCIP* scip, /**< SCIP data structure */
1023  SCIP_Real val /**< value to process */
1024  )
1025 {
1026  assert(scip != NULL);
1027  assert(scip->set != NULL);
1028 
1029  return SCIPsetIsDualfeasPositive(scip->set, val);
1030 }
1031 
1032 /** checks, if value is lower than -dual feasibility tolerance */
1034  SCIP* scip, /**< SCIP data structure */
1035  SCIP_Real val /**< value to process */
1036  )
1037 {
1038  assert(scip != NULL);
1039  assert(scip->set != NULL);
1040 
1041  return SCIPsetIsDualfeasNegative(scip->set, val);
1042 }
1043 
1044 /** checks, if value is integral within the LP dual feasibility tolerance */
1046  SCIP* scip, /**< SCIP data structure */
1047  SCIP_Real val /**< value to process */
1048  )
1049 {
1050  assert(scip != NULL);
1051  assert(scip->set != NULL);
1052 
1053  return SCIPsetIsDualfeasIntegral(scip->set, val);
1054 }
1055 
1056 /** checks, if given fractional part is smaller than dual feasibility tolerance */
1058  SCIP* scip, /**< SCIP data structure */
1059  SCIP_Real val /**< value to process */
1060  )
1061 {
1062  assert(scip != NULL);
1063  assert(scip->set != NULL);
1064 
1065  return SCIPsetIsDualfeasFracIntegral(scip->set, val);
1066 }
1067 
1068 /** rounds value + dual feasibility tolerance down to the next integer */
1070  SCIP* scip, /**< SCIP data structure */
1071  SCIP_Real val /**< value to process */
1072  )
1073 {
1074  assert(scip != NULL);
1075  assert(scip->set != NULL);
1076 
1077  return SCIPsetDualfeasFloor(scip->set, val);
1078 }
1079 
1080 /** rounds value - dual feasibility tolerance up to the next integer */
1082  SCIP* scip, /**< SCIP data structure */
1083  SCIP_Real val /**< value to process */
1084  )
1085 {
1086  assert(scip != NULL);
1087  assert(scip->set != NULL);
1088 
1089  return SCIPsetDualfeasCeil(scip->set, val);
1090 }
1091 
1092 /** rounds value to the nearest integer in dual feasibility tolerance */
1094  SCIP* scip, /**< SCIP data structure */
1095  SCIP_Real val /**< value to process */
1096  )
1097 {
1098  assert(scip != NULL);
1099  assert(scip->set != NULL);
1100 
1101  return SCIPsetDualfeasRound(scip->set, val);
1102 }
1103 
1104 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
1106  SCIP* scip, /**< SCIP data structure */
1107  SCIP_Real val /**< value to process */
1108  )
1109 {
1110  assert(scip != NULL);
1111  assert(scip->set != NULL);
1112 
1113  return SCIPsetDualfeasFrac(scip->set, val);
1114 }
1115 
1116 /** checks, if the given new lower bound is at least min(oldub - oldlb, |oldlb|) times the bound
1117  * strengthening epsilon better than the old one
1118  */
1120  SCIP* scip, /**< SCIP data structure */
1121  SCIP_Real newlb, /**< new lower bound */
1122  SCIP_Real oldlb, /**< old lower bound */
1123  SCIP_Real oldub /**< old upper bound */
1124  )
1125 {
1126  assert(scip != NULL);
1127 
1128  return SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub);
1129 }
1130 
1131 /** checks, if the given new upper bound is at least min(oldub - oldlb, |oldub|) times the bound
1132  * strengthening epsilon better than the old one
1133  */
1135  SCIP* scip, /**< SCIP data structure */
1136  SCIP_Real newub, /**< new upper bound */
1137  SCIP_Real oldlb, /**< old lower bound */
1138  SCIP_Real oldub /**< old upper bound */
1139  )
1140 {
1141  assert(scip != NULL);
1142 
1143  return SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub);
1144 }
1145 
1146 /** checks, if relative difference of values is in range of epsilon */
1148  SCIP* scip, /**< SCIP data structure */
1149  SCIP_Real val1, /**< first value to be compared */
1150  SCIP_Real val2 /**< second value to be compared */
1151  )
1152 {
1153  assert(scip != NULL);
1154  assert(scip->set != NULL);
1155 
1156  return SCIPsetIsRelEQ(scip->set, val1, val2);
1157 }
1158 
1159 /** checks, if relative difference of val1 and val2 is lower than epsilon */
1161  SCIP* scip, /**< SCIP data structure */
1162  SCIP_Real val1, /**< first value to be compared */
1163  SCIP_Real val2 /**< second value to be compared */
1164  )
1165 {
1166  assert(scip != NULL);
1167  assert(scip->set != NULL);
1168 
1169  return SCIPsetIsRelLT(scip->set, val1, val2);
1170 }
1171 
1172 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
1174  SCIP* scip, /**< SCIP data structure */
1175  SCIP_Real val1, /**< first value to be compared */
1176  SCIP_Real val2 /**< second value to be compared */
1177  )
1178 {
1179  assert(scip != NULL);
1180  assert(scip->set != NULL);
1181 
1182  return SCIPsetIsRelLE(scip->set, val1, val2);
1183 }
1184 
1185 /** checks, if relative difference of val1 and val2 is greater than epsilon */
1187  SCIP* scip, /**< SCIP data structure */
1188  SCIP_Real val1, /**< first value to be compared */
1189  SCIP_Real val2 /**< second value to be compared */
1190  )
1191 {
1192  assert(scip != NULL);
1193  assert(scip->set != NULL);
1194 
1195  return SCIPsetIsRelGT(scip->set, val1, val2);
1196 }
1197 
1198 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
1200  SCIP* scip, /**< SCIP data structure */
1201  SCIP_Real val1, /**< first value to be compared */
1202  SCIP_Real val2 /**< second value to be compared */
1203  )
1204 {
1205  assert(scip != NULL);
1206  assert(scip->set != NULL);
1207 
1208  return SCIPsetIsRelGE(scip->set, val1, val2);
1209 }
1210 
1211 /** checks, if relative difference of values is in range of sumepsilon */
1213  SCIP* scip, /**< SCIP data structure */
1214  SCIP_Real val1, /**< first value to be compared */
1215  SCIP_Real val2 /**< second value to be compared */
1216  )
1217 {
1218  assert(scip != NULL);
1219  assert(scip->set != NULL);
1220 
1221  return SCIPsetIsSumRelEQ(scip->set, val1, val2);
1222 }
1223 
1224 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
1226  SCIP* scip, /**< SCIP data structure */
1227  SCIP_Real val1, /**< first value to be compared */
1228  SCIP_Real val2 /**< second value to be compared */
1229  )
1230 {
1231  assert(scip != NULL);
1232  assert(scip->set != NULL);
1233 
1234  return SCIPsetIsSumRelLT(scip->set, val1, val2);
1235 }
1236 
1237 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
1239  SCIP* scip, /**< SCIP data structure */
1240  SCIP_Real val1, /**< first value to be compared */
1241  SCIP_Real val2 /**< second value to be compared */
1242  )
1243 {
1244  assert(scip != NULL);
1245  assert(scip->set != NULL);
1246 
1247  return SCIPsetIsSumRelLE(scip->set, val1, val2);
1248 }
1249 
1250 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
1252  SCIP* scip, /**< SCIP data structure */
1253  SCIP_Real val1, /**< first value to be compared */
1254  SCIP_Real val2 /**< second value to be compared */
1255  )
1256 {
1257  assert(scip != NULL);
1258  assert(scip->set != NULL);
1259 
1260  return SCIPsetIsSumRelGT(scip->set, val1, val2);
1261 }
1262 
1263 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
1265  SCIP* scip, /**< SCIP data structure */
1266  SCIP_Real val1, /**< first value to be compared */
1267  SCIP_Real val2 /**< second value to be compared */
1268  )
1269 {
1270  assert(scip != NULL);
1271  assert(scip->set != NULL);
1272 
1273  return SCIPsetIsSumRelGE(scip->set, val1, val2);
1274 }
1275 
1276 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
1277  * performance; in debug mode we check some additional conditions
1278  */
1280  SCIP* scip, /**< SCIP data structure */
1281  SCIP_Real real /**< double bound to convert */
1282  )
1283 {
1284  assert(SCIPisFeasIntegral(scip, real));
1285  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(int)(real < 0 ? real - 0.5 : real + 0.5)));
1286  assert(real < INT_MAX);
1287  assert(real > INT_MIN);
1288 
1289  return (int)(real < 0 ? (real - 0.5) : (real + 0.5));
1290 }
1291 
1292 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
1293  * performance; in debug mode we check some additional conditions
1294  */
1296  SCIP* scip, /**< SCIP data structure */
1297  SCIP_Real real /**< double bound to convert */
1298  )
1299 {
1300  assert(SCIPisFeasIntegral(scip, real));
1301  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(SCIP_Longint)(real < 0 ? real - 0.5 : real + 0.5)));
1302  assert(real < SCIP_LONGINT_MAX);
1303  assert(real > SCIP_LONGINT_MIN);
1304 
1305  return (SCIP_Longint)(real < 0 ? (real - 0.5) : (real + 0.5));
1306 }
1307 
1308 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
1309  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
1310  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
1311  * were canceled out when increasing the value and are random after decreasing it.
1312  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
1313  * be expressed using fixed precision floating point arithmetic, anymore.
1314  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
1315  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
1316  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
1317  * "lp/recompfac" and should be recomputed.
1318  */
1320  SCIP* scip, /**< SCIP data structure */
1321  SCIP_Real newvalue, /**< new value after update */
1322  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
1323  )
1324 {
1325  assert(scip != NULL);
1326 
1327  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisUpdateUnreliable", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1328 
1329  return SCIPsetIsUpdateUnreliable(scip->set, newvalue, oldvalue);
1330 }
SCIP_Real SCIPsetFeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6540
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsUpdateUnreliable(SCIP_SET *set, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: set.c:7060
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_RETCODE SCIPchgLpfeastol(SCIP *scip, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPdualfeastol(SCIP *scip)
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5953
SCIP_Bool SCIPsetIsSumGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6256
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define NULL
Definition: def.h:253
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6011
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6461
SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsSumZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6274
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPsetFeastol(SCIP_SET *set)
Definition: set.c:5855
SCIP_Bool SCIPsetIsDualfeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6562
SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_Bool SCIPisSumPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPdualfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6140
SCIP_Bool SCIPisDualfeasFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6351
SCIP_Real SCIPrelaxfeastol(SCIP *scip)
SCIP_LPALGO lastlpalgo
Definition: struct_lp.h:339
#define SCIP_MAXSTRLEN
Definition: def.h:274
SCIP_Bool SCIPsetIsDualfeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6650
SCIP_Bool SCIPsetIsSumGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6238
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6076
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsSumRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:7006
SCIP_Bool SCIPisDualfeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsScalingIntegral(SCIP_SET *set, SCIP_Real val, SCIP_Real scalar)
Definition: set.c:6109
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5813
SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
#define FALSE
Definition: def.h:73
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPsetSetRelaxfeastol(SCIP_SET *set, SCIP_Real relaxfeastol)
Definition: set.c:5640
SCIP_Bool SCIPsetIsFeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6494
SCIP_Bool SCIPisRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool solved
Definition: struct_lp.h:352
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6065
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPsetCutoffbounddelta(SCIP_SET *set)
Definition: set.c:5918
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsSumLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6202
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6162
SCIP_Bool SCIPsetIsDualfeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6606
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetRelaxfeastol(SCIP_SET *set)
Definition: set.c:5932
SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6087
#define SCIP_LONGINT_MAX
Definition: def.h:150
#define SCIP_LONGINT_MIN
Definition: def.h:151
SCIP_Real SCIPsetCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6151
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetGetHugeValue(SCIP_SET *set)
Definition: set.c:5825
SCIP_Bool SCIPsetIsFeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6505
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
public methods for numerical tolerances
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetSetFeastol(SCIP_SET *set, SCIP_Real feastol)
Definition: set.c:5549
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6047
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPsetDualfeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6729
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5993
SCIP_Bool SCIPsetIsSumLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6220
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsSumRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:7028
SCIP_Real SCIPdualfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetLpfeastol(SCIP_SET *set)
Definition: set.c:5875
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10364
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsSumRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6940
SCIP_Bool SCIPisSumRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6830
SCIP_Real SCIPgetHugeValue(SCIP *scip)
SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue)
SCIP_Bool SCIPsetIsDualfeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6705
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:2010
SCIP_Real SCIPsetBarrierconvtol(SCIP_SET *set)
Definition: set.c:5888
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsSumRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6962
SCIP_Real SCIPsetFeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6529
void SCIPsetSetLimitChanged(SCIP_SET *set)
Definition: set.c:5657
SCIP_Bool SCIPsetIsRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6874
void SCIPprintReal(SCIP *scip, FILE *file, SCIP_Real val, int width, int precision)
SCIP_Real SCIPsetDualfeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6740
SCIP_Bool SCIPsetIsDualfeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6716
SCIP_Bool SCIPsetIsDualfeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6628
SCIP_Real SCIPsetFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6173
SCIP_Bool SCIPsetIsRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6896
SCIP_Bool SCIPisRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:365
SCIP main data structure.
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6439
SCIP_Longint SCIPconvertRealToLongint(SCIP *scip, SCIP_Real real)
SCIP_RETCODE SCIPsetSetLpfeastol(SCIP_SET *set, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: set.c:5571
SCIP_Bool SCIPsetIsLbBetter(SCIP_SET *set, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6776
SCIP_Real SCIPdualfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
SCIP_Real SCIPdualfeasRound(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5975
SCIP_Bool SCIPsetIsHugeValue(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5964
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisDualfeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6395
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6098
SCIP_Real SCIPinfinity(SCIP *scip)
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:70
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
Definition: set.c:5845
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsetSetBarrierconvtol(SCIP_SET *set, SCIP_Real barrierconvtol)
Definition: set.c:5622
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisSumNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetDualfeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6762
methods for debugging
SCIP_Bool SCIPsetIsRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6852
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetDualfeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6751
SCIP_Bool SCIPisFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsSumNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6296
SCIP_Real SCIPchgRelaxfeastol(SCIP *scip, SCIP_Real relaxfeastol)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6373
SCIP_Bool SCIPsetIsSumEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6184
void SCIPmarkLimitChanged(SCIP *scip)
SCIP_Real SCIPsetFeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6551
SCIP_Bool SCIPsetIsDualfeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6683
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsSumPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6285
SCIP_Real SCIPsetFeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6518
SCIP_Bool SCIPisDualfeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_SET * set
Definition: struct_scip.h:62
public methods for message output
data structures for LP management
SCIP_Bool SCIPsetIsSumRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6984
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10263
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:608
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6029
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
#define SCIP_Real
Definition: def.h:164
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6472
SCIP_Real SCIPsetDualfeastol(SCIP_SET *set)
Definition: set.c:5865
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisDualfeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIP_Longint
Definition: def.h:149
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetSetDualfeastol(SCIP_SET *set, SCIP_Real dualfeastol)
Definition: set.c:5609
SCIP_Bool SCIPsetIsDualfeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6672
SCIP_Real SCIPbarrierconvtol(SCIP *scip)
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6417
SCIP_Real SCIPlpfeastol(SCIP *scip)
SCIP_Real SCIPsetEpsilon(SCIP_SET *set)
Definition: set.c:5835
SCIP_Bool SCIPsetIsUbBetter(SCIP_SET *set, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6797
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol)
SCIP_Bool SCIPsetIsDualfeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6694
SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
#define SCIP_CALL_ABORT(x)
Definition: def.h:344
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
SCIP_LP * lp
Definition: struct_scip.h:80
SCIP_Bool SCIPsetIsRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6918
SCIP_LPSOLSTAT lpsolstat
Definition: struct_lp.h:338
SCIP_Bool SCIPsetIsDualfeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6584
SCIP_Bool SCIPsetIsFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6127
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
double real
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
SCIP_Bool SCIPsetIsFeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6483
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)