gtopt::ResolveColResult struct

Result of resolve_col_to_row.

emitted is true when at least one column was added to the row. offset_shift accumulates Σ (leg_coef × leg_offset) for resolved columns whose AMPL registration carries a per-block additive offset (e.g., demand's Option C neg_fail = load − lmax substitution). The caller folds offset_shift into the row's RHS via BuildResult:: param_shift so user constraints like demand('d').load <= X remain physically correct even though the LP column actually stores neg_fail.

element_known is true when the (element_type, element_id) pair was found in the AMPL element registry, regardless of whether a column was emitted for this (scenario, stage, block). This distinguishes the two emitted = false cases:

  • element_known = true — the element exists in the registry but has no LP column for this specific (scenario, stage, block) (e.g. a generator with pmax=0 on that block — GeneratorLP omits the column). Caller should treat the term's contribution as 0 silently; the constraint stays well-formed.
  • element_known = false — the element name or UID is unknown to the registry (typo, deleted element, suppressed-by-mode, …). Strict-mode caller should raise an error; lenient-mode caller should warn-and-skip.

Pre-existing callers can ignore element_known; only the strict vs lenient branch in user_constraint_lp.cpp uses it.

Public variables

bool element_known
bool emitted
double offset_shift
const std::string* unreachable_scope

Variable documentation

const std::string* gtopt::ResolveColResult::unreachable_scope

Set (non-null) when nothing was emitted AND the element is scope-restricted (SimulationLP::register_ampl_scoped_element — a coarse-scope or single-block DecisionVariable): its column exists, but not at this (scenario, stage, block). Points at the registry's scope description. This is NEVER the implicit-zero leniency — the caller errors (strict) or warns (lax) instead of dropping the term.