gtopt::FlatLinearProblem struct

Represents a linear problem in column-major flat representation.

This format is commonly used by solver interfaces like COIN-OR, CPLEX, etc.

Public types

struct RowTypeStatsEntry
using index_map_t = std::unordered_map<std::string_view, index_t>
using index_t = int32_t
Type for indices (row/column indices)
using name_vec_t = std::vector<std::string>

Public variables

std::vector<double> col_scales
std::vector<index_t> colint
Indices of integer variables.
std::vector<double> collb
Lower bounds for variables.
index_map_t colmp
Map from variable names to indices.
name_vec_t colnm
Variable names.
std::vector<double> colub
Upper bounds for variables.
std::vector<index_t> matbeg
Column start indices in the sparse matrix.
std::vector<index_t> matind
Row indices for non-zero coefficients.
std::vector<double> matval
Values of non-zero coefficients.
std::string name
Problem name.
index_t ncols
Number of columns (variables)
index_t nrows
Number of rows (constraints)
std::vector<double> objval
Objective coefficients.
std::vector<double> row_scales
std::vector<double> rowlb
Lower bounds for constraints.
index_map_t rowmp
Map from constraint names to indices.
name_vec_t rownm
Constraint names.
std::vector<double> rowub
Upper bounds for constraints.

Coefficient statistics (populated when

LpMatrixOptions::compute_stats)

size_t stats_nnz
Non-zero count for the constraint matrix A.
size_t stats_zeroed
Count of non-zero entries filtered out by eps.
double stats_max_abs
Largest |coefficient| in constraint matrix A.
double stats_min_abs
Smallest |coefficient| in filtered A.
index_t stats_max_col
Column index of the largest |coefficient|.
index_t stats_min_col
Column index of the smallest |coefficient|.
std::string stats_max_col_name
Name of column with largest |coeff|.
std::string stats_min_col_name
Name of column with smallest |coeff|.
std::vector<RowTypeStatsEntry> row_type_stats
auto stats_coeff_ratio() const -> constexpr double noexcept
Coefficient ratio max/min (1.0 when empty, no valid min, or all equal).

Variable documentation

std::vector<double> gtopt::FlatLinearProblem::col_scales

Per-column physical-to-LP scale factors (physical = LP × scale; default 1.0)

std::vector<double> gtopt::FlatLinearProblem::row_scales

Per-row equilibration scale factors (max |coeff| per row). dual_physical = dual_LP / row_scale. Empty when row equilibration is off.