Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <lp_data_utils.h>
Public Member Functions | |
void | Scale (LinearProgram *lp) |
Scale the given LP. | |
void | Scale (const GlopParameters ¶ms, LinearProgram *lp) |
void | Clear () |
Clear all scaling coefficients. | |
Fractional | ScaleVariableValue (ColIndex col, Fractional value) const |
Transforms value from unscaled domain to the scaled one. | |
Fractional | ScaleReducedCost (ColIndex col, Fractional value) const |
Fractional | ScaleDualValue (RowIndex row, Fractional value) const |
Fractional | ScaleConstraintActivity (RowIndex row, Fractional value) const |
Fractional | UnscaleVariableValue (ColIndex col, Fractional value) const |
Transforms corresponding value from the scaled domain to the original one. | |
Fractional | UnscaleReducedCost (ColIndex col, Fractional value) const |
Fractional | UnscaleDualValue (RowIndex row, Fractional value) const |
Fractional | UnscaleConstraintActivity (RowIndex row, Fractional value) const |
void | UnscaleUnitRowLeftSolve (ColIndex basis_col, ScatteredRow *left_inverse) const |
void | UnscaleColumnRightSolve (const RowToColMapping &basis, ColIndex col, ScatteredColumn *right_inverse) const |
Unscale a col vector v such that B.c = matrix_column_col. | |
Fractional | VariableScalingFactor (ColIndex col) const |
Fractional | BoundsScalingFactor () const |
Fractional | ObjectiveScalingFactor () const |
Class to facilitate the conversion between an original "unscaled" LP problem and its scaled version. It is easy to get the direction wrong, so it make sense to have a single place where all the scaling formulas are kept.
Definition at line 52 of file lp_data_utils.h.
|
inline |
Visible for testing. All objective coefficients of the original LP where multiplied by this factor. Nothing else changed.
Definition at line 88 of file lp_data_utils.h.
void operations_research::glop::LpScalingHelper::Clear | ( | ) |
Clear all scaling coefficients.
Definition at line 93 of file lp_data_utils.cc.
|
inline |
Visible for testing. All variable/constraint bounds of the original LP where multiplied by this factor. Nothing else changed.
Definition at line 92 of file lp_data_utils.h.
void operations_research::glop::LpScalingHelper::Scale | ( | const GlopParameters & | params, |
LinearProgram * | lp ) |
Definition at line 86 of file lp_data_utils.cc.
void operations_research::glop::LpScalingHelper::Scale | ( | LinearProgram * | lp | ) |
Scale the given LP.
Definition at line 84 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::ScaleConstraintActivity | ( | RowIndex | row, |
Fractional | value ) const |
The activity move with the row_scale and the bound_scaling_factor.
Definition at line 122 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::ScaleDualValue | ( | RowIndex | row, |
Fractional | value ) const |
The dual value move like the objective and the inverse of the row scale.
Definition at line 116 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::ScaleReducedCost | ( | ColIndex | col, |
Fractional | value ) const |
The reduced cost move like the objective and the col scale.
Definition at line 110 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::ScaleVariableValue | ( | ColIndex | col, |
Fractional | value ) const |
Transforms value from unscaled domain to the scaled one.
Definition at line 105 of file lp_data_utils.cc.
void operations_research::glop::LpScalingHelper::UnscaleColumnRightSolve | ( | const RowToColMapping & | basis, |
ColIndex | col, | ||
ScatteredColumn * | right_inverse ) const |
Unscale a col vector v such that B.c = matrix_column_col.
[RowScale * B * BColScale] * inverse = RowScale * column * ColScale. That is B * (BColScale * inverse) = column * ColScale[col].
Definition at line 171 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::UnscaleConstraintActivity | ( | RowIndex | row, |
Fractional | value ) const |
The activity move with the row_scale and the bound_scaling_factor.
Definition at line 146 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::UnscaleDualValue | ( | RowIndex | row, |
Fractional | value ) const |
The dual value move like the objective and the inverse of the row scale.
Definition at line 140 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::UnscaleReducedCost | ( | ColIndex | col, |
Fractional | value ) const |
The reduced cost move like the objective and the col scale.
Definition at line 134 of file lp_data_utils.cc.
void operations_research::glop::LpScalingHelper::UnscaleUnitRowLeftSolve | ( | ColIndex | basis_col, |
ScatteredRow * | left_inverse ) const |
Unscale a row vector v such that v.B = unit_row. When basis_col is the index of the Column that correspond to the unit position in matrix B.
We have left_inverse * [RowScale * B * ColScale] = unit_row.
Definition at line 152 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::UnscaleVariableValue | ( | ColIndex | col, |
Fractional | value ) const |
Transforms corresponding value from the scaled domain to the original one.
Just the opposite of ScaleVariableValue().
Definition at line 128 of file lp_data_utils.cc.
Fractional operations_research::glop::LpScalingHelper::VariableScalingFactor | ( | ColIndex | col | ) | const |
A variable value in the original domain must be multiplied by this factor to be in the scaled domain.
During scaling a col was multiplied by ColScalingFactor() and the variable bounds divided by it.
Definition at line 99 of file lp_data_utils.cc.