17#ifndef OR_TOOLS_LP_DATA_LP_DATA_UTILS_H_
18#define OR_TOOLS_LP_DATA_LP_DATA_UTILS_H_
20#include "ortools/glop/parameters.pb.h"
43 GlopParameters::ScalingAlgorithm scaling_method);
61 absl::Span<const double> col_factors);
105 return objective_scaling_factor_;
109 Fractional RowUnscalingFactor(RowIndex row)
const {
110 return matrix_is_scaled_ ? row_unscaling_factors_[row] : 1.0;
112 Fractional ColUnscalingFactor(ColIndex col)
const {
113 return matrix_is_scaled_ ? col_unscaling_factors_[col] : 1.0;
116 bool matrix_is_scaled_ =
false;
Fractional ObjectiveScalingFactor() const
void UnscaleUnitRowLeftSolve(ColIndex basis_col, ScatteredRow *left_inverse) const
void AverageCostScaling(DenseRow *objective)
Extra scaling function, to scale objective/bounds.
void ConfigureFromFactors(absl::Span< const double > row_factors, absl::Span< const double > col_factors)
Fractional VariableScalingFactorWithSlack(ColIndex col) const
Fractional ScaleVariableValue(ColIndex col, Fractional value) const
Transforms value from unscaled domain to the scaled one.
Fractional UnscaleDualValue(RowIndex row, Fractional value) const
void ContainOneBoundScaling(DenseRow *upper_bounds, DenseRow *lower_bounds)
Fractional UnscaleConstraintActivity(RowIndex row, Fractional value) const
void Clear()
Clear all scaling coefficients.
Fractional UnscaleLeftSolveValue(RowIndex row, Fractional value) const
Fractional ScaleDualValue(RowIndex row, Fractional value) const
Fractional BoundsScalingFactor() const
void Scale(LinearProgram *lp)
Scale the given LP.
Fractional ScaleConstraintActivity(RowIndex row, Fractional value) const
Fractional UnscaleReducedCost(ColIndex col, Fractional value) const
Fractional VariableScalingFactor(ColIndex col) const
Fractional UnscaleVariableValue(ColIndex col, Fractional value) const
Transforms corresponding value from the scaled domain to the original one.
Fractional ScaleReducedCost(ColIndex col, Fractional value) const
void UnscaleColumnRightSolve(const RowToColMapping &basis, ColIndex col, ScatteredColumn *right_inverse) const
Unscale a col vector v such that B.c = matrix_column_col.
StrictITIVector< RowIndex, ColIndex > RowToColMapping
void ComputeSlackVariablesValues(const LinearProgram &linear_program, DenseRow *values)
void Scale(LinearProgram *lp, SparseMatrixScaler *scaler)
StrictITIVector< RowIndex, Fractional > DenseColumn
Column-vector types. Column-vector types are indexed by a row index.
StrictITIVector< ColIndex, Fractional > DenseRow
Row-vector types. Row-vector types are indexed by a column index.
In SWIG mode, we don't want anything besides these top-level includes.