gtopt/lp_scales.hpp file

Machine-readable sidecar describing a written LP/MPS file.

A written .lp/.mps file already carries the whole model: matrix, bounds, integrality, names and the objective constant. What it cannot carry is how gtopt scaled that model, so a solution read back from an external solver cannot be mapped to physical units without:

  • the objective scale (scale_objective),
  • the per-block weights (cost_factor) folded into every cost,
  • the columns and rows whose scale factor is not 1.

LpScales holds the header of that (plus the objective constant, redundant with the LP but convenient, the gtopt build that wrote it and the numerical ranges of the model), is built by make_lp_scales() and is serialised with daw::json (json/json_lp_scales.hpp). The per-column / per-row scale factors (LpScalesDetail, full level) can reach millions of entries on a real case, so they go to two Parquet tables next to the JSON, which only points to them. See docs/lp-scales.md for the schema (gtopt-lp-scales/1).

Namespaces

namespace gtopt

Classes

struct gtopt::LpScaledColumn
A column whose scale factor is not 1: x_physical = scale * x_LP.
struct gtopt::LpScaledRow
struct gtopt::LpScales
Everything needed to read an exported LP back in physical units.
struct gtopt::LpScalesBlock
Weights of one (scenario, stage, block) of the cell.
struct gtopt::LpScalesBuild
Which gtopt wrote the sidecar (audit trail).
struct gtopt::LpScalesContext
struct gtopt::LpScalesDetail
struct gtopt::LpScalesNumerics
struct gtopt::LpScalesObjective
Objective scaling: obj_physical = obj_LP * scale_objective.
struct gtopt::LpScalesRange
struct gtopt::LpScalesRowType
Matrix coefficient range of one constraint family.
struct gtopt::LpScalesStage
struct gtopt::LpScalesTables