From 64a97cf43009cdf8449e278b5d90bddef7f74b50 Mon Sep 17 00:00:00 2001 From: joaquimg Date: Thu, 26 Sep 2024 19:26:19 -0700 Subject: [PATCH] Document is_parameter in the manual (besides api ref) --- docs/src/manual/variables.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/src/manual/variables.md b/docs/src/manual/variables.md index 9c488ad4d0e..0753668e0cd 100644 --- a/docs/src/manual/variables.md +++ b/docs/src/manual/variables.md @@ -1355,6 +1355,20 @@ julia> parameter_value.(p) 3.0 ``` +Use [`is_parameter`](@ref) and [`ParameterRef`](@ref) to check if the variable +is a parameter and to get the constraint that makes the variable a parameter. + +```jldoctest nonlinear_parameters +julia> is_parameter(p[1]) +true + +julia> is_parameter(x) +false + +julia> ParameterRef(p[2]) +p[2] ∈ MathOptInterface.Parameter{Float64}(3.0) +``` + ### Limitations Parameters are implemented as decision variables belonging to the [`Parameter`](@ref)