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