gtopt::AmplVariable::Extras struct

Rarely-populated alternative registration shapes, grouped behind a single unique_ptr so the common single-col (block_cols) and stage-col entries stay small. At CEN/SDDP scale the registry holds 10^5+ AmplVariables; carrying three otherwise-empty flat_map headers (~144 B) inline on every entry was pure overhead, so they live here and are allocated only when one is actually used — line.flow / fuel offtake → block_cols_weighted_sum; piecewise sum → block_cols_sum; Option-C demand shift → block_offsets. extras == nullptr is the common case (single-col / stage-col entries).

Public variables

BIndexHolder<std::vector<ColIndex>> block_cols_sum
BIndexHolder<std::vector<std::pair<ColIndex, double>>> block_cols_weighted_sum
BIndexHolder<double> block_offsets

Variable documentation

BIndexHolder<std::vector<ColIndex>> gtopt::AmplVariable::Extras::block_cols_sum

Per-block sum-of-cols. The attribute resolves to Σ cols per block (each col stamped with the leg coefficient by the resolver).

BIndexHolder<std::vector<std::pair<ColIndex, double>>> gtopt::AmplVariable::Extras::block_cols_weighted_sum

Per-block weighted sum-of-cols: Σ_k w_k · col_k per block. Resolver stamps row[col_k] += base_coef · w_k. Used by line.flow (+flowp − flown) and fuel("X").offtake.

BIndexHolder<double> gtopt::AmplVariable::Extras::block_offsets

Optional per-block additive offset (Option C demand substitution): physical_value = LP_value × scale + offset(b); the resolver folds the offset onto the row's RHS via param_shift.