gtopt/solver_cfg.hpp file

Solver tuning-file loader: INI .cfg with named enum values.

Backend plugins accept a per-solver tuning file next to gtopt's solver-agnostic solver_options.param_file (cases typically pin that to solvers/cplex.prm, so per-solver knobs live in SIBLING files). This header provides the shared loader so no plugin hand-rolls parsing:

  1. <dir>/<solver>.cfg — preferred. Standard INI via parse_ini_file (same dialect as .gtopt.conf): key = value pairs, # / ; comment lines, optional [<solver>] section (sectionless keys are accepted too; section entries override them). Inline trailing comments after the value are stripped.
  2. <dir>/<solver>.prm — legacy fallback (read only when no .cfg exists). Whitespace-separated <name> <value> lines with # / // comments — the historical cuopt.prm dialect.

Values from EITHER file go through the same translation so tuning files can say what they mean instead of memorising solver integer codes:

  • Numbers pass through verbatim (full backward compatibility).
  • Keys registered with an EnumEntry table (the project's named-enum framework, see enum_option.hpp) accept the entry names case-insensitively: method = concurrent → method 0.
  • Any other true/false/on/off/yes/no value maps to 1 / 0.
  • A symbolic value that matches nothing is DROPPED with a warning that lists the expected names — never forwarded as garbage.

Namespaces

namespace gtopt
namespace gtopt::detail

Classes

struct gtopt::SolverCfgEnumKey