gtopt/cost_helper.hpp file

Cost calculation and discounting utilities for optimization problems.

This module provides the CostHelper class and supporting utilities for:

  • Calculating time-discounted costs across scenarios, stages and blocks
  • Applying probability factors to scenario costs
  • Generating cost scaling factors for LP formulation
  • Managing cumulative discount factors across the optimization horizon

Key Features:

  • Handles multi-period discounting with stage-specific rates
  • Supports scenario probability weighting
  • Provides both individual cost calculations and batch factor generation
  • Constexpr and noexcept where possible for performance
  • Thread-safe operations (all methods are const)

Namespaces

namespace gtopt
namespace gtopt::detail

Classes

class gtopt::CostHelper
Handles cost calculations with time discounting for optimization problems.