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