Tolerances and Numerics
-
namespace idol
Functions
-
static bool is_pos_inf(double t_value)
-
static bool is_neg_inf(double t_value)
-
static bool is_inf(double t_value)
-
static bool equals(double t_a, double t_b, double t_tolerance)
-
static double relative_gap(double t_lb, double t_ub)
-
static double absolute_gap(double t_lb, double t_ub)
-
static bool is_integer(double t_value, double t_tolerance)
-
static double round(double t_value, unsigned int t_n_digits = 0)
-
static double multiply_with_precision(double t_a, double t_b, unsigned int t_n_digits)
-
static double multiply_with_precision_by_power_of_10(double t_x, unsigned int t_exponent, unsigned int t_n_digits)
Variables
-
static constexpr double Inf = 1e20
-
namespace Tolerance
Stores the default high-level tolerances used in idol.
It is possible for external-mip to have additional tolerance parameters, yet, the tolerances defined in this namespace should always be taken into account by the optimizer. Apart from the Sparsity tolerance, users can also change tolerance values at a local level (i.e., at an optimizer level) rather than at a global level.
Variables
-
static double Sparsity = 1e-8
Default: \( 10^{-8} \)
Recommended range: \( [ 10^{-10}, 10^{-5} ] \)
This tolerance is used when data is saved in a sparse manner. For instance, when a value close to zero should be stored or ignored when saving a primal point.
-
static unsigned int Digits = 8
-
static double MIPRelativeGap = 1e-4
Default: \( 10^{-4} \)
Recommended range: \( [ 0, +\infty ] \)
Used to declare optimality of a MIP solution by comparing with the current relative gap.
The relative gap is computed as follows:
\[ RelativeGap := \frac{ |UB - LB| }{ 10^{-10} + |UB| }. \]
-
static double MIPAbsoluteGap = 1e-5
Default: \( 10^{-5} \)
Recommended range: \( [ 0, \infty ] \)
Used to declare optimality of a MIP solution by comparing with the current absolute gap.
The absolute gap is computed as follows:
\[ AbsoluteGap := |UB - LB| \]
-
static double Integer = 10e-5
Default: \( 10^{-5} \)
Recommended range: \( [ 10^{-9}, 10^{-1} ] \)
Used to recognized integer values, i.e., a given value is considered integer when the closest integer point is closer than this tolerance.
-
static double Feasibility = 10e-6
Default: \( 10^{-6} \)
Recommended range: \( [ 10^{-9}, 10^{-2} ] \)
Used to characterized constraint satisfaction, i.e., a constraint is satisfied if it is not violated by a larger amount than this tolerance.
-
static double Optimality = 10e-6
Default: \( 10^{-6} \)
Recommended range: \( [ 10^{-9}, 10^{-2} ] \)
Used to characterize optimality, i.e., all reduced costs must be smaller than this tolerance.
-
static double Sparsity = 1e-8
-
static bool is_pos_inf(double t_value)