Scippy

SCIP

Solving Constraint Integer Programs

scip_numerics.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_numerics.c
17  * @brief public methods for numerical tolerances
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include <stdarg.h>
37 #include <assert.h>
38 #include <string.h>
39 #if defined(_WIN32) || defined(_WIN64)
40 #else
41 #include <strings.h> /*lint --e{766}*/
42 #endif
43 
44 
45 #include "lpi/lpi.h"
46 #include "nlpi/exprinterpret.h"
47 #include "nlpi/nlpi.h"
48 #include "scip/benders.h"
49 #include "scip/benderscut.h"
50 #include "scip/branch.h"
51 #include "scip/branch_nodereopt.h"
52 #include "scip/clock.h"
53 #include "scip/compr.h"
54 #include "scip/concsolver.h"
55 #include "scip/concurrent.h"
56 #include "scip/conflict.h"
57 #include "scip/conflictstore.h"
58 #include "scip/cons.h"
59 #include "scip/cons_linear.h"
60 #include "scip/cutpool.h"
61 #include "scip/cuts.h"
62 #include "scip/debug.h"
63 #include "scip/def.h"
64 #include "scip/dialog.h"
65 #include "scip/dialog_default.h"
66 #include "scip/disp.h"
67 #include "scip/event.h"
68 #include "scip/heur.h"
69 #include "scip/heur_ofins.h"
70 #include "scip/heur_reoptsols.h"
72 #include "scip/heuristics.h"
73 #include "scip/history.h"
74 #include "scip/implics.h"
75 #include "scip/interrupt.h"
76 #include "scip/lp.h"
77 #include "scip/mem.h"
78 #include "scip/message_default.h"
79 #include "scip/misc.h"
80 #include "scip/nlp.h"
81 #include "scip/nodesel.h"
82 #include "scip/paramset.h"
83 #include "scip/presol.h"
84 #include "scip/presolve.h"
85 #include "scip/pricer.h"
86 #include "scip/pricestore.h"
87 #include "scip/primal.h"
88 #include "scip/prob.h"
89 #include "scip/prop.h"
90 #include "scip/reader.h"
91 #include "scip/relax.h"
92 #include "scip/reopt.h"
93 #include "scip/retcode.h"
94 #include "scip/scipbuildflags.h"
95 #include "scip/scipcoreplugins.h"
96 #include "scip/scipgithash.h"
97 #include "scip/sepa.h"
98 #include "scip/sepastore.h"
99 #include "scip/set.h"
100 #include "scip/sol.h"
101 #include "scip/solve.h"
102 #include "scip/stat.h"
103 #include "scip/syncstore.h"
104 #include "scip/table.h"
105 #include "scip/tree.h"
106 #include "scip/var.h"
107 #include "scip/visual.h"
108 #include "xml/xml.h"
109 
110 #include "scip/scip_numerics.h"
111 
112 #include "scip/pub_message.h"
113 #include "scip/pub_misc.h"
114 
115 
116 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
117  * this structure except the interface methods in scip.c.
118  * In optimized mode, the structure is included in scip.h, because some of the methods
119  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
120  */
121 #ifndef NDEBUG
122 #include "scip/struct_scip.h"
123 #endif
124 
125 
126 /* In debug mode, the following methods are implemented as function calls to ensure
127  * type validity.
128  * In optimized mode, the methods are implemented as defines to improve performance.
129  * However, we want to have them in the library anyways, so we have to undef the defines.
130  */
131 
132 #undef SCIPinfinity
133 #undef SCIPisInfinity
134 #undef SCIPisEQ
135 #undef SCIPisLT
136 #undef SCIPisLE
137 #undef SCIPisGT
138 #undef SCIPisGE
139 #undef SCIPisZero
140 #undef SCIPisPositive
141 #undef SCIPisNegative
142 #undef SCIPisIntegral
143 #undef SCIPisScalingIntegral
144 #undef SCIPisFracIntegral
145 #undef SCIPfloor
146 #undef SCIPceil
147 #undef SCIPround
148 #undef SCIPfrac
149 #undef SCIPisSumEQ
150 #undef SCIPisSumLT
151 #undef SCIPisSumLE
152 #undef SCIPisSumGT
153 #undef SCIPisSumGE
154 #undef SCIPisSumZero
155 #undef SCIPisSumPositive
156 #undef SCIPisSumNegative
157 #undef SCIPisFeasEQ
158 #undef SCIPisFeasLT
159 #undef SCIPisFeasLE
160 #undef SCIPisFeasGT
161 #undef SCIPisFeasGE
162 #undef SCIPisFeasZero
163 #undef SCIPisFeasPositive
164 #undef SCIPisFeasNegative
165 #undef SCIPisFeasIntegral
166 #undef SCIPisFeasFracIntegral
167 #undef SCIPfeasFloor
168 #undef SCIPfeasCeil
169 #undef SCIPfeasRound
170 #undef SCIPfeasFrac
171 #undef SCIPisDualfeasEQ
172 #undef SCIPisDualfeasLT
173 #undef SCIPisDualfeasLE
174 #undef SCIPisDualfeasGT
175 #undef SCIPisDualfeasGE
176 #undef SCIPisDualfeasZero
177 #undef SCIPisDualfeasPositive
178 #undef SCIPisDualfeasNegative
179 #undef SCIPisDualfeasIntegral
180 #undef SCIPisDualfeasFracIntegral
181 #undef SCIPdualfeasFloor
182 #undef SCIPdualfeasCeil
183 #undef SCIPdualfeasRound
184 #undef SCIPdualfeasFrac
185 #undef SCIPisLbBetter
186 #undef SCIPisUbBetter
187 #undef SCIPisRelEQ
188 #undef SCIPisRelLT
189 #undef SCIPisRelLE
190 #undef SCIPisRelGT
191 #undef SCIPisRelGE
192 #undef SCIPisSumRelEQ
193 #undef SCIPisSumRelLT
194 #undef SCIPisSumRelLE
195 #undef SCIPisSumRelGT
196 #undef SCIPisSumRelGE
197 #undef SCIPconvertRealToInt
198 #undef SCIPconvertRealToLongint
199 #undef SCIPisUpdateUnreliable
200 #undef SCIPisHugeValue
201 #undef SCIPgetHugeValue
202 
203 /** returns value treated as zero
204  *
205  * @return value treated as zero
206  */
208  SCIP* scip /**< SCIP data structure */
209  )
210 {
211  assert(scip != NULL);
212  assert(scip->set != NULL);
213 
214  return SCIPsetEpsilon(scip->set);
215 }
216 
217 /** returns value treated as zero for sums of floating point values
218  *
219  * @return value treated as zero for sums of floating point values
220  */
222  SCIP* scip /**< SCIP data structure */
223  )
224 {
225  assert(scip != NULL);
226  assert(scip->set != NULL);
227 
228  return SCIPsetSumepsilon(scip->set);
229 }
230 
231 /** returns feasibility tolerance for constraints
232  *
233  * @return feasibility tolerance for constraints
234  */
236  SCIP* scip /**< SCIP data structure */
237  )
238 {
239  assert(scip != NULL);
240  assert(scip->set != NULL);
241 
242  return SCIPsetFeastol(scip->set);
243 }
244 
245 /** returns primal feasibility tolerance of LP solver
246  *
247  * @return primal feasibility tolerance of LP solver
248  */
250  SCIP* scip /**< SCIP data structure */
251  )
252 {
253  assert(scip != NULL);
254  assert(scip->set != NULL);
255 
256  return SCIPsetLpfeastol(scip->set);
257 }
258 
259 /** returns feasibility tolerance for reduced costs
260  *
261  * @return feasibility tolerance for reduced costs
262  */
264  SCIP* scip /**< SCIP data structure */
265  )
266 {
267  assert(scip != NULL);
268  assert(scip->set != NULL);
269 
270  return SCIPsetDualfeastol(scip->set);
271 }
272 
273 /** returns convergence tolerance used in barrier algorithm
274  *
275  * @return convergence tolerance used in barrier algorithm
276  */
278  SCIP* scip /**< SCIP data structure */
279  )
280 {
281  assert(scip != NULL);
282  assert(scip->set != NULL);
283 
284  return SCIPsetBarrierconvtol(scip->set);
285 }
286 
287 /** return the cutoff bound delta
288  *
289  * @return cutoff bound data
290  */
292  SCIP* scip /**< SCIP data structure */
293  )
294 {
295  assert(scip != NULL);
296  assert(scip->set != NULL);
297 
298  return SCIPsetCutoffbounddelta(scip->set);
299 }
300 
301 /** return the relaxation primal feasibility tolerance
302  *
303  * @see SCIPchgRelaxfeastol
304  * @return relaxfeastol
305  */
307  SCIP* scip /**< SCIP data structure */
308  )
309 {
310  assert(scip != NULL);
311  assert(scip->set != NULL);
312 
313  return SCIPsetRelaxfeastol(scip->set);
314 }
315 
316 /** sets the feasibility tolerance for constraints
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 feastol /**< new feasibility tolerance for constraints */
324  )
325 {
326  assert(scip != NULL);
327 
328  /* change the settings */
329  SCIP_CALL( SCIPsetSetFeastol(scip->set, feastol) );
330 
331  return SCIP_OKAY;
332 }
333 
334 /** sets the primal feasibility tolerance of LP solver
335  *
336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
338  */
340  SCIP* scip, /**< SCIP data structure */
341  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
342  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
343  )
344 {
345  assert(scip != NULL);
346 
347  /* mark the LP unsolved, if the primal feasibility tolerance was tightened */
348  if( scip->lp != NULL && lpfeastol < SCIPsetLpfeastol(scip->set) )
349  {
350  scip->lp->solved = FALSE;
352  }
353 
354  /* change the settings */
355  SCIP_CALL( SCIPsetSetLpfeastol(scip->set, lpfeastol, printnewvalue) );
356 
357  return SCIP_OKAY;
358 }
359 
360 /** sets the feasibility tolerance for reduced costs
361  *
362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
364  */
366  SCIP* scip, /**< SCIP data structure */
367  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
368  )
369 {
370  assert(scip != NULL);
371 
372  /* mark the LP unsolved, if the dual feasibility tolerance was tightened */
373  if( scip->lp != NULL && dualfeastol < SCIPsetDualfeastol(scip->set) )
374  {
375  scip->lp->solved = FALSE;
377  }
378 
379  /* change the settings */
380  SCIP_CALL( SCIPsetSetDualfeastol(scip->set, dualfeastol) );
381 
382  return SCIP_OKAY;
383 }
384 
385 /** sets the convergence tolerance used in barrier algorithm
386  *
387  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
388  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
389  */
391  SCIP* scip, /**< SCIP data structure */
392  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
393  )
394 {
395  assert(scip != NULL);
396 
397  /* mark the LP unsolved, if the convergence tolerance was tightened, and the LP was solved with the barrier algorithm */
398  if( scip->lp != NULL && barrierconvtol < SCIPsetBarrierconvtol(scip->set)
400  scip->lp->solved = FALSE;
401 
402  /* change the settings */
403  SCIP_CALL( SCIPsetSetBarrierconvtol(scip->set, barrierconvtol) );
404 
405  return SCIP_OKAY;
406 }
407 
408 /** sets the primal feasibility tolerance of relaxations
409  *
410  * This tolerance value is used by the SCIP core and plugins to tighten then feasibility tolerance on relaxations
411  * (especially the LP relaxation) during a solve. It is set to SCIP_INVALID initially, which means that only the
412  * feasibility tolerance of the particular relaxation is taken into account. If set to a valid value, however,
413  * then this value should be used to reduce the primal feasibility tolerance of a relaxation (thus, use the
414  * minimum of relaxfeastol and the relaxations primal feastol).
415  *
416  * @pre The value of relaxfeastol is reset to SCIP_INVALID when initializing the solve (INITSOL).
417  * Therefore, this method can only be called in one of the following stages of the SCIP solving process:
418  * - \ref SCIP_STAGE_INITSOLVE
419  * - \ref SCIP_STAGE_SOLVING
420  *
421  * @return previous value of relaxfeastol
422  */
424  SCIP* scip, /**< SCIP data structure */
425  SCIP_Real relaxfeastol /**< new primal feasibility tolerance of relaxations */
426  )
427 {
428  assert(scip != NULL);
429  assert(scip->set != NULL);
430 
431  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPchgRelaxfeastol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
432 
433  return SCIPsetSetRelaxfeastol(scip->set, relaxfeastol);
434 }
435 
436 /** marks that some limit parameter was changed */
438  SCIP* scip /**< SCIP data structure */
439  )
440 {
441  assert(scip != NULL);
442 
443  /* change the settings */
445 }
446 
447 /** outputs a real number, or "+infinity", or "-infinity" to a file */
449  SCIP* scip, /**< SCIP data structure */
450  FILE* file, /**< output file (or NULL for standard output) */
451  SCIP_Real val, /**< value to print */
452  int width, /**< width of the field */
453  int precision /**< number of significant digits printed */
454  )
455 {
456  char s[SCIP_MAXSTRLEN];
457  char strformat[SCIP_MAXSTRLEN];
458 
459  assert(scip != NULL);
460 
461  if( SCIPsetIsInfinity(scip->set, val) )
462  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "+infinity");
463  else if( SCIPsetIsInfinity(scip->set, -val) )
464  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "-infinity");
465  else
466  {
467  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%.%dg", precision);
468  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, (const char*)strformat, val);
469  }
470  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%%ds", width);
471  SCIPmessageFPrintInfo(scip->messagehdlr, file, (const char*)strformat, s);
472 }
473 
474 /** parse a real value that was written with SCIPprintReal() */
476  SCIP* scip, /**< SCIP data structure */
477  const char* str, /**< string to search */
478  SCIP_Real* value, /**< pointer to store the parsed value */
479  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
480  )
481 {
482  char* localstr;
483 
484  assert(scip != NULL);
485  assert(str != NULL);
486  assert(value != NULL);
487  assert(endptr != NULL);
488 
489  localstr = (char*)str;
490 
491  /* ignore white space */
492  while(isspace((unsigned char)*localstr))
493  ++localstr;
494 
495  /* test for a special infinity first */
496  if( strncmp(localstr, "+infinity", 9) == 0 )
497  {
498  *value = SCIPinfinity(scip);
499  *endptr = (char*)(localstr + 9);
500  return TRUE;
501  }
502  else if( strncmp(localstr, "-infinity", 9) == 0 )
503  {
504  *value = -SCIPinfinity(scip);
505  *endptr = (char*)(localstr + 9);
506  return TRUE;
507  }
508  else
509  {
510  /* parse a finite value */
511  return SCIPstrToRealValue(str, value, endptr);
512  }
513 }
514 
515 /** checks, if values are in range of epsilon */
517  SCIP* scip, /**< SCIP data structure */
518  SCIP_Real val1, /**< first value to be compared */
519  SCIP_Real val2 /**< second value to be compared */
520  )
521 {
522  assert(scip != NULL);
523  assert(scip->set != NULL);
524 
525  return SCIPsetIsEQ(scip->set, val1, val2);
526 }
527 
528 /** checks, if val1 is (more than epsilon) lower than val2 */
530  SCIP* scip, /**< SCIP data structure */
531  SCIP_Real val1, /**< first value to be compared */
532  SCIP_Real val2 /**< second value to be compared */
533  )
534 {
535  assert(scip != NULL);
536  assert(scip->set != NULL);
537 
538  return SCIPsetIsLT(scip->set, val1, val2);
539 }
540 
541 /** checks, if val1 is not (more than epsilon) greater than val2 */
543  SCIP* scip, /**< SCIP data structure */
544  SCIP_Real val1, /**< first value to be compared */
545  SCIP_Real val2 /**< second value to be compared */
546  )
547 {
548  assert(scip != NULL);
549  assert(scip->set != NULL);
550 
551  return SCIPsetIsLE(scip->set, val1, val2);
552 }
553 
554 /** checks, if val1 is (more than epsilon) greater than val2 */
556  SCIP* scip, /**< SCIP data structure */
557  SCIP_Real val1, /**< first value to be compared */
558  SCIP_Real val2 /**< second value to be compared */
559  )
560 {
561  assert(scip != NULL);
562  assert(scip->set != NULL);
563 
564  return SCIPsetIsGT(scip->set, val1, val2);
565 }
566 
567 /** checks, if val1 is not (more than epsilon) lower than val2 */
569  SCIP* scip, /**< SCIP data structure */
570  SCIP_Real val1, /**< first value to be compared */
571  SCIP_Real val2 /**< second value to be compared */
572  )
573 {
574  assert(scip != NULL);
575  assert(scip->set != NULL);
576 
577  return SCIPsetIsGE(scip->set, val1, val2);
578 }
579 
580 /** returns value treated as infinity */
582  SCIP* scip /**< SCIP data structure */
583  )
584 {
585  assert(scip != NULL);
586  assert(scip->set != NULL);
587 
588  return SCIPsetInfinity(scip->set);
589 }
590 
591 /** checks, if value is (positive) infinite */
593  SCIP* scip, /**< SCIP data structure */
594  SCIP_Real val /**< value to be compared against infinity */
595  )
596 {
597  assert(scip != NULL);
598  assert(scip->set != NULL);
599 
600  return SCIPsetIsInfinity(scip->set, val);
601 }
602 
603 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
605  SCIP* scip, /**< SCIP data structure */
606  SCIP_Real val /**< value to be checked whether it is huge */
607  )
608 {
609  assert(scip != NULL);
610  assert(scip->set != NULL);
611 
612  return SCIPsetIsHugeValue(scip->set, val);
613 }
614 
615 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
616  * computation)
617  */
619  SCIP* scip /**< SCIP data structure */
620  )
621 {
622  assert(scip != NULL);
623  assert(scip->set != NULL);
624 
625  return SCIPsetGetHugeValue(scip->set);
626 }
627 
628 /** checks, if value is in range epsilon of 0.0 */
630  SCIP* scip, /**< SCIP data structure */
631  SCIP_Real val /**< value to process */
632  )
633 {
634  assert(scip != NULL);
635  assert(scip->set != NULL);
636 
637  return SCIPsetIsZero(scip->set, val);
638 }
639 
640 /** checks, if value is greater than epsilon */
642  SCIP* scip, /**< SCIP data structure */
643  SCIP_Real val /**< value to process */
644  )
645 {
646  assert(scip != NULL);
647  assert(scip->set != NULL);
648 
649  return SCIPsetIsPositive(scip->set, val);
650 }
651 
652 /** checks, if value is lower than -epsilon */
654  SCIP* scip, /**< SCIP data structure */
655  SCIP_Real val /**< value to process */
656  )
657 {
658  assert(scip != NULL);
659  assert(scip->set != NULL);
660 
661  return SCIPsetIsNegative(scip->set, val);
662 }
663 
664 /** checks, if value is integral within epsilon */
666  SCIP* scip, /**< SCIP data structure */
667  SCIP_Real val /**< value to process */
668  )
669 {
670  assert(scip != NULL);
671  assert(scip->set != NULL);
672 
673  return SCIPsetIsIntegral(scip->set, val);
674 }
675 
676 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
678  SCIP* scip, /**< SCIP data structure */
679  SCIP_Real val, /**< unscaled value to check for scaled integrality */
680  SCIP_Real scalar /**< value to scale val with for checking for integrality */
681  )
682 {
683  assert(scip != NULL);
684  assert(scip->set != NULL);
685 
686  return SCIPsetIsScalingIntegral(scip->set, val, scalar);
687 }
688 
689 /** checks, if given fractional part is smaller than epsilon */
691  SCIP* scip, /**< SCIP data structure */
692  SCIP_Real val /**< value to process */
693  )
694 {
695  assert(scip != NULL);
696  assert(scip->set != NULL);
697 
698  return SCIPsetIsFracIntegral(scip->set, val);
699 }
700 
701 /** rounds value + epsilon down to the next integer */
703  SCIP* scip, /**< SCIP data structure */
704  SCIP_Real val /**< value to process */
705  )
706 {
707  assert(scip != NULL);
708  assert(scip->set != NULL);
709 
710  return SCIPsetFloor(scip->set, val);
711 }
712 
713 /** rounds value - epsilon up to the next integer */
715  SCIP* scip, /**< SCIP data structure */
716  SCIP_Real val /**< value to process */
717  )
718 {
719  assert(scip != NULL);
720  assert(scip->set != NULL);
721 
722  return SCIPsetCeil(scip->set, val);
723 }
724 
725 /** rounds value to the nearest integer with epsilon tolerance */
727  SCIP* scip, /**< SCIP data structure */
728  SCIP_Real val /**< value to process */
729  )
730 {
731  assert(scip != NULL);
732  assert(scip->set != NULL);
733 
734  return SCIPsetRound(scip->set, val);
735 }
736 
737 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
739  SCIP* scip, /**< SCIP data structure */
740  SCIP_Real val /**< value to return fractional part for */
741  )
742 {
743  assert(scip != NULL);
744  assert(scip->set != NULL);
745 
746  return SCIPsetFrac(scip->set, val);
747 }
748 
749 /** checks, if values are in range of sumepsilon */
751  SCIP* scip, /**< SCIP data structure */
752  SCIP_Real val1, /**< first value to be compared */
753  SCIP_Real val2 /**< second value to be compared */
754  )
755 {
756  assert(scip != NULL);
757  assert(scip->set != NULL);
758 
759  return SCIPsetIsSumEQ(scip->set, val1, val2);
760 }
761 
762 /** checks, if val1 is (more than sumepsilon) lower than val2 */
764  SCIP* scip, /**< SCIP data structure */
765  SCIP_Real val1, /**< first value to be compared */
766  SCIP_Real val2 /**< second value to be compared */
767  )
768 {
769  assert(scip != NULL);
770  assert(scip->set != NULL);
771 
772  return SCIPsetIsSumLT(scip->set, val1, val2);
773 }
774 
775 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
777  SCIP* scip, /**< SCIP data structure */
778  SCIP_Real val1, /**< first value to be compared */
779  SCIP_Real val2 /**< second value to be compared */
780  )
781 {
782  assert(scip != NULL);
783  assert(scip->set != NULL);
784 
785  return SCIPsetIsSumLE(scip->set, val1, val2);
786 }
787 
788 /** checks, if val1 is (more than sumepsilon) greater than val2 */
790  SCIP* scip, /**< SCIP data structure */
791  SCIP_Real val1, /**< first value to be compared */
792  SCIP_Real val2 /**< second value to be compared */
793  )
794 {
795  assert(scip != NULL);
796  assert(scip->set != NULL);
797 
798  return SCIPsetIsSumGT(scip->set, val1, val2);
799 }
800 
801 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
803  SCIP* scip, /**< SCIP data structure */
804  SCIP_Real val1, /**< first value to be compared */
805  SCIP_Real val2 /**< second value to be compared */
806  )
807 {
808  assert(scip != NULL);
809  assert(scip->set != NULL);
810 
811  return SCIPsetIsSumGE(scip->set, val1, val2);
812 }
813 
814 /** checks, if value is in range sumepsilon of 0.0 */
816  SCIP* scip, /**< SCIP data structure */
817  SCIP_Real val /**< value to process */
818  )
819 {
820  assert(scip != NULL);
821  assert(scip->set != NULL);
822 
823  return SCIPsetIsSumZero(scip->set, val);
824 }
825 
826 /** checks, if value is greater than sumepsilon */
828  SCIP* scip, /**< SCIP data structure */
829  SCIP_Real val /**< value to process */
830  )
831 {
832  assert(scip != NULL);
833  assert(scip->set != NULL);
834 
835  return SCIPsetIsSumPositive(scip->set, val);
836 }
837 
838 /** checks, if value is lower than -sumepsilon */
840  SCIP* scip, /**< SCIP data structure */
841  SCIP_Real val /**< value to process */
842  )
843 {
844  assert(scip != NULL);
845  assert(scip->set != NULL);
846 
847  return SCIPsetIsSumNegative(scip->set, val);
848 }
849 
850 /** checks, if relative difference of values is in range of feasibility tolerance */
852  SCIP* scip, /**< SCIP data structure */
853  SCIP_Real val1, /**< first value to be compared */
854  SCIP_Real val2 /**< second value to be compared */
855  )
856 {
857  assert(scip != NULL);
858  assert(scip->set != NULL);
859 
860  return SCIPsetIsFeasEQ(scip->set, val1, val2);
861 }
862 
863 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
865  SCIP* scip, /**< SCIP data structure */
866  SCIP_Real val1, /**< first value to be compared */
867  SCIP_Real val2 /**< second value to be compared */
868  )
869 {
870  assert(scip != NULL);
871  assert(scip->set != NULL);
872 
873  return SCIPsetIsFeasLT(scip->set, val1, val2);
874 }
875 
876 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
878  SCIP* scip, /**< SCIP data structure */
879  SCIP_Real val1, /**< first value to be compared */
880  SCIP_Real val2 /**< second value to be compared */
881  )
882 {
883  assert(scip != NULL);
884  assert(scip->set != NULL);
885 
886  return SCIPsetIsFeasLE(scip->set, val1, val2);
887 }
888 
889 /** checks, if relative difference of val1 and val2 is greater than feastol */
891  SCIP* scip, /**< SCIP data structure */
892  SCIP_Real val1, /**< first value to be compared */
893  SCIP_Real val2 /**< second value to be compared */
894  )
895 {
896  assert(scip != NULL);
897  assert(scip->set != NULL);
898 
899  return SCIPsetIsFeasGT(scip->set, val1, val2);
900 }
901 
902 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
904  SCIP* scip, /**< SCIP data structure */
905  SCIP_Real val1, /**< first value to be compared */
906  SCIP_Real val2 /**< second value to be compared */
907  )
908 {
909  assert(scip != NULL);
910  assert(scip->set != NULL);
911 
912  return SCIPsetIsFeasGE(scip->set, val1, val2);
913 }
914 
915 /** checks, if value is in range feasibility tolerance of 0.0 */
917  SCIP* scip, /**< SCIP data structure */
918  SCIP_Real val /**< value to process */
919  )
920 {
921  assert(scip != NULL);
922  assert(scip->set != NULL);
923 
924  return SCIPsetIsFeasZero(scip->set, val);
925 }
926 
927 /** checks, if value is greater than feasibility tolerance */
929  SCIP* scip, /**< SCIP data structure */
930  SCIP_Real val /**< value to process */
931  )
932 {
933  assert(scip != NULL);
934  assert(scip->set != NULL);
935 
936  return SCIPsetIsFeasPositive(scip->set, val);
937 }
938 
939 /** checks, if value is lower than -feasibility tolerance */
941  SCIP* scip, /**< SCIP data structure */
942  SCIP_Real val /**< value to process */
943  )
944 {
945  assert(scip != NULL);
946  assert(scip->set != NULL);
947 
948  return SCIPsetIsFeasNegative(scip->set, val);
949 }
950 
951 /** checks, if value is integral within the LP feasibility bounds */
953  SCIP* scip, /**< SCIP data structure */
954  SCIP_Real val /**< value to process */
955  )
956 {
957  assert(scip != NULL);
958  assert(scip->set != NULL);
959 
960  return SCIPsetIsFeasIntegral(scip->set, val);
961 }
962 
963 /** checks, if given fractional part is smaller than feastol */
965  SCIP* scip, /**< SCIP data structure */
966  SCIP_Real val /**< value to process */
967  )
968 {
969  assert(scip != NULL);
970  assert(scip->set != NULL);
971 
972  return SCIPsetIsFeasFracIntegral(scip->set, val);
973 }
974 
975 /** rounds value + feasibility tolerance down to the next integer */
977  SCIP* scip, /**< SCIP data structure */
978  SCIP_Real val /**< value to process */
979  )
980 {
981  assert(scip != NULL);
982  assert(scip->set != NULL);
983 
984  return SCIPsetFeasFloor(scip->set, val);
985 }
986 
987 /** rounds value - feasibility tolerance up to the next integer */
989  SCIP* scip, /**< SCIP data structure */
990  SCIP_Real val /**< value to process */
991  )
992 {
993  assert(scip != NULL);
994  assert(scip->set != NULL);
995 
996  return SCIPsetFeasCeil(scip->set, val);
997 }
998 
999 /** rounds value to the nearest integer in feasibility tolerance */
1001  SCIP* scip, /**< SCIP data structure */
1002  SCIP_Real val /**< value to process */
1003  )
1004 {
1005  assert(scip != NULL);
1006  assert(scip->set != NULL);
1007 
1008  return SCIPsetFeasRound(scip->set, val);
1009 }
1010 
1011 /** returns fractional part of value, i.e. x - floor(x) in feasibility tolerance */
1013  SCIP* scip, /**< SCIP data structure */
1014  SCIP_Real val /**< value to process */
1015  )
1016 {
1017  assert(scip != NULL);
1018  assert(scip->set != NULL);
1019 
1020  return SCIPsetFeasFrac(scip->set, val);
1021 }
1022 
1023 /** checks, if relative difference of values is in range of dual feasibility tolerance */
1025  SCIP* scip, /**< SCIP data structure */
1026  SCIP_Real val1, /**< first value to be compared */
1027  SCIP_Real val2 /**< second value to be compared */
1028  )
1029 {
1030  assert(scip != NULL);
1031  assert(scip->set != NULL);
1032 
1033  return SCIPsetIsDualfeasEQ(scip->set, val1, val2);
1034 }
1035 
1036 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
1038  SCIP* scip, /**< SCIP data structure */
1039  SCIP_Real val1, /**< first value to be compared */
1040  SCIP_Real val2 /**< second value to be compared */
1041  )
1042 {
1043  assert(scip != NULL);
1044  assert(scip->set != NULL);
1045 
1046  return SCIPsetIsDualfeasLT(scip->set, val1, val2);
1047 }
1048 
1049 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
1051  SCIP* scip, /**< SCIP data structure */
1052  SCIP_Real val1, /**< first value to be compared */
1053  SCIP_Real val2 /**< second value to be compared */
1054  )
1055 {
1056  assert(scip != NULL);
1057  assert(scip->set != NULL);
1058 
1059  return SCIPsetIsDualfeasLE(scip->set, val1, val2);
1060 }
1061 
1062 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
1064  SCIP* scip, /**< SCIP data structure */
1065  SCIP_Real val1, /**< first value to be compared */
1066  SCIP_Real val2 /**< second value to be compared */
1067  )
1068 {
1069  assert(scip != NULL);
1070  assert(scip->set != NULL);
1071 
1072  return SCIPsetIsDualfeasGT(scip->set, val1, val2);
1073 }
1074 
1075 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
1077  SCIP* scip, /**< SCIP data structure */
1078  SCIP_Real val1, /**< first value to be compared */
1079  SCIP_Real val2 /**< second value to be compared */
1080  )
1081 {
1082  assert(scip != NULL);
1083  assert(scip->set != NULL);
1084 
1085  return SCIPsetIsDualfeasGE(scip->set, val1, val2);
1086 }
1087 
1088 /** checks, if value is in range dual feasibility tolerance of 0.0 */
1090  SCIP* scip, /**< SCIP data structure */
1091  SCIP_Real val /**< value to process */
1092  )
1093 {
1094  assert(scip != NULL);
1095  assert(scip->set != NULL);
1096 
1097  return SCIPsetIsDualfeasZero(scip->set, val);
1098 }
1099 
1100 /** checks, if value is greater than dual feasibility tolerance */
1102  SCIP* scip, /**< SCIP data structure */
1103  SCIP_Real val /**< value to process */
1104  )
1105 {
1106  assert(scip != NULL);
1107  assert(scip->set != NULL);
1108 
1109  return SCIPsetIsDualfeasPositive(scip->set, val);
1110 }
1111 
1112 /** checks, if value is lower than -dual feasibility tolerance */
1114  SCIP* scip, /**< SCIP data structure */
1115  SCIP_Real val /**< value to process */
1116  )
1117 {
1118  assert(scip != NULL);
1119  assert(scip->set != NULL);
1120 
1121  return SCIPsetIsDualfeasNegative(scip->set, val);
1122 }
1123 
1124 /** checks, if value is integral within the LP dual feasibility tolerance */
1126  SCIP* scip, /**< SCIP data structure */
1127  SCIP_Real val /**< value to process */
1128  )
1129 {
1130  assert(scip != NULL);
1131  assert(scip->set != NULL);
1132 
1133  return SCIPsetIsDualfeasIntegral(scip->set, val);
1134 }
1135 
1136 /** checks, if given fractional part is smaller than dual feasibility tolerance */
1138  SCIP* scip, /**< SCIP data structure */
1139  SCIP_Real val /**< value to process */
1140  )
1141 {
1142  assert(scip != NULL);
1143  assert(scip->set != NULL);
1144 
1145  return SCIPsetIsDualfeasFracIntegral(scip->set, val);
1146 }
1147 
1148 /** rounds value + dual feasibility tolerance down to the next integer */
1150  SCIP* scip, /**< SCIP data structure */
1151  SCIP_Real val /**< value to process */
1152  )
1153 {
1154  assert(scip != NULL);
1155  assert(scip->set != NULL);
1156 
1157  return SCIPsetDualfeasFloor(scip->set, val);
1158 }
1159 
1160 /** rounds value - dual feasibility tolerance up to the next integer */
1162  SCIP* scip, /**< SCIP data structure */
1163  SCIP_Real val /**< value to process */
1164  )
1165 {
1166  assert(scip != NULL);
1167  assert(scip->set != NULL);
1168 
1169  return SCIPsetDualfeasCeil(scip->set, val);
1170 }
1171 
1172 /** rounds value to the nearest integer in dual feasibility tolerance */
1174  SCIP* scip, /**< SCIP data structure */
1175  SCIP_Real val /**< value to process */
1176  )
1177 {
1178  assert(scip != NULL);
1179  assert(scip->set != NULL);
1180 
1181  return SCIPsetDualfeasRound(scip->set, val);
1182 }
1183 
1184 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
1186  SCIP* scip, /**< SCIP data structure */
1187  SCIP_Real val /**< value to process */
1188  )
1189 {
1190  assert(scip != NULL);
1191  assert(scip->set != NULL);
1192 
1193  return SCIPsetDualfeasFrac(scip->set, val);
1194 }
1195 
1196 /** checks, if the given new lower bound is at least min(oldub - oldlb, |oldlb|) times the bound
1197  * strengthening epsilon better than the old one
1198  */
1200  SCIP* scip, /**< SCIP data structure */
1201  SCIP_Real newlb, /**< new lower bound */
1202  SCIP_Real oldlb, /**< old lower bound */
1203  SCIP_Real oldub /**< old upper bound */
1204  )
1205 {
1206  assert(scip != NULL);
1207 
1208  return SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub);
1209 }
1210 
1211 /** checks, if the given new upper bound is at least min(oldub - oldlb, |oldub|) times the bound
1212  * strengthening epsilon better than the old one
1213  */
1215  SCIP* scip, /**< SCIP data structure */
1216  SCIP_Real newub, /**< new upper bound */
1217  SCIP_Real oldlb, /**< old lower bound */
1218  SCIP_Real oldub /**< old upper bound */
1219  )
1220 {
1221  assert(scip != NULL);
1222 
1223  return SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub);
1224 }
1225 
1226 /** checks, if relative difference of values is in range of epsilon */
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 SCIPsetIsRelEQ(scip->set, val1, val2);
1237 }
1238 
1239 /** checks, if relative difference of val1 and val2 is lower than epsilon */
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 SCIPsetIsRelLT(scip->set, val1, val2);
1250 }
1251 
1252 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
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 SCIPsetIsRelLE(scip->set, val1, val2);
1263 }
1264 
1265 /** checks, if relative difference of val1 and val2 is greater than epsilon */
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 SCIPsetIsRelGT(scip->set, val1, val2);
1276 }
1277 
1278 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
1280  SCIP* scip, /**< SCIP data structure */
1281  SCIP_Real val1, /**< first value to be compared */
1282  SCIP_Real val2 /**< second value to be compared */
1283  )
1284 {
1285  assert(scip != NULL);
1286  assert(scip->set != NULL);
1287 
1288  return SCIPsetIsRelGE(scip->set, val1, val2);
1289 }
1290 
1291 /** checks, if relative difference of values is in range of sumepsilon */
1293  SCIP* scip, /**< SCIP data structure */
1294  SCIP_Real val1, /**< first value to be compared */
1295  SCIP_Real val2 /**< second value to be compared */
1296  )
1297 {
1298  assert(scip != NULL);
1299  assert(scip->set != NULL);
1300 
1301  return SCIPsetIsSumRelEQ(scip->set, val1, val2);
1302 }
1303 
1304 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
1306  SCIP* scip, /**< SCIP data structure */
1307  SCIP_Real val1, /**< first value to be compared */
1308  SCIP_Real val2 /**< second value to be compared */
1309  )
1310 {
1311  assert(scip != NULL);
1312  assert(scip->set != NULL);
1313 
1314  return SCIPsetIsSumRelLT(scip->set, val1, val2);
1315 }
1316 
1317 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
1319  SCIP* scip, /**< SCIP data structure */
1320  SCIP_Real val1, /**< first value to be compared */
1321  SCIP_Real val2 /**< second value to be compared */
1322  )
1323 {
1324  assert(scip != NULL);
1325  assert(scip->set != NULL);
1326 
1327  return SCIPsetIsSumRelLE(scip->set, val1, val2);
1328 }
1329 
1330 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
1332  SCIP* scip, /**< SCIP data structure */
1333  SCIP_Real val1, /**< first value to be compared */
1334  SCIP_Real val2 /**< second value to be compared */
1335  )
1336 {
1337  assert(scip != NULL);
1338  assert(scip->set != NULL);
1339 
1340  return SCIPsetIsSumRelGT(scip->set, val1, val2);
1341 }
1342 
1343 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
1345  SCIP* scip, /**< SCIP data structure */
1346  SCIP_Real val1, /**< first value to be compared */
1347  SCIP_Real val2 /**< second value to be compared */
1348  )
1349 {
1350  assert(scip != NULL);
1351  assert(scip->set != NULL);
1352 
1353  return SCIPsetIsSumRelGE(scip->set, val1, val2);
1354 }
1355 
1356 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
1357  * performance; in debug mode we check some additional conditions
1358  */
1360  SCIP* scip, /**< SCIP data structure */
1361  SCIP_Real real /**< double bound to convert */
1362  )
1363 {
1364  assert(SCIPisFeasIntegral(scip, real));
1365  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(int)(real < 0 ? real - 0.5 : real + 0.5)));
1366  assert(real < INT_MAX);
1367  assert(real > INT_MIN);
1368 
1369  return (int)(real < 0 ? (real - 0.5) : (real + 0.5));
1370 }
1371 
1372 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
1373  * performance; in debug mode we check some additional conditions
1374  */
1376  SCIP* scip, /**< SCIP data structure */
1377  SCIP_Real real /**< double bound to convert */
1378  )
1379 {
1380  assert(SCIPisFeasIntegral(scip, real));
1381  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(SCIP_Longint)(real < 0 ? real - 0.5 : real + 0.5)));
1382  assert(real < SCIP_LONGINT_MAX);
1383  assert(real > SCIP_LONGINT_MIN);
1384 
1385  return (SCIP_Longint)(real < 0 ? (real - 0.5) : (real + 0.5));
1386 }
1387 
1388 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
1389  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
1390  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
1391  * were canceled out when increasing the value and are random after decreasing it.
1392  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
1393  * be expressed using fixed precision floating point arithmetic, anymore.
1394  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
1395  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
1396  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
1397  * "lp/recompfac" and should be recomputed.
1398  */
1400  SCIP* scip, /**< SCIP data structure */
1401  SCIP_Real newvalue, /**< new value after update */
1402  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
1403  )
1404 {
1405  assert(scip != NULL);
1406 
1407  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisUpdateUnreliable", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1408 
1409  return SCIPsetIsUpdateUnreliable(scip->set, newvalue, oldvalue);
1410 }
SCIP_Real SCIPdualfeasRound(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetFeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6540
internal methods for separators
SCIP_Bool SCIPsetIsUpdateUnreliable(SCIP_SET *set, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: set.c:7068
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5953
SCIP_Bool SCIPsetIsSumGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6256
#define NULL
Definition: def.h:246
internal methods for managing events
SCIP_Bool SCIPisDualfeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeastol(SCIP *scip)
default message handler
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6011
trivialnegation primal heuristic
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6461
internal methods for storing primal CIP solutions
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)
methods to interpret (evaluate) an expression tree "fast"
SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
internal methods for branch and bound tree
SCIP_Bool SCIPsetIsSumZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6274
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:5855
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:6562
SCIP_Real SCIPsetFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6140
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6351
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
methods for implications, variable bounds, and cliques
SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_LPALGO lastlpalgo
Definition: struct_lp.h:339
#define SCIP_MAXSTRLEN
Definition: def.h:267
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:6650
internal methods for clocks and timing issues
SCIP_Bool SCIPsetIsSumGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6238
SCIP_Bool SCIPsetIsPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6076
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:7014
internal methods for NLPI solver interfaces
SCIP_Bool SCIPisDualfeasFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
interface methods for specific LP solvers
SCIP_Bool SCIPsetIsScalingIntegral(SCIP_SET *set, SCIP_Real val, SCIP_Real scalar)
Definition: set.c:6109
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5813
internal methods for displaying statistics tables
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:72
methods for the aggregation rows
SCIP_Real SCIPsetSetRelaxfeastol(SCIP_SET *set, SCIP_Real relaxfeastol)
Definition: set.c:5640
SCIP_Bool SCIPsetIsFeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6494
SCIP_Bool solved
Definition: struct_lp.h:352
internal methods for Benders&#39; decomposition
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10253
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6065
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
#define TRUE
Definition: def.h:71
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
methods commonly used by primal heuristics
internal methods for branching rules and branching candidate storage
SCIP_Real SCIPsetCutoffbounddelta(SCIP_SET *set)
Definition: set.c:5918
SCIP_Bool SCIPsetIsSumLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6202
datastructures for concurrent solvers
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6162
SCIP_Bool SCIPsetIsDualfeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6606
SCIP_Real SCIPsetRelaxfeastol(SCIP_SET *set)
Definition: set.c:5932
void SCIPprintReal(SCIP *scip, FILE *file, SCIP_Real val, int width, int precision)
internal methods for handling parameter settings
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6087
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
methods for creating output for visualization tools (VBC, BAK)
nodereopt branching rule
#define SCIP_LONGINT_MAX
Definition: def.h:143
#define SCIP_LONGINT_MIN
Definition: def.h:144
SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6151
SCIP_Real SCIPsetGetHugeValue(SCIP_SET *set)
Definition: set.c:5825
internal methods for LP management
SCIP_Bool SCIPsetIsFeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6505
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Real SCIPbarrierconvtol(SCIP *scip)
internal methods for branching and inference history
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPrelaxfeastol(SCIP *scip)
public methods for numerical tolerances
internal methods for collecting primal CIP solutions and primal informations
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPsetSetFeastol(SCIP_SET *set, SCIP_Real feastol)
Definition: set.c:5549
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6047
internal methods for propagators
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:6729
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5993
SCIP_Bool SCIPsetIsSumLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6220
SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsSumRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:7036
git hash methods
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)
internal methods for storing and manipulating the main problem
SCIP_Real SCIPsetLpfeastol(SCIP_SET *set)
Definition: set.c:5875
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
methods for block memory pools and memory buffers
SCIP_Bool SCIPsetIsSumRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6948
SCIP_Bool SCIPisFracIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6838
SCIP_Bool SCIPsetIsDualfeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6705
SCIP_Bool SCIPisDualfeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
register additional core functionality that is designed as plugins
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:2010
internal methods for presolvers
SCIP_Real SCIPsetBarrierconvtol(SCIP_SET *set)
Definition: set.c:5888
SCIP_Real SCIPdualfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsSumRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6970
internal methods for NLP management
SCIP_Real SCIPsetFeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6529
void SCIPsetSetLimitChanged(SCIP_SET *set)
Definition: set.c:5657
SCIP_Bool SCIPsetIsRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6882
internal miscellaneous methods
SCIP_Real SCIPsetDualfeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6740
SCIP_Bool SCIPsetIsDualfeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6716
SCIP_Bool SCIPsetIsDualfeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6628
SCIP_Real SCIPsetFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6173
SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol)
SCIP_Bool SCIPsetIsRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6904
internal methods for node selectors and node priority queues
internal methods for variable pricers
SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
internal methods for global SCIP settings
internal methods for storing conflicts
#define SCIP_CALL(x)
Definition: def.h:358
SCIP main data structure.
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6439
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsetSetLpfeastol(SCIP_SET *set, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: set.c:5571
SCIP_Bool SCIPsetIsLbBetter(SCIP_SET *set, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6776
void SCIPmarkLimitChanged(SCIP *scip)
internal methods for storing priced variables
internal methods for relaxators
SCIP_Bool SCIPsetIsEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5975
SCIP_Bool SCIPsetIsHugeValue(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5964
internal methods for storing separated cuts
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6395
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
methods commonly used for presolving
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
methods for catching the user CTRL-C interrupt
internal methods for problem variables
data structures and methods for collecting reoptimization information
the function declarations for the synchronization store
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6098
public data structures and miscellaneous methods
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
internal methods for user interface dialog
#define SCIP_Bool
Definition: def.h:69
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
Definition: set.c:5845
SCIP_RETCODE SCIPsetSetBarrierconvtol(SCIP_SET *set, SCIP_Real barrierconvtol)
Definition: set.c:5622
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPlpfeastol(SCIP *scip)
internal methods for input file readers
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10354
SCIP_Real SCIPsetDualfeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6762
methods for debugging
SCIP_Bool SCIPsetIsRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6860
SCIP_Real SCIPsetDualfeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6751
SCIP_Bool SCIPsetIsSumNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6296
reoptsols primal heuristic
internal methods for storing cuts in a cut pool
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
Constraint handler for linear constraints in their most general form, .
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:6373
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:6184
helper functions for concurrent scip solvers
SCIP_Real SCIPsetFeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6551
SCIP_Bool SCIPsetIsDualfeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6683
internal methods for return codes for SCIP methods
SCIP_Bool SCIPsetIsSumPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6285
SCIP_Real SCIPsetFeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6518
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
internal methods for conflict analysis
internal methods for tree compressions
internal methods for main solving loop and node processing
SCIP_Real SCIPgetHugeValue(SCIP *scip)
SCIP_SET * set
Definition: struct_scip.h:62
public methods for message output
SCIP_Bool SCIPsetIsSumRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6992
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:608
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6029
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
default user interface dialog
#define SCIP_Real
Definition: def.h:157
internal methods for problem statistics
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6472
SCIP_Real SCIPsetDualfeastol(SCIP_SET *set)
Definition: set.c:5865
internal methods for constraints and constraint handlers
SCIP_Bool SCIPisDualfeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
#define SCIP_Longint
Definition: def.h:142
SCIP_RETCODE SCIPsetSetDualfeastol(SCIP_SET *set, SCIP_Real dualfeastol)
Definition: set.c:5609
SCIP_Bool SCIPsetIsDualfeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6672
SCIP_Real 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:6417
declarations for XML parsing
build flags methods
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPsetEpsilon(SCIP_SET *set)
Definition: set.c:5835
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:6801
SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsDualfeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6694
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
common defines and data types used in all packages of SCIP
#define SCIP_CALL_ABORT(x)
Definition: def.h:337
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
internal methods for primal heuristics
SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_LP * lp
Definition: struct_scip.h:80
SCIP_Bool SCIPsetIsRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6926
SCIP_LPSOLSTAT lpsolstat
Definition: struct_lp.h:338
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsDualfeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6584
SCIP_Bool SCIPsetIsFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6127
double real
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
internal methods for Benders&#39; decomposition cuts
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPsetIsFeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6483
internal methods for displaying runtime statistics
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.