VariableScale struct
#include <gtopt/variable_scale.hpp>
Scale definition for an LP variable.
Convention: physical_value = LP_value × scale.
When uid is set, the scale applies only to the element with that UID. When uid is absent, the scale applies to all elements of the given class.
Public variables
Variable documentation
std::string gtopt:: VariableScale:: class_name
Element class (e.g. "Bus", "Reservoir"). Owning std::string: JSON deserialisation binds these zero-copy into the transient parse buffer that parse_planning_json frees on return, so a std::string_view here dangled — a heap-use-after-free later read by auto_scale_reservoirs (found by ThreadSanitizer). Owning the string is correct and cheap; the programmatic call sites just build a small string from a constexpr full_name(). VariableScaleMap still holds string_view keys into these strings — the source must outlive the map (contract unchanged).