From f605c55947422e9f5008c42dc4c8f7e42f454d4c Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 9 Oct 2023 14:01:26 +0000 Subject: [PATCH] build based on 37382c7 --- previews/PR135/Examples/benders/index.html | 2 +- previews/PR135/Examples/example/index.html | 2 +- previews/PR135/Examples/markowitz/index.html | 2 +- previews/PR135/index.html | 2 +- previews/PR135/manual/index.html | 2 +- previews/PR135/reference/index.html | 8 ++++---- previews/PR135/search/index.html | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/previews/PR135/Examples/benders/index.html b/previews/PR135/Examples/benders/index.html index aab81633..2b04e479 100644 --- a/previews/PR135/Examples/benders/index.html +++ b/previews/PR135/Examples/benders/index.html @@ -203,4 +203,4 @@ return best_sol[1] end

Run benders decomposition with POI

β2 = decomposed_model(; print_timer_outputs = false);
 GC.gc()
-β2 = decomposed_model();
+β2 = decomposed_model(); diff --git a/previews/PR135/Examples/example/index.html b/previews/PR135/Examples/example/index.html index 7bad3a9d..a90dd848 100644 --- a/previews/PR135/Examples/example/index.html +++ b/previews/PR135/Examples/example/index.html @@ -186,4 +186,4 @@ @variable(model, z in POI.Parameter(10)) MOI.set(model, POI.ConstraintsInterpretation(), POI.ONLY_BOUNDS) @constraint(model, x >= z) -@NLobjective(model, Min, x^2)

This use case should help users diminsh the time of making model modifications and re-solve the model. To increase the performance users that are familiar with JuMP direct mode can also use it.

+@NLobjective(model, Min, x^2)

This use case should help users diminsh the time of making model modifications and re-solve the model. To increase the performance users that are familiar with JuMP direct mode can also use it.

diff --git a/previews/PR135/Examples/markowitz/index.html b/previews/PR135/Examples/markowitz/index.html index 84ba39b2..769573c9 100644 --- a/previews/PR135/Examples/markowitz/index.html +++ b/previews/PR135/Examples/markowitz/index.html @@ -62,4 +62,4 @@ end

Plot the efficient frontier

portfolios_values = sort(portfolios_values,by=x->x[1])
 portfolios_values_matrix = hcat([[v[1],v[2]] for v in values(portfolios_values)]...)'
 plot(portfolios_values_matrix[:,2],portfolios_values_matrix[:,1],legend=false,
-xlabel="Standard Deviation", ylabel = "Return", title = "Efficient Frontier")
+xlabel="Standard Deviation", ylabel = "Return", title = "Efficient Frontier") diff --git a/previews/PR135/index.html b/previews/PR135/index.html index a367b288..f8c4fb1c 100644 --- a/previews/PR135/index.html +++ b/previews/PR135/index.html @@ -1,2 +1,2 @@ -Home · ParametricOptInterface.jl
+Home · ParametricOptInterface.jl
diff --git a/previews/PR135/manual/index.html b/previews/PR135/manual/index.html index b55ac139..335ee625 100644 --- a/previews/PR135/manual/index.html +++ b/previews/PR135/manual/index.html @@ -4,4 +4,4 @@ const POI = ParametricOptInterface const MOI = MathOptInterface # Define a Optimizer on top of the MOI optimizer -optimizer = POI.Optimizer(HiGHS.Optimizer())

Parameters

A ParametricOptInterface.Parameter is a variable with a fixed value that can be changed by the user.

Adding a new parameter to a model

To add a parameter to a model, we must use the MOI.add_constrained_variable() function, passing as its arguments the model and a ParametricOptInterface.Parameter with its given value:

y, cy = MOI.add_constrained_variable(optimizer, POI.Parameter(0))

Changing the parameter value

To change a given parameter's value, access its VariableIndex and set it to the new value using the ParametricOptInterface.Parameter structure.

MOI.set(optimizer, POI.ParameterValue(), y, POI.Parameter(2.0))

Retrieving the dual of a parameter

Given an optimized model, one can compute the dual associated to a parameter, as long as it is an additive term in the constraints or objective. One can do so by getting the MOI.ConstraintDual attribute of the parameter's MOI.ConstraintIndex:

MOI.get(optimizer, POI.ParameterDual(), y)
+optimizer = POI.Optimizer(HiGHS.Optimizer())

Parameters

A ParametricOptInterface.Parameter is a variable with a fixed value that can be changed by the user.

Adding a new parameter to a model

To add a parameter to a model, we must use the MOI.add_constrained_variable() function, passing as its arguments the model and a ParametricOptInterface.Parameter with its given value:

y, cy = MOI.add_constrained_variable(optimizer, POI.Parameter(0))

Changing the parameter value

To change a given parameter's value, access its VariableIndex and set it to the new value using the ParametricOptInterface.Parameter structure.

MOI.set(optimizer, POI.ParameterValue(), y, POI.Parameter(2.0))

Retrieving the dual of a parameter

Given an optimized model, one can compute the dual associated to a parameter, as long as it is an additive term in the constraints or objective. One can do so by getting the MOI.ConstraintDual attribute of the parameter's MOI.ConstraintIndex:

