gtopt::CutKey struct

Unique identifier of a Benders cut across save / load / dedup paths. The 5-tuple (scene, phase, iter, extra, type) is what distinguishes any two cuts:

  • scene_uid: the scene the cut was generated on (cut sharing preserves this UID on copies).
  • phase_uid: the phase the cut was added to.
  • iteration_index: the SDDP iter at which it was generated.
  • extra: the 4th element of :type:IterationContext — a free int discriminator that disambiguates multi-cut siblings (forward pass under multi_cut mode adds N feasibility cuts per (scene, phase) cell per iter; they share everything except this offset).
  • type: optimality vs feasibility.

Used by load_cuts_* to dedup combined + append-delta files and by forget_first_cuts for cross-scene cleanup. Spaceship operator gives ordered + equality comparisons for free.

Public functions

auto operator<=>(const CutKey&) const -> auto defaulted

Public variables

int extra
IterationIndex iteration_index
PhaseUid phase_uid
SceneUid scene_uid
CutType type

Variable documentation

int gtopt::CutKey::extra

Sentinel -1 = "no source context was attached at store time" (e.g. cuts constructed outside the SDDP backward path). Round-trips through save/load unchanged so dedup keys stay stable when an unset extra is the actual value rather than uninitialised memory.