FlatHelper class
#include <gtopt/flat_helper.hpp>
Converts scenario/stage/block indexed data into flat vectors for saving.
This helper class transforms hierarchical optimization data (organized by scenarios, stages and blocks) into flat vectors suitable for data saving as in parquet files. It handles:
- Active element filtering (only processes active scenarios/stages/blocks)
- Value projection and scaling during flattening
- Generation of validity markers for sparse problems
- Multiple index holder types (GSTB, STB, ST, T)
Key Features:
- Efficient constexpr accessors for active elements
- Thread-safe operations (all methods are const)
- Support for custom projection and scaling
- Detailed error checking during construction
- Move semantics for efficient data transfer
Typical Usage:
- Construct with active element indices
- Call flat() with indexed data holders
- Use returned vectors in LP matrix construction