MOI.get(optimizer, POI.ParameterDual(), y)
diff --git a/previews/PR135/reference/index.html b/previews/PR135/reference/index.html index 64be972f..966752c9 100644 --- a/previews/PR135/reference/index.html +++ b/previews/PR135/reference/index.html @@ -1,7 +1,7 @@ Reference · ParametricOptInterface.jl

Reference

ParametricOptInterface.ConstraintsInterpretationType
ConstraintsInterpretation <: MOI.AbstractOptimizerAttribute

Attribute to define how POI.Optimizer should interpret constraints.

  • POI.ONLY_CONSTRAINTS: Only interpret ScalarAffineFunction constraints as linear constraints If an expression such as x >= p1 + p2 appears it will be trated like a new constraint. This is the default behaviour of POI.Optimizer

  • POI.ONLY_BOUNDS: Only interpret ScalarAffineFunction constraints as a variable bound. This is valid for constraints such as x >= p or x >= p1 + p2. If a constraint x1 + x2 >= p appears, which is not a valid variable bound it will throw an error.

  • POI.BOUNDS_AND_CONSTRAINTS: Interpret ScalarAffineFunction constraints as a variable bound if they are a valid variable bound, i.e., x >= p or x >= p1 + p2 and interpret them as linear constraints otherwise.

Example

MOI.set(model, POI.InterpretConstraintsAsBounds(), POI.ONLY_BOUNDS)
 MOI.set(model, POI.InterpretConstraintsAsBounds(), POI.ONLY_CONSTRAINTS)
-MOI.set(model, POI.InterpretConstraintsAsBounds(), POI.BOUNDS_AND_CONSTRAINTS)
source
ParametricOptInterface.OptimizerType
Optimizer{T, OT <: MOI.ModelLike} <: MOI.AbstractOptimizer

Declares a Optimizer, which allows the handling of parameters in a optimization model.

Keyword arguments

  • evaluate_duals::Bool: If true, evaluates the dual of parameters. Users might want to set it to false to increase performance when the duals of parameters are not necessary. Defaults to true.

  • save_original_objective_and_constraints: If true saves the orginal function and set of the constraints as well as the original objective function inside POI.Optimizer. This is useful for printing the model but greatly increases the memory footprint. Users might want to set it to false to increase performance in applications where you don't need to query the original expressions provided to the model in constraints or in the objective. Note that this might break printing or queries such as MOI.get(model, MOI.ConstraintFunction(), c). Defaults to true.

Example

julia> ParametricOptInterface.Optimizer(GLPK.Optimizer())
-ParametricOptInterface.Optimizer{Float64,GLPK.Optimizer}
source
ParametricOptInterface.ParameterType
Parameter(val::Float64)

The Parameter structure stores the numerical value associated to a given parameter.

Example

julia> ParametricOptInterface.Parameter(5)
-ParametricOptInterface.Parameter(5)
source
ParametricOptInterface.ParameterValueType
ParameterValue <: MOI.AbstractVariableAttribute

Attribute defined to set and get parameter values

Example

MOI.set(model, POI.ParameterValue(), p, 2.0)
-MOI.get(model, POI.ParameterValue(), p)
source
+MOI.set(model, POI.InterpretConstraintsAsBounds(), POI.BOUNDS_AND_CONSTRAINTS)source
ParametricOptInterface.OptimizerType
Optimizer{T, OT <: MOI.ModelLike} <: MOI.AbstractOptimizer

Declares a Optimizer, which allows the handling of parameters in a optimization model.

Keyword arguments

  • evaluate_duals::Bool: If true, evaluates the dual of parameters. Users might want to set it to false to increase performance when the duals of parameters are not necessary. Defaults to true.

  • save_original_objective_and_constraints: If true saves the orginal function and set of the constraints as well as the original objective function inside POI.Optimizer. This is useful for printing the model but greatly increases the memory footprint. Users might want to set it to false to increase performance in applications where you don't need to query the original expressions provided to the model in constraints or in the objective. Note that this might break printing or queries such as MOI.get(model, MOI.ConstraintFunction(), c). Defaults to true.

Example

julia> ParametricOptInterface.Optimizer(GLPK.Optimizer())
+ParametricOptInterface.Optimizer{Float64,GLPK.Optimizer}
source
ParametricOptInterface.ParameterType
Parameter(val::Float64)

The Parameter structure stores the numerical value associated to a given parameter.

Example

julia> ParametricOptInterface.Parameter(5)
+ParametricOptInterface.Parameter(5)
source
ParametricOptInterface.ParameterDualType
ParameterDual <: MOI.AbstractVariableAttribute

Attribute defined to get the dual values associated to parameters

Example

MOI.get(model, POI.ParameterValue(), p)
source
ParametricOptInterface.ParameterValueType
ParameterValue <: MOI.AbstractVariableAttribute

Attribute defined to set and get parameter values

Example

MOI.set(model, POI.ParameterValue(), p, 2.0)
+MOI.get(model, POI.ParameterValue(), p)
source
diff --git a/previews/PR135/search/index.html b/previews/PR135/search/index.html index 57fb87eb..79742150 100644 --- a/previews/PR135/search/index.html +++ b/previews/PR135/search/index.html @@ -1,2 +1,2 @@ -Search · ParametricOptInterface.jl

Loading search...

    +Search · ParametricOptInterface.jl

    Loading search...