diff --git a/docs/src/solutions.md b/docs/src/solutions.md index 5f82e90d594..d2efa4d3f97 100644 --- a/docs/src/solutions.md +++ b/docs/src/solutions.md @@ -95,8 +95,8 @@ The container type (e.g., scalar, vector, or matrix) of the returned solution The objective value of a solved problem can be obtained via [`objective_value`](@ref). The best known bound on the optimal objective -value can be obtained via [`objective_bound`](@ref). If dual values are -available, the value of the dual objective can be obtained via +value can be obtained via [`objective_bound`](@ref). If the solver supports it, +the value of the dual objective can be obtained via [`dual_objective_value`](@ref). The following is a recommended workflow for solving a model and querying the diff --git a/src/objective.jl b/src/objective.jl index e3deb9e4763..31f4a92b9ec 100644 --- a/src/objective.jl +++ b/src/objective.jl @@ -28,7 +28,8 @@ objective_value(model::Model)::Float64 = MOI.get(model, MOI.ObjectiveValue()) dual_objective_value(model::Model) Return the value of the objective of the dual problem after a call to -`optimize!(model)`. +`optimize!(model)`. Throws `MOI.UnsupportedAttribute{MOI.DualObjectiveValue}` if +the solver does not support this attribute. """ dual_objective_value(model::Model)::Float64 = MOI.get(model, MOI.DualObjectiveValue())