Extensions
A technical manual for extension packages natively hosted by InfiniteOpt
. See the respective guide for more information.
InfiniteInterpolations
Enabled via import InfiniteOpt, Interpolations
.
JuMP.value
— MethodJuMP.value(vref::GeneralVariableRef,
method::Interpolations.InterpolationType);
[kwargs...])
Extend JuMP.value
to return vref
as an interpolation object from Interpolations.jl, based on method
which specifies the interpolation method. Currently supported method(s) are:
linear_interpolation
constant_interpolation
cubic_spline_interpolation
All methods support equidistant grid points. However, irregular grid points can only be used with linear_interpolation
and constant_interpolation
.
JuMP.value(vref::GeneralVariableRef, degree::Interpolations.Degree; kwargs...)
Extend JuMP.value
to return vref
as an interpolation object from Interpolations.jl, based on degree
which specifies the degree of interpolation. The currently supported degrees are:
Linear()
Constant()
Cubic()
All methods support equidistant grid points. However, irregular grid points can only be used with Linear()
and Constant()
.
Examples
julia> zFunc = value(z, cubic_spline_interpolation)
julia> zFunc(5.4);
42.0
julia> zFunc2 = value(z, Cubic())
julia> zFunc2(5.4)
42.0
InfiniteMathOptAI
Enabled via import InfiniteOpt, MathOptAI
.
MathOptAI.add_variables
— Functionfunction MathOptAI.add_variables(
model::InfiniteModel, x::Vector{GeneralVariableRef},
n::Int,
base_name::String,
)::Vector{GeneralVariableRef}
Extend MathOptAI.add_variables
to properly support infinite variables (i.e., ensure the output variables of a predictor have the necessary infinite parameter dependencies). This method should not be directly used by users, it is used to enable the use of MathOptAI.add_predictor
.