gtopt/ampl_variable.hpp file

Registry types for user-constraint (AMPL) variable resolution.

Each LP element registers its PAMPL-visible columns via SystemContext::add_ampl_variable at add_to_lp time. The user-constraint resolver then looks them up generically through find_ampl_col, replacing the former element-type dispatch chain in element_column_resolver.cpp.

Design mirrors StateVariable / SimulationLP::add_state_variable.

Class name storage: class_name is std::string_view pointing into each LPClassName::snake_case() constexpr buffer — program- lifetime storage, so no allocation on map lookups. attribute is likewise std::string_view because attribute names come from constexpr class-level literals (e.g. GeneratorLP::GenerationName).

block_cols is a non-owning pointer into the element's own STBIndexHolder; elements and the registry share the same SimulationLP scope, so the pointer stays valid for the full solve.

Namespaces

namespace gtopt

Classes

struct gtopt::AmplCompoundKey
struct gtopt::AmplCompoundLeg
struct gtopt::AmplMetadataKey
Lookup key for the per-element metadata registry.
struct gtopt::AmplParamKey
struct gtopt::AmplScalarKey
struct gtopt::AmplVariable
struct gtopt::AmplVariableKey
struct gtopt::AmplVariableKeyHash
struct gtopt::AmplVariable::Extras