template<typename ObjectType ObjectType>
gtopt::ObjectLP class

Wrapper class that adds LP capabilities to objects.

Template parameters
ObjectType The type of object being wrapped

This class maintains the original object while adding functionality needed for linear programming, such as activity tracking across stages.

Base classes

class ObjectUtils
Provides common utility methods for objects in the optimization framework.

Derived classes

template<typename Object Object>
struct CapacityObjectLP
A linear programming representation of an object with capacity constraints.
template<typename Object Object>
struct CapacityObjectLP
A linear programming representation of an object with capacity constraints.
template<typename Object Object>
struct CapacityObjectLP
A linear programming representation of an object with capacity constraints.
template<typename Object Object>
struct CapacityObjectLP
A linear programming representation of an object with capacity constraints.
template<typename Object Object>
struct CapacityObjectLP
A linear programming representation of an object with capacity constraints.
template<typename ProfileType ProfileType, typename ElementLPType ElementLPType>
class ProfileObjectLP
Base class for profile-based LP objects.
template<typename ProfileType ProfileType, typename ElementLPType ElementLPType>
class ProfileObjectLP
Base class for profile-based LP objects.

Public types

using object_type = ObjectType
Type of the wrapped object.

Public functions

template<typename Self Self>
auto class_name(this const Self& self) -> constexpr auto noexcept
auto id() const -> constexpr auto noexcept
template<typename StageLP StageLP>
auto is_active(const StageLP& stage) const -> constexpr bool
Checks if object is active in given stage.
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto lp_label(this const Self& self, SystemContext& sc, const StageLP& stage, Args && ... args) -> constexpr auto
auto object() && -> constexpr ObjectType&& noexcept
auto object() & -> constexpr ObjectType& noexcept
Gets the wrapped object.
auto object() const && -> constexpr const ObjectType&& noexcept
auto object() const & -> constexpr const ObjectType& noexcept
template<typename OT OT>
auto ObjectLP(OT&& pobject) -> constexpr explicit noexcept
Constructs an ObjectLP by moving in an object.
template<typename OT OT>
auto ObjectLP(OT&& pobject, const InputContext& ic, const LPClassName cname) -> constexpr explicit
template<typename OT OT>
auto ObjectLP(OT&& pobject, const InputContext& ic, std::string_view cname) -> constexpr explicit
auto set_id(Uid uid, Name name) -> constexpr auto& noexcept
Sets the object's identifier.
template<typename Self Self>
auto short_name(this const Self& self) -> constexpr auto noexcept
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args) -> constexpr auto
Generates a label for a variable in the optimization problem.
template<typename Self Self, typename SystemContext SystemContext, typename... Args>
auto state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args) -> constexpr auto
template<typename Self Self, typename ScenarioLP ScenarioLP, typename StageLP StageLP>
auto sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) -> constexpr auto noexcept
Generates a state variable key for the object.
template<typename Self Self, typename StageLP StageLP>
auto sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) -> constexpr auto noexcept
auto uid() const -> constexpr auto noexcept

Function documentation

template<typename ObjectType ObjectType>
constexpr auto gtopt::ObjectLP<ObjectType>::id() const noexcept

Returns The object's complete identifier (uid + name)

template<typename ObjectType ObjectType> template<typename StageLP StageLP>
constexpr bool gtopt::ObjectLP<ObjectType>::is_active(const StageLP& stage) const

Checks if object is active in given stage.

Parameters
stage The stage to check
Returns true if active in stage, false otherwise

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args)

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::lp_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args)

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args)

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::lp_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args)

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::lp_label(this const Self& self, SystemContext& sc, const StageLP& stage, Args && ... args)

template<typename ObjectType ObjectType>
constexpr ObjectType& gtopt::ObjectLP<ObjectType>::object() & noexcept

Gets the wrapped object.

Returns Reference to the wrapped object

template<typename ObjectType ObjectType> template<typename OT OT>
constexpr gtopt::ObjectLP<ObjectType>::ObjectLP(OT&& pobject) explicit noexcept

Constructs an ObjectLP by moving in an object.

Parameters
pobject The object to wrap and manage

template<typename ObjectType ObjectType>
constexpr auto& gtopt::ObjectLP<ObjectType>::set_id(Uid uid, Name name) noexcept

Sets the object's identifier.

Parameters
uid Unique identifier
name Human-readable name
Returns Reference to self for chaining

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, Args && ... args)

Generates a label for a variable in the optimization problem.

Parameters
self Reference to the object
sc System context
scenario Scenario context
stage Stage context
args Additional arguments to include in the label
Returns Label string

template<typename ObjectType ObjectType> template<typename Self Self, typename SystemContext SystemContext, typename... Args>
constexpr auto gtopt::ObjectLP<ObjectType>::state_col_label(this const Self& self, SystemContext& sc, const ScenarioLP& scenario, const StageLP& stage, const BlockLP& block, Args && ... args)

template<typename ObjectType ObjectType> template<typename Self Self, typename ScenarioLP ScenarioLP, typename StageLP StageLP>
constexpr auto gtopt::ObjectLP<ObjectType>::sv_key(this const Self& self, const ScenarioLP& scenario, const StageLP& stage, std::string_view col_name) noexcept

Generates a state variable key for the object.

Parameters
self Reference to the object
scenario Scenario context
stage Stage context
col_name The column name for the state variable
Returns StateVariable::Key

template<typename ObjectType ObjectType> template<typename Self Self, typename StageLP StageLP>
constexpr auto gtopt::ObjectLP<ObjectType>::sv_key(this const Self& self, const StageLP& stage, std::string_view col_name) noexcept

template<typename ObjectType ObjectType>
constexpr auto gtopt::ObjectLP<ObjectType>::uid() const noexcept

Returns The object's unique identifier