This page describes macros and functions related to linear and quadratic objective functions only, unless otherwise indicated. For nonlinear objective functions, see Nonlinear Modeling.

Use the @objective macro to set linear and quadratic objective functions in a JuMP model. The functions set_objective_sense and set_objective_function provide an equivalent lower-level interface.

To update a term in the objective function, see set_objective_coefficient.

To query the objective function from a model, see objective_sense, objective_function, and objective_function_type.

To query the optimal objective value or best known bound after a solve, see objective_value and objective_bound. These two functions apply to nonlinear objectives also. The optimal value of the dual objective can be obtained via dual_objective_value.