SDDPClonePool class
#include <gtopt/sddp_clone_pool.hpp>
Cached LP clone pool for SDDP aperture reuse.
Stores one optional LinearInterface per (scene, phase) slot. Clones are created lazily from the source LP on first access; subsequent accesses reset the clone's bounds and delete cut rows.
Constructors, destructors, conversion operators
- SDDPClonePool() defaulted
Public functions
- auto allocate(Index num_scenes, Index num_phases) -> void
- auto get_or_create(SceneIndex scene, PhaseIndex phase, PlanningLP& planning, std::size_t base_nrows) -> LinearInterface&
- auto get_ptr(SceneIndex scene, PhaseIndex phase, PlanningLP& planning, std::size_t base_nrows) -> LinearInterface*
- Get a pooled clone pointer, or nullptr if pool is not allocated.
- auto is_allocated() const -> bool noexcept
- Whether the pool has been allocated (non-empty).
Function documentation
LinearInterface& gtopt:: SDDPClonePool:: get_or_create(SceneIndex scene,
PhaseIndex phase,
PlanningLP& planning,
std::size_t base_nrows)
| Parameters | |
|---|---|
| scene | Scene index |
| phase | Phase index |
| planning | PlanningLP reference (for source LP access) |
| base_nrows | Number of structural rows (cuts above this are reset) |
| Returns | Reference to the cached clone |
Get or create a cached clone for the given (scene, phase).
On first call for a slot, clones the source LP. On subsequent calls, resets column bounds from the source LP and deletes rows beyond base_nrows.