gtopt::VariableScaleMap class

Lookup table for variable scales built from an array of VariableScale.

Resolution order for lookup(class_name, variable, uid):

  1. Entry matching (class_name, variable, uid) — per-element
  2. Entry matching (class_name, variable, -1) — per-class
  3. Fallback: 1.0

Constructors, destructors, conversion operators

VariableScaleMap() defaulted
VariableScaleMap(std::span<const VariableScale> scales) explicit

Public functions

auto empty() const -> bool noexcept
auto lookup(std::string_view class_name, std::string_view variable, Uid uid = unknown_uid) const -> double noexcept

Function documentation

double gtopt::VariableScaleMap::lookup(std::string_view class_name, std::string_view variable, Uid uid = unknown_uid) const noexcept

Look up the scale for a (class, variable, uid) triple. Returns the most specific match, or 1.0 if none found.