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