FlatLinearProblem struct
#include <gtopt/linear_problem.hpp>
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.