gtopt/solve_outcome.hpp file

Tri-state outcome of a solver invocation.

Distinguishes the three result bands the gtopt_lp_runner layer has to act on differently:

  • Optimal — solver returned an optimal solution. Full write_out.
  • Partial — solver did not reach optimal but the cell still holds a usable solution (time-limit + feasible incumbent, MIP gap reached, SDDP / cascade sentinel-stop after iterations completed). The runner should still invoke write_solution_output so the user can inspect / resume / use the partial result.
  • Failed — hard failure (infeasibility, internal error, bad input). write_out would either throw or emit garbage; skip it.

The bridge from std::expected<int, Error> to SolveOutcome lives here in a small pure function so unit tests can exercise the classification logic without standing up a real solver.

Namespaces

namespace gtopt