LineLP class
#include <gtopt/line_lp.hpp>
Base classes
-
template<typename Object Object>struct CapacityObjectLP<Line>
- A linear programming representation of an object with capacity constraints.
Public types
- struct DlrDualRef
- struct LimitRef
- using Base = ObjectLP<Line>
- using CapacityAndCol = std::pair<std::optional<double>, std::optional<ColIndex>>
- Pair of optional capacity value and optional expansion column index.
- using CapacityBase = CapacityObjectLP<Line>
- using Element = Line
- enum class LimitPart: uint8_t { conductor = 0, rating, outage, equipment, security, flowlimit }
- using object_type = Line
- Type of the wrapped object.
Public static variables
- static std::string_view BusAKey
- static std::string_view BusBKey
- static std::string_view CapacitynName
- static std::string_view CapacitypName
- static std::string_view CapacostName
- static std::string_view CapacostPrevName
- static std::string_view CapainstName
- static std::string_view CapainstPrevName
- static std::string_view CriticalSpanName
- static std::string_view DlrRatingEmergencyName
- static std::string_view DlrRatingName
- static std::string_view ExpmodName
- static std::string_view FlowAbsName
- static std::string_view FloweName
- static std::string_view FlowLambdaName
- static std::string_view FlowName
- static std::string_view FlownName
- static std::string_view FlowpName
- static std::string_view FlowsName
- static std::array<std::string_view, 6> LimitPartnNames
- static std::array<std::string_view, 6> LimitPartpNames
- static std::string_view LossName
- static std::string_view LossnName
- static std::string_view LosspName
- static std::string_view MvaName
- LinDistFlow MVA-polygon rows.
- static std::string_view OverloadnName
- B→A counterpart of
overloadp. - static std::string_view OverloadpName
- static std::string_view QflowName
- LinDistFlow reactive flow A→B [MVAr].
- static std::string_view SpanThermalName
- static std::string_view SpanThermalnName
- static std::string_view SpanThermalpName
- static std::string_view TapName
- LinDistFlow tap-range rows.
- static std::string_view ThermalnName
- static std::string_view ThermalpName
- static std::string_view ThetaName
- static std::string_view TypeKey
- static std::string_view VdropCapName
- static std::string_view VdropName
- LinDistFlow voltage-drop row.
- static std::string_view VsqTapName
- LinDistFlow tapped sending voltage
y = w_a/t²(optimised taps).
Public static functions
-
template<typename Primal, typename Cost, typename Dual>static auto limit_dual(const LimitRef& r, double span, Primal&& primal, Cost&& cost, Dual&& dual) -> double
Constructors, destructors, conversion operators
- LineLP(const Line& pline, const InputContext& ic) explicit
Public functions
- auto add_to_lp(SystemContext& sc, std::string_view ampl_class, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
- Add capacity constraints to the linear problem.
- auto add_to_lp(SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, LinearProblem& lp) -> bool
- auto add_to_output(OutputContext& out) const -> bool
- auto annual_capcost_at(StageUid stage_uid, double social_rate) const -> double
- Annualized investment cost [$/unit-year] at a stage.
- auto bus_a_sid() const -> BusLPSId noexcept
- auto bus_b_sid() const -> BusLPSId noexcept
- auto capacity_and_col(const StageLP& stage, LinearProblem& lp) const -> CapacityAndCol
- Query capacity value and optional expansion column for a stage.
- auto capacity_at(const StageLP& stage, const double def_capacity = std::numeric_limits<double>::max()) const -> double
- Get the capacity at a specific stage.
- auto capacity_col_at(const StageLP& stage) const -> auto noexcept
- Get the column index for capacity at a specific stage.
- auto capacityn_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto capacityp_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto class_name(this const Self& self) -> auto noexcept
- auto critical_span_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto dlr() const -> const LineDlrLP* noexcept
- Dynamic line rating (
Line.dlr), or nullptr when unset. - auto dlr_rating_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
-
auto effective_flow_direction(const SystemContext& sc) const -> line_direction::
Verdict - auto expmod_col_at(const StageLP& stage) const -> auto noexcept
- Get the column index for the expansion-modules variable at a stage.
- auto fixed_om_cost_at(StageUid stage_uid) const -> OptReal
- Fixed O&M cost [$/unit-year] at a stage (nullopt when unset).
- auto flown_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto flown_seg_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto flowp_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto flowp_seg_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto flows_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto has_theta_rows(const std::pair<ScenarioUid, StageUid>& st_key) const -> bool
- auto id() const -> auto noexcept
- auto is_active(const StageLP& stage) const -> bool
- Checks if object is active in given stage.
- auto is_loop() const -> bool
- auto limitn_refs_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto limitp_refs_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- Binding-limit refs per (scenario, stage) and block (A→B / B→A).
- auto line(this auto&& self) -> auto&& noexcept
- Returns the underlying Line object with proper forwarding semantics.
- auto lossn_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto lossp_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto object() && -> Line&& noexcept
- auto object() & -> Line& noexcept
- Gets the wrapped object.
- auto object() const && -> const Line&& noexcept
- auto object() const & -> const Line& noexcept
- auto overloadn_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto overloadp_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto qflow_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- void set_annuity_inputs(const InputContext& ic, OF&& overnight_capcost, OF&& economic_life, OF&& wacc)
- Set the annuity inputs of an object priced by overnight cost.
- void set_fixed_om_cost(const InputContext& ic, OF&& fixed_om_cost)
- Set the fixed O&M cost of the expansion capacity.
- auto set_id(Uid uid, Name name) -> auto& noexcept
- Sets the object's identifier.
- auto short_name(this const Self& self) -> auto noexcept
-
template<typename Primal, typename Cost, typename Dual>auto span_duals(const std::tuple<ScenarioUid, StageUid>& st, Primal&& primal, Cost&& cost, Dual&& dual) const -> BIndexHolder<std::vector<double>>
- auto span_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- Per-block per-span rows of
span_mode = rows(both directions). - auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> auto noexcept
- Generates a state variable key for the object.
- auto sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) -> auto noexcept
- auto thermaln_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto thermalp_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto theta_rows_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
- auto uid() const -> auto noexcept
- auto vsqtap_cols_at(const ScenarioLP& scenario, const StageLP& stage) const -> const auto&
Parameter accessors for user constraint resolution
Flow limit (PLEXOS Max Flow / Min Flow) per direction as a magnitude: tmax_ab (= max_flow) and tmax_ba (= -min_flow). nullopt = no flow limit.
- auto param_tmax_ab(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_tmax_ba(StageUid s, BlockUid b) const -> std::optional<double>
- auto limit_envelope(StageUid s, BlockUid b) const -> double
- auto param_min_flow(StageUid s, BlockUid b) const -> std::optional<double>
- Raw (signed, PLEXOS-convention) limit fields for PAMPL.
- auto param_max_rating(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_min_rating(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_overload_max_rating(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_overload_min_rating(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_outage_max_rating(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_outage_min_rating(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_units_out(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_conductor_rating_ab(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_conductor_rating_ba(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_equipment_rating_ab(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_equipment_rating_ba(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_security_limit_ab(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_security_limit_ba(StageUid s, BlockUid b) const -> std::optional<double>
- auto param_tcost(StageUid s, BlockUid b) const -> auto
- auto param_reactance(StageUid s) const -> auto
- auto param_voltage(StageUid s) const -> auto
- auto param_tap_ratio(StageUid s) const -> auto
- auto param_phase_shift_deg(StageUid s) const -> auto
- auto param_lossfactor(StageUid s, BlockUid b) const -> auto
- auto param_resistance(StageUid s) const -> auto
- auto param_loss_envelope(StageUid s) const -> auto
Enum documentation
enum class gtopt:: LineLP:: LimitPart: uint8_t
Binding part of the line limit (lines with rating / classified limits). The effective limit per direction and block is the min over the SET parts; one flow bound / thermal row carries it, and its dual is attributed to the binding part (ties: earliest in this order) as <part>{p,n}_dual: conductor (static conductor rating or DLR), rating (max/min rating, or the overload rating under the band), outage, equipment, security, flowlimit (max/min flow, tmax).
Typedef documentation
using gtopt:: LineLP:: Base = ObjectLP<Line>
#include <gtopt/capacity_object_lp.hpp>
using gtopt:: LineLP:: CapacityAndCol = std::pair<std::optional<double>, std::optional<ColIndex>>
#include <gtopt/capacity_object_lp.hpp>
Pair of optional capacity value and optional expansion column index.
using gtopt:: LineLP:: Element = Line
#include <gtopt/object_lp.hpp>
Alias for the wrapped data-struct type. Lets generic code reach the canonical LPClassName constant via T::Element::class_name where T is any LP wrapper inheriting from ObjectLP. Single source of truth for the class-name constant lives on the data struct (Bus::class_name, Reservoir::class_name, …); the LP wrappers no longer carry a duplicate ClassName member.
using gtopt:: LineLP:: object_type = Line
#include <gtopt/object_lp.hpp>
Type of the wrapped object.
Function documentation
template<typename Primal, typename Cost, typename Dual>
static double gtopt:: LineLP:: limit_dual(const LimitRef& r,
double span,
Primal&& primal,
Cost&& cost,
Dual&& dual)
Dual ∂obj/∂L (raw LP scale) of one binding-limit ref; span is the block's summed span dual (used when r.span_sum).
bool gtopt:: LineLP:: add_to_lp(SystemContext& sc,
std::string_view ampl_class,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp)
#include <gtopt/capacity_object_lp.hpp>
Add capacity constraints to the linear problem.
| Parameters | |
|---|---|
| sc | System context providing stage/scenario info |
| ampl_class | Canonical lowercase PAMPL class name ("generator", "demand", "line", "battery", "converter") — used to register the stage-level capainst column into the AMPL variable registry for user-constraint lookups. |
| scenario | Current scenario |
| stage | Current stage |
| lp | Linear problem to modify |
| Returns | true if successful, false otherwise |
Adds capacity-related variables and constraints:
- Capacity installation variables
- Capacity cost variables
- Expansion model variables (if applicable)
- Balance equations between stages
- Cost tracking equations
bool gtopt:: LineLP:: add_to_lp(SystemContext& sc,
const ScenarioLP& scenario,
const StageLP& stage,
LinearProblem& lp)
Per-block signed-flow column (populated only under LineLossesMode::tangent_signed_flow). When populated, the directional fpcols / fncols maps are empty for this block — KVL will stamp +x_τ directly on the signed column.
double gtopt:: LineLP:: annual_capcost_at(StageUid stage_uid,
double social_rate) const
#include <gtopt/capacity_object_lp.hpp>
Annualized investment cost [$/unit-year] at a stage.
annual_capcost when set; else the annuity of overnight_capcost at the object's wacc (or social_rate when unset) over its economic_life; else 0.
CapacityAndCol gtopt:: LineLP:: capacity_and_col(const StageLP& stage,
LinearProblem& lp) const
#include <gtopt/capacity_object_lp.hpp>
Query capacity value and optional expansion column for a stage.
| Parameters | |
|---|---|
| stage | The stage to query |
| lp | Linear problem reference (needed for expansion col bounds) |
Returns {std::optional<double>, std::optional<ColIndex>}. The capacity is nullopt when no expansion column exists AND no capacity schedule value is defined — i.e. when the physical capacity is truly undefined. Callers that need a numeric fallback should use value_or(default) on the returned optional.
double gtopt:: LineLP:: capacity_at(const StageLP& stage,
const double def_capacity = std::numeric_limits<double>::max()) const
#include <gtopt/capacity_object_lp.hpp>
Get the capacity at a specific stage.
| Parameters | |
|---|---|
| stage | The stage to query capacity for |
| def_capacity | Default value if capacity not specified (default: unlimited) |
| Returns | The capacity at given stage or default if not specified |
auto gtopt:: LineLP:: capacity_col_at(const StageLP& stage) const noexcept
#include <gtopt/capacity_object_lp.hpp>
Get the column index for capacity at a specific stage.
| Parameters | |
|---|---|
| stage | The stage to get column index for |
| Returns | Optional containing column index if exists |
auto gtopt:: LineLP:: class_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
const auto& gtopt:: LineLP:: critical_span_at(const ScenarioLP& scenario,
const StageLP& stage) const
Per-block uid of the binding (argmin, normal tier) span; -1 when the static tmax_ab is strictly lower than every span.
const auto& gtopt:: LineLP:: dlr_rating_at(const ScenarioLP& scenario,
const StageLP& stage) const
Per-block effective DLR normal rating [MW] (A→B, capped by the static tmax_ab). Empty when DLR is off.
line_direction:: Verdict gtopt:: LineLP:: effective_flow_direction(const SystemContext& sc) const
Effective flow direction of this line: an explicit flow_direction = "ab" | "ba" | "both" wins; otherwise (unset or "auto") the structural decision computed by SystemLP from model_options.line_direction_mode (both when detection is off).
auto gtopt:: LineLP:: expmod_col_at(const StageLP& stage) const noexcept
#include <gtopt/capacity_object_lp.hpp>
Get the column index for the expansion-modules variable at a stage.
| Parameters | |
|---|---|
| stage | The stage to query |
| Returns | Optional column index (empty when the object has no expansion capacity or the stage did not create an expmod column) |
OptReal gtopt:: LineLP:: fixed_om_cost_at(StageUid stage_uid) const
#include <gtopt/capacity_object_lp.hpp>
Fixed O&M cost [$/unit-year] at a stage (nullopt when unset).
const auto& gtopt:: LineLP:: flowp_seg_cols_at(const ScenarioLP& scenario,
const StageLP& stage) const
Per-block segment columns for the A→B direction (only populated in piecewise_direct line-loss mode; empty otherwise). Returns the per-block map; each block maps to a std::vector<ColIndex> of segment cols. Used by kirchhoff::cycle_basis::add_kvl_rows to stamp segments directly into per-cycle KVL rows when the flowp aggregator was elided.
const auto& gtopt:: LineLP:: flows_cols_at(const ScenarioLP& scenario,
const StageLP& stage) const
Per-block signed-flow column map (populated only under LineLossesMode::tangent_signed_flow). When present, the flowp_cols / flown_cols maps are empty for this (scenario, stage) and KVL stamps +x_τ on each signed flow column. Same missing-key tolerance as the other flow accessors.
bool gtopt:: LineLP:: has_theta_rows(const std::pair<ScenarioUid, StageUid>& st_key) const
Check if this line created Kirchhoff (theta) rows for a given (scenario, stage) pair.
auto gtopt:: LineLP:: id() const noexcept
#include <gtopt/capacity_object_lp.hpp>
| Returns | The object's complete identifier (uid + name) |
|---|
bool gtopt:: LineLP:: is_active(const StageLP& stage) const
#include <gtopt/capacity_object_lp.hpp>
Checks if object is active in given stage.
| Parameters | |
|---|---|
| stage | The stage to check |
| Returns | true if active in stage, false otherwise |
auto&& gtopt:: LineLP:: line(this auto&& self) noexcept
Returns the underlying Line object with proper forwarding semantics.
| Parameters | |
|---|---|
| self | The calling object (implicit) |
| Returns | Reference to the Line object with same value category and const-ness as self |
Line&& gtopt:: LineLP:: object() && noexcept
#include <gtopt/capacity_object_lp.hpp>
Line& gtopt:: LineLP:: object() & noexcept
#include <gtopt/capacity_object_lp.hpp>
Gets the wrapped object.
| Returns | Reference to the wrapped object |
|---|
const Line&& gtopt:: LineLP:: object() const && noexcept
#include <gtopt/capacity_object_lp.hpp>
const Line& gtopt:: LineLP:: object() const & noexcept
#include <gtopt/capacity_object_lp.hpp>
const auto& gtopt:: LineLP:: overloadp_cols_at(const ScenarioLP& scenario,
const StageLP& stage) const
Overload-slack column accessors. Return a reference to a static empty BIndexHolder when the soft-cap feature is not active for this (scenario, stage) (no tmax_normal_* + positive overload_penalty resolved here). Mirrors the missing-key tolerance of the flow accessors above so tests / PAMPL consumers can blindly query without branching.
const auto& gtopt:: LineLP:: qflow_cols_at(const ScenarioLP& scenario,
const StageLP& stage) const
All four flow-col accessors below tolerate a missing (scenario, stage) outer key by returning a reference to a static empty BIndexHolder via find_or_empty_inner. Pre-2026-05-14 the assignment in add_to_lp was unconditional even when the inner map was empty (e.g. flowp_seg_cols for non-direct modes, flowp_cols for piecewise_direct), keeping the outer key present. The new conditional-assignment pattern only inserts the outer key when at least one block populated the inner map, so callers must handle the missing-key case — these helpers centralise it. LinDistFlow reactive-flow / tapped-voltage columns (empty when the model is off or the line has fixed taps).
void gtopt:: LineLP:: set_annuity_inputs(const InputContext& ic,
OF&& overnight_capcost,
OF&& economic_life,
OF&& wacc)
#include <gtopt/capacity_object_lp.hpp>
Set the annuity inputs of an object priced by overnight cost.
Used where annual_capcost is unset at a stage: the LP charges overnight_capcost × CRF(wacc, economic_life) per unit-year, wacc falling back to the planning-wide annual_discount_rate.
void gtopt:: LineLP:: set_fixed_om_cost(const InputContext& ic,
OF&& fixed_om_cost)
#include <gtopt/capacity_object_lp.hpp>
Set the fixed O&M cost of the expansion capacity.
fixed_om_cost [$/unit-year] is charged, next to the annuity, on the capacity built from a stage on. Unset → no fixed O&M.
auto& gtopt:: LineLP:: set_id(Uid uid,
Name name) noexcept
#include <gtopt/object_lp.hpp>
Sets the object's identifier.
| Parameters | |
|---|---|
| uid | Unique identifier |
| name | Human-readable name |
| Returns | Reference to self for chaining |
auto gtopt:: LineLP:: short_name(this const Self& self) noexcept
#include <gtopt/object_lp.hpp>
template<typename Primal, typename Cost, typename Dual>
BIndexHolder<std::vector<double>> gtopt:: LineLP:: span_duals(const std::tuple<ScenarioUid, StageUid>& st,
Primal&& primal,
Cost&& cost,
Dual&& dual) const
Per-block, per-span rating duals ∂obj/∂T_k (raw LP scale, i.e. before the per-block cost-factor unfolding) evaluated from the given primal / reduced-cost / row-dual accessors. Index k of each vector is the span position in dlr()->spans().
auto gtopt:: LineLP:: sv_key(this const Self& self,
const ScenarioLP& scenario,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
Generates a state variable key for the object.
| Parameters | |
|---|---|
| self | Reference to the object |
| scenario | Scenario context |
| stage | Stage context |
| col_name | The column name for the state variable |
| Returns | StateVariable::Key |
auto gtopt:: LineLP:: sv_key(this const Self& self,
const StageLP& stage,
std::string_view col_name) noexcept
#include <gtopt/object_utils.hpp>
const auto& gtopt:: LineLP:: theta_rows_at(const ScenarioLP& scenario,
const StageLP& stage) const
Per-(scenario, stage) Kirchhoff KVL row indices. Returns the inner per-block map for the (scenario, stage) cell, or a static empty map when this line has no KVL rows for that cell (radial network, node_angle mode skipped, etc.). Read by LineCommitmentLP (issue #509) when the OTS big-M disjunction rewrite needs to mutate the existing equality row.
auto gtopt:: LineLP:: uid() const noexcept
#include <gtopt/capacity_object_lp.hpp>
| Returns | The object's unique identifier |
|---|
double gtopt:: LineLP:: limit_envelope(StageUid s,
BlockUid b) const
Static limit envelope [MW] at (s, b): max over both directions of the min over the set static parts (flow, max(rating, overload), conductor, equipment, security); 0 when none is set. Spans the loss PWL.
Variable documentation
static std::string_view gtopt:: LineLP:: CapacostName
#include <gtopt/capacity_object_lp.hpp>
static std::string_view gtopt:: LineLP:: CapacostPrevName
#include <gtopt/capacity_object_lp.hpp>
static std::string_view gtopt:: LineLP:: CapainstName
#include <gtopt/capacity_object_lp.hpp>
static std::string_view gtopt:: LineLP:: CapainstPrevName
#include <gtopt/capacity_object_lp.hpp>
LP metadata variable_names for the dependent capainst/capacost columns that mirror a publisher in the previous phase at a cross-phase boundary. Named with a distinct suffix so the eager duplicate detector in LinearInterface::add_col can tell the dependent mirror apart from the current stage's own capainst/capacost (which share everything else in the 4-tuple metadata: class_name, variable_uid, stage context). The StateVariable lookup key still uses the un-suffixed names to match the publisher side in the previous phase.
static std::string_view gtopt:: LineLP:: ExpmodName
#include <gtopt/capacity_object_lp.hpp>
static std::string_view gtopt:: LineLP:: FlowAbsName
Auxiliary |f|-envelope column emitted by LineLossesMode::tangent_signed_flow to tighten the upper bound on the loss column. Bounded [0, fmax] and tied to the signed flow column f via two rows v ≥ +f and v ≥ −f (so v ≥ |f| at the optimum). Replaces the loose constant loss UB ℓ ≤ R·fmax²/V² with the linear-in-v chord ℓ ≤ (R·fmax/V²)·v, which is the secant chord of the convex quadratic R·v²/V² on [0, fmax]. See add_tangent_signed_flow for the math + derivation.
static std::string_view gtopt:: LineLP:: FlowLambdaName
Lambda-form SOS2 L-secant breakpoint weight col (issue #504 SOS2 path). 2L+1 cols per (line, block) emitted when tangent_signed_flow is paired with loss_use_sos2 = true and loss_secant_segments > 1. Indexed 0..2L so each label encodes the breakpoint position b_l = (l − L) · w on [−fmax, +fmax].
static std::string_view gtopt:: LineLP:: FlowName
compound signed primal: flowp − flown
static std::string_view gtopt:: LineLP:: FlownName
Excluded-direction stems (extras gate): flown_sol is the raw negative-direction primal (always ≥ 0; only when the LP has two directional columns), and flowe_cost is the EXCLUDED reduced cost — the rc that the sign-based flow_cost rule did NOT pick. flowe (not flown) for the rc so the naming signals "excluded", not "negative direction".
static std::string_view gtopt:: LineLP:: FlowpName
Internal-only LP variable names used during add_to_lp (not emitted in default output stems; consumers read flow_sol / flow_cost / flown_sol / flowe_cost instead).
static std::string_view gtopt:: LineLP:: FlowsName
Signed flow column emitted by LineLossesMode::tangent_signed_flow (Coffrin outer approximation; one column per (line, block) covering [−tmax_ba, +tmax_ab]). Distinct from FlowpName / FlownName so AMPL / output consumers can opt in to the signed shape when they want it; existing tools keep reading flowp_sol / flown_sol (derived max(0, f) / max(0, −f) are emitted for back-compat).
static std::string_view gtopt:: LineLP:: LossName
Consolidated per-(line, block) loss output emitted as Line/loss_sol.parquet under the solution write-out gate (NOT extras — a previous version of this note was stale; the emitter is the solution-gated add_col_sol / add_col_sol_values path). For the PWL modes (piecewise / bidirectional / adaptive) it equals LP(lossp) + LP(lossn) per cell — at most one of the two direction-specific cols is populated on any given block, so the sum is the total dissipated energy on that line that block. For piecewise_direct (no explicit loss column) it is reconstructed as Σ_k lf_k · seg_k_sol summed over both directional segment sets (see add_to_output). Replaces the paired lossp_sol / lossn_sol emission so downstream consumers see a single, schema-stable loss stream regardless of which direction the LP routed flow.
static std::string_view gtopt:: LineLP:: OverloadpName
Overload-slack column emitted only when Line.tmax_normal_ab and Line.overload_penalty are configured. Equals max(0, flowp − tmax_normal_ab) and is bounded by tmax_ab − tmax_normal_ab.
static std::string_view gtopt:: LineLP:: SpanThermalpName
Dynamic line rating (Line.dlr) names. span_thermalp / span_thermaln label the per-span rows of span_mode = rows (block context carries the span position). The output stems are dlr_rating_sol (effective normal rating [MW]), dlr_rating_emergency_sol (emergency tier), critical_span_sol (uid of the binding span, -1 when the static tmax is lower) and span_thermal_dual (per-span rating dual, keyed by SPAN uid).
static std::string_view gtopt:: LineLP:: ThermalpName
Thermal-limit rows f_dir + a·ℓ_dir ≤ T_dir emitted only under line_thermal_limit_mode = sending | full (see LineThermalLimitMode).
static std::string_view gtopt:: LineLP:: TypeKey
Filter metadata keys published by add_to_lp for sum(...) predicate matching.