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