gtopt::LpValidationOptions struct

Thresholds + on/off flag for incremental LP validation.

Mirrors LpMatrixOptions in shape: optional fields with merge semantics (first-value-wins). Defaults are chosen so that a "well-conditioned" IEEE benchmark stays silent and a coefficient like 1e15 on a balance row triggers a single line per kind.

Public functions

auto effective_bound_warn_max() const -> double noexcept
auto effective_coeff_warn_max() const -> double noexcept
auto effective_coeff_warn_min() const -> double noexcept
auto effective_enable() const -> bool noexcept
auto effective_max_warnings_per_kind() const -> int noexcept
auto effective_obj_warn_max() const -> double noexcept
auto effective_rhs_warn_max() const -> double noexcept
void merge(const LpValidationOptions& other) noexcept

Public variables

OptReal bound_warn_max
OptReal coeff_warn_max
OptReal coeff_warn_min
OptBool enable
OptInt max_warnings_per_kind
OptReal obj_warn_max
OptReal rhs_warn_max

Function documentation

void gtopt::LpValidationOptions::merge(const LpValidationOptions& other) noexcept

Merge optional fields from another LpValidationOptions. First-value-wins (mirrors LpMatrixOptions::merge).

Variable documentation

OptReal gtopt::LpValidationOptions::bound_warn_max

Finite |bound| above this triggers a "huge bound" warning. Default 1e12 — solver infinity sentinels (DblMax, +/- backend infinity) are skipped at the call site, so this only flags truly large finite numbers that the user probably didn't mean to write.

OptReal gtopt::LpValidationOptions::coeff_warn_max

|coeff| above this triggers a "huge coefficient" warning. Default 1e10 — well above the 1e7 ratio that lp_stats already flags as "poor", so we only warn on values that will likely confuse the solver.

OptReal gtopt::LpValidationOptions::coeff_warn_min

|coeff| below this (but > 0) triggers a "tiny coefficient" warning. Default 1e-10 — matches lp_stats stats_eps. These are the values that will round to zero in the LP file and silently disappear.

OptBool gtopt::LpValidationOptions::enable

Master switch. When unset, defaults to true at the consumer site — the validation always runs unless explicitly disabled.

OptInt gtopt::LpValidationOptions::max_warnings_per_kind

Maximum number of warnings emitted per kind before falling silent. Default 50 — enough to give the user pointers to fix the problem, not so many that a broken LP fills the log. After the cap is reached the count keeps incrementing (visible in the summary) but no more lines are printed.

OptReal gtopt::LpValidationOptions::obj_warn_max

|obj coefficient| above this triggers a "huge objective" warning. Default 1e10.

OptReal gtopt::LpValidationOptions::rhs_warn_max

Finite |RHS| above this triggers a "huge RHS" warning. Default 1e12 — same rationale as bound_warn_max.