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.valueMethod
JuMP.value(
    ref::Union{GeneralVariableRef, JuMP.AbstractJuMPScalar, InfOptConstraintRef},
    method::Union{Interpolations.InterpolationType, Interpolations.Degree};
    [kwargs...]
)::Interpolations.Extrapolation

Extend JuMP.value to return ref as an interpolation object from Interpolations.jl, based on method which specifies the interpolation method. Currently supported method(s) are:

  • constant_interpolation or Constant()
  • linear_interpolation or Linear()
  • cubic_spline_interpolation or Cubic()

All methods support equidistant grid points. However, nonequidistant discretization grids are not compatible with cubic splines.

Examples

julia> y_interp_func = value(y, cubic_spline_interpolation)

julia> y_interp_func(5.4);
42.0

julia> y_interp_func2 = value(y, Cubic())

julia> y_interp_func2(5.4)
42.0
source

InfiniteMathOptAI

Enabled via import InfiniteOpt, MathOptAI.

MathOptAI.add_variablesFunction
function 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.

source