Detailed Description
commonly used numerical methods
Modules | |
Computations With Tolerances | |
methods used by the majority of operations involving floating-point computations in SCIP | |
Macros | |
#define | SCIPisFinite(x) ((x) == (x)) |
Macro Definition Documentation
◆ SCIPisFinite
Definition at line 1861 of file pub_misc.h.
Referenced by addConcaveEstimatorBivariate(), addConcaveEstimatorUnivariate(), addIntervalGradientEstimator(), addLinearization(), computeViolation(), evalFunctionGradient(), F77_FUNC(), generate1ConvexIndefiniteUnderestimator(), generate1ConvexIndefiniteUnderestimatorAtBoundary(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(), generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(), generateConvexConcaveEstimator(), generateConvexConcaveUnderestimator(), generateCut(), generateEstimatingHyperplane(), generateLinearizationCut(), generateOrthogonal_lx_ly_Underestimator(), generateOrthogonal_lx_uy_Underestimator(), generateOverestimatingHyperplaneCut(), generateUnderestimatorParallelYFacets(), hessLagAddExprtree(), lifting(), readExpression(), readLinearCoefs(), readMultIncr(), SCIPexprgraphSimplify(), SCIPnlpiOracleEvalJacobian(), SCIPsolSetVal(), setupStart(), and solveDerivativeEquation().
Function Documentation
◆ SCIPcalcMachineEpsilon()
SCIP_EXPORT SCIP_Real SCIPcalcMachineEpsilon | ( | void | ) |
returns the machine epsilon: the smallest number eps > 0, for which 1.0 + eps > 1.0
Definition at line 8999 of file misc.c.
References eps, and SCIP_Real.
Referenced by SCIPrealHashCode().
◆ SCIPnextafter()
SCIP_EXPORT SCIP_Real SCIPnextafter | ( | SCIP_Real | from, |
SCIP_Real | to | ||
) |
returns the next representable value of from in the direction of to
- Parameters
-
from value from which the next representable value should be returned to direction in which the next representable value should be returned
Definition at line 9265 of file misc.c.
Referenced by initSolve(), SCIPintervalExp(), SCIPintervalLog(), SCIPintervalPowerScalar(), SCIPintervalPowerScalarScalar(), SCIPintervalSignPowerScalar(), SCIPintervalSolveUnivariateQuadExpressionPositiveAllScalar(), SCIPintervalSquareRoot(), and SCIPrealHashCode().
◆ SCIPcalcGreComDiv()
SCIP_EXPORT 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
Definition at line 9022 of file misc.c.
Referenced by deleteRedundantVars(), normalizeCumulativeCondition(), presolveTryAddLinearReform(), SCIPcalcIntegralScalar(), SCIPcalcSmaComMul(), SCIPprobScaleObj(), SCIPrealHashCode(), SCIProwCalcIntegralScalar(), SCIPsolveKnapsackExactly(), simplifyInequalities(), and tryAggregateIntVars().
◆ SCIPcalcSmaComMul()
SCIP_EXPORT 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
Definition at line 9274 of file misc.c.
References SCIP_Longint, and SCIPcalcGreComDiv().
Referenced by SCIPrealHashCode(), and tryAggregateIntVars().
◆ SCIPcalcBinomCoef()
SCIP_EXPORT SCIP_Longint SCIPcalcBinomCoef | ( | int | n, |
int | m | ||
) |
calculates a binomial coefficient n over m, choose m elements out of n, maximal value will be 33 over 16 (because the n=33 is the last line in the Pascal's triangle where each entry fits in a 4 byte value), an error occurs due to big numbers or an negative value m (and m < n) and -1 will be returned
- Parameters
-
n number of different elements m number to choose out of the above
Definition at line 10123 of file misc.c.
References SCIP_Longint, SCIP_LONGINT_MAX, and SCIP_Real.
Referenced by SCIPrealHashCode().
◆ SCIPrealToRational()
SCIP_EXPORT 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
Definition at line 9295 of file misc.c.
References a, b, EPSFLOOR, EPSGT, FALSE, NULL, REALABS, SCIP_Longint, SCIP_LONGINT_MAX, SCIP_Real, and TRUE.
Referenced by prettifyConss(), SCIPcalcIntegralScalar(), SCIPfindSimpleRational(), SCIPrealHashCode(), SCIProwCalcIntegralScalar(), and tryAggregateIntVars().
◆ SCIPcalcIntegralScalar()
SCIP_EXPORT 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
Definition at line 9458 of file misc.c.
References EPSEQ, FALSE, isIntegralScalar(), nscalars, NULL, REALABS, SCIP_Bool, SCIP_DEFAULT_EPSILON, SCIP_INVALID, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_REAL_MAX, SCIPcalcGreComDiv(), SCIPdebugMessage, SCIPrealToRational(), and TRUE.
Referenced by buildFlowCover(), cutTightenCoefs(), cutTightenCoefsQuad(), SCIP_DECL_PRICERREDCOST(), SCIPcutGenerationHeuristicCMIR(), SCIPprobScaleObj(), SCIPrealHashCode(), SCIPseparateRelaxedKnapsack(), and transformNonIntegralRow().
◆ SCIPfindSimpleRational()
SCIP_EXPORT 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
Definition at line 9672 of file misc.c.
References SCIP_Real, SCIPintervalGetRoundingMode(), SCIPintervalHasRoundingControl(), SCIPintervalSetRoundingMode(), SCIPintervalSetRoundingModeDownwards(), and SCIPrealToRational().
Referenced by SCIPrealHashCode(), and SCIPselectSimpleValue().
◆ SCIPselectSimpleValue()
SCIP_EXPORT 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
Definition at line 9719 of file misc.c.
References getRand(), MAX, NULL, SCIP_Bool, SCIP_Longint, SCIP_RAND_MAX, SCIP_Real, SCIPdebugMessage, SCIPdebugPrintf, and SCIPfindSimpleRational().
Referenced by presolveTryAddLinearReform(), SCIP_DECL_PRESOLEXEC(), SCIPanalyzeDeductionsProbing(), and SCIPrealHashCode().
◆ SCIPrelDiff()
SCIP_EXPORT 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
Definition at line 10912 of file misc.c.
References REALABS, and SCIP_Real.
Referenced by buildFlowCover(), checkCons(), checkCumulativeCondition(), checkOrigPbCons(), checkSolOrig(), computeViolation(), getIntegralScalar(), getIntegralVal(), isConsViolated(), isIntegralScalar(), priceAndCutLoop(), propagateBoundsCons(), SCIP_DECL_CONSCHECK(), SCIPbendersSubproblemIsOptimal(), SCIPbranchExecExtern(), SCIPbranchGetBranchingPoint(), SCIPconcsolverSync(), SCIPcutGenerationHeuristicCMIR(), SCIPexprgraphSimplify(), SCIPexprtreeSimplify(), SCIPsetIsLbBetter(), SCIPsetIsUbBetter(), SCIPtreeBranchVar(), SCIPtreeBranchVarNary(), SCIPvalidateSolve(), solveBendersSubproblems(), and updateBestCandidate().
◆ SCIPcomputeGap()
SCIP_EXPORT SCIP_Real SCIPcomputeGap | ( | SCIP_Real | eps, |
SCIP_Real | inf, | ||
SCIP_Real | primalbound, | ||
SCIP_Real | dualbound | ||
) |
computes the gap from the primal and the dual bound
- Parameters
-
eps the value treated as zero inf the value treated as infinity primalbound the primal bound dualbound the dual bound
Definition at line 10930 of file misc.c.
References EPSEQ, EPSZ, SCIP_Interval::inf, REALABS, and SCIP_Real.
Referenced by SCIPgetConcurrentGap(), SCIPgetGap(), SCIPgetTransGap(), and SCIPstoreSolutionGap().