Reference
Dualization.supported_constraints
— Functionsupported_constraints(con_types::Vector{Tuple{Type, Type}})
Returns true
if Function-in-Set
is supported for Dualization and throws an error if it is not.
supported_constraints(F::MOI.AbstractFunction, S::MOI.AbstractSet)
Returns true
if Function-in-Set
is supported for Dualization and false
if it is not.
Dualization.supported_objective
— Functionsupported_objective(primal_model::MOI.ModelLike)
Returns true
if MOI.ObjectiveFunctionType()
is supported for Dualization and throws an error if it is not.
supported_objective(obj_func_type::Type)
Returns true
if obj_func_type
is supported for Dualization and throws an error if it is not.
Dualization.DualNames
— TypeDualNames
DualNames is a struct to pass the prefix of dual variables and dual constraints names.
See more on naming the variables.
Dualization.PrimalVariableData
— TypePrimalVariableData{T}
Data structure used in PrimalDualMap
to hold information about primal variables and their dual counterparts.
primal_constrained_variable_constraint::Union{Nothing,MOI.ConstraintIndex}
: if primal variable is chosen to be a constrained variable by Dualization.jl, then this value is different from nothing.primal_constrained_variable_index::Int
: if variable is a scalar constrained variable then it is 0. If variable is not a constrained variable then it is -1. If variable is part of a vector constrained variable, then this is the position in that vector.dual_constraint::Union{Nothing,MOI.ConstraintIndex}
: dual constraint associated with the variable. If the variable is not constrained then the set is EqualTo{T}(zero(T)). If the variable is a constrained variable then the set is the dual set of the constrained variable set. If the dual set isReals
then the field is kept asnothing
as teh constraint is not added.dual_function::Union{Nothing,MOI.ScalarAffineFunction{T}}
: if the constrained variable isVectorOfVariables
-in-Zeros
orVariableIndex
-in-EqualTo(zero(T))
then the dual isfunc
-in-Reals
, which is "irrelevant" to the model. But this information is cached for completeness of theDualOptimizer
forget
tingConstraintDuals
.
To got from the constrained variable constraint to the primal variable, use the primal_constrained_variables
field of PrimalDualMap
.
See also PrimalDualMap
and PrimalConstraintData
.
Dualization.PrimalConstraintData
— TypePrimalConstraintData{T}
Data structure used in PrimalDualMap
to hold information about primal constraints and their dual counterparts.
Constraint indices for constrained variables are not in this structure. They are added in the primal_constrained_variables
field of PrimalDualMap
.
primal_set_constants::Vector{T}
: a vector of primal set constants that are used in MOI getters. This is used to get the primal constants of the primal constraints.dual_variables::Vector{MOI.VariableIndex}
: vector of dual variables. If primal constraint is scalar then, the vector has length = 1.dual_constrained_variable_constraint::Union{Nothing,MOI.ConstraintIndex}
: if primal set isEqualTo
orZeros
, then the dual constraint isReals
then the dual variable is free (no constraint in the dual model).
Dualization.PrimalDualMap
— TypePrimalDualMap{T}
Maps information from all structures of the primal to the dual model.
Main maps:
primal_variable_data::Dict{MOI.VariableIndex,Dualization.PrimalVariableData{T}}
: maps primal variable indices to their data. The data is a structure that contains information about the primal variable and its dual counterpart. In particular, it contains the primal constrained variable constraint index, the primal constrained variable index, the dual constraint index and the primal function for the case of constraints that are not added in the dual.primal_constraint_data::Dict{MOI.ConstraintIndex,Dualization.PrimalConstraintData{T}}
: maps primal constraint indices to their data. The data is a structure that contains information about the primal constraint and its dual counterpart. In particular, it contains the primal set constants, the dual variables and the dual constrained variable constraint index.primal_constrained_variables::Dict{MOI.ConstraintIndex,Vector{MOI.VariableIndex}}
: maps primal constrained variable constraint indices to their primal constrained variables.
Addtional maps
primal_parameter_to_dual_parameter::Dict{MOI.VariableIndex,MOI.VariableIndex}
: maps parameters in the primal model to parameters in the dual model.primal_var_in_quad_obj_to_dual_slack_var::Dict{MOI.VariableIndex,MOI.VariableIndex}
: maps primal variables (that appear in quadratic objective terms) to dual "slack" variables. These primal variables might appear in other maps.