Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention solver-dependent callbacks #2602

Merged
merged 2 commits into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/background/should_i_use.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Key reasons to use JuMP include:
- Access to advanced algorithmic techniques
- Efficient _in-memory_ LP re-solves which previously required using
solver-specific and/or low-level C++ libraries.
- Access to solver-independent and solver-dependent [Callbacks](@ref).
- Access to solver-independent and solver-dependent [Callbacks](@ref callbacks_manual).
- Ease of embedding
- JuMP itself is written purely in Julia. Solvers are the only binary
dependencies.
Expand Down
22 changes: 15 additions & 7 deletions docs/src/manual/callbacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ end
DocTestFilters = [r"≤|<=", r"≥|>=", r" == | = ", r" ∈ | in ", r"MathOptInterface|MOI"]
```

# [Callbacks](@id callbacks_manual)
# [Solver-independent Callbacks](@id callbacks_manual)

Many mixed-integer (linear, conic, and nonlinear) programming solvers offer
the ability to modify the solve process. Examples include changing branching
Expand All @@ -25,10 +25,11 @@ callbacks:

## Available solvers

Callback support is limited to a few solvers. This includes
[CPLEX](https://github.com/JuliaOpt/CPLEX.jl),
[GLPK](https://github.com/JuliaOpt/GLPK.jl), and
[Gurobi](https://github.com/JuliaOpt/Gurobi.jl).
Solver-independent callback support is limited to a few solvers. This includes
[CPLEX](https://github.com/jump-dev/CPLEX.jl),
[GLPK](https://github.com/jump-dev/GLPK.jl),
[Gurobi](https://github.com/jump-dev/Gurobi.jl), and
[Xpress](https://github.com/jump-dev/Xpress.jl).

!!! warning
While JuMP provides a solver-independent way of accessing callbacks, you
Expand All @@ -38,11 +39,18 @@ Callback support is limited to a few solvers. This includes
underlying solver's callback documentation to understand details specific to
each solver.

## Things you can and cannot do during callbacks
!!! tip
This page discusses solver-_independent_ callbacks. However, each solver
listed above also provides a solver-_dependent_ callback to provide access
to the full range of solver-specific features. Consult the solver's README
for an example of how to use the solver-dependent callback. This will
require you to understand the C interface of the solver.

## Things you can and cannot do during solver-independent callbacks

There is a very limited range of things you can do during a callback. Only use
the functions and macros explicitly stated in this page of the documentation, or
in the [Callbacks example](/examples/callbacks).
in the [Callbacks tutorial](@ref callbacks_tutorial).

Using any other part of the JuMP API (e.g., adding a constraint with [`@constraint`](@ref)
or modifying a variable bound with [`set_lower_bound`](@ref)) is undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# v.2.0. If a copy of the MPL was not distributed with this file, You can #src
# obtain one at https://mozilla.org/MPL/2.0/. #src

# # Callbacks
# # [Callbacks](@id callbacks_tutorial)

# This example uses the following packages:

Expand Down