 # SCIP

Solving Constraint Integer Programs

Numerical Methods

## Macros

#define SCIPisFinite(x)   ((x) == (x))

## Functions

SCIP_Real SCIPcalcMachineEpsilon (void)

SCIP_Longint SCIPcalcGreComDiv (SCIP_Longint val1, SCIP_Longint val2)

SCIP_Longint SCIPcalcSmaComMul (SCIP_Longint val1, SCIP_Longint val2)

SCIP_Bool SCIPrealToRational (SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)

SCIP_RETCODE SCIPcalcIntegralScalar (SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)

SCIP_Bool SCIPfindSimpleRational (SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)

SCIP_Real SCIPselectSimpleValue (SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom)

SCIP_Real SCIPrelDiff (SCIP_Real val1, SCIP_Real val2)

## Macro Definition Documentation

 #define SCIPisFinite ( x ) ((x) == (x))

Definition at line 4981 of file pub_misc.h.

## Function Documentation

 SCIP_Real SCIPcalcMachineEpsilon ( void )

returns the machine epsilon: the smallest number eps > 0, for which 1.0 + eps > 1.0

 SCIP_Longint SCIPcalcGreComDiv ( SCIP_Longint val1, SCIP_Longint val2 )

calculates the greatest common divisor of the two given values

Parameters
 val1 first value of greatest common devisor calculation val2 second value of greatest common devisor calculation
 SCIP_Longint SCIPcalcSmaComMul ( SCIP_Longint val1, SCIP_Longint val2 )

calculates the smallest common multiple of the two given values

Parameters
 val1 first value of smallest common multiple calculation val2 second value of smallest common multiple calculation
 SCIP_Bool SCIPrealToRational ( SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint * nominator, SCIP_Longint * denominator )

converts a real number into a (approximate) rational representation, and returns TRUE iff the conversion was successful

Parameters
 val real value r to convert into rational number mindelta minimal allowed difference r - q of real r and rational q = n/d maxdelta maximal allowed difference r - q of real r and rational q = n/d maxdnom maximal denominator allowed nominator pointer to store the nominator n of the rational number denominator pointer to store the denominator d of the rational number
 SCIP_RETCODE SCIPcalcIntegralScalar ( SCIP_Real * vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real * intscalar, SCIP_Bool * success )

tries to find a value, such that all given values, if scaled with this value become integral in relative allowed difference in between mindelta and maxdelta

Parameters
 vals values to scale nvals number of values to scale mindelta minimal relative allowed difference of scaled coefficient s*c and integral i maxdelta maximal relative allowed difference of scaled coefficient s*c and integral i maxdnom maximal denominator allowed in rational numbers maxscale maximal allowed scalar intscalar pointer to store scalar that would make the coefficients integral, or NULL success stores whether returned value is valid
 SCIP_Bool SCIPfindSimpleRational ( SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom, SCIP_Longint * nominator, SCIP_Longint * denominator )

given a (usually very small) interval, tries to find a rational number with simple denominator (i.e. a small number, probably multiplied with powers of 10) out of this interval; returns TRUE iff a valid rational number inside the interval was found

Parameters
 lb lower bound of the interval ub upper bound of the interval maxdnom maximal denominator allowed for resulting rational number nominator pointer to store the nominator n of the rational number denominator pointer to store the denominator d of the rational number
 SCIP_Real SCIPselectSimpleValue ( SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom )

given a (usually very small) interval, selects a value inside this interval; it is tried to select a rational number with simple denominator (i.e. a small number, probably multiplied with powers of 10); if no valid rational number inside the interval was found, selects the central value of the interval

Parameters
 lb lower bound of the interval ub upper bound of the interval maxdnom maximal denominator allowed for resulting rational number
 SCIP_Real SCIPrelDiff ( SCIP_Real val1, SCIP_Real val2 )

returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0)

Parameters
 val1 first value to be compared val2 second value to be compared