Skip to content

Commit 4912814

Browse files
MaxenceGollierdpo
authored andcommitted
update callback docstring
1 parent 45c8478 commit 4912814

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/LM_alg.jl

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,7 @@ The algorithm stops either when `√(ξₖ/νₖ) < atol + rtol*√(ξ₀/ν₀)
138138
The value returned is a `GenericExecutionStats`, see `SolverCore.jl`.
139139
140140
# Callback
141-
The callback is called at each iteration.
142-
The expected signature of the callback is `callback(nlp, solver, stats)`, and its output is ignored.
143-
Changing any of the input arguments will affect the subsequent iterations.
144-
In particular, setting `stats.status = :user` will stop the algorithm.
145-
All relevant information should be available in `nlp` and `solver`.
146-
Notably, you can access, and modify, the following:
147-
- `solver.xk`: current iterate;
148-
- `solver.∇fk`: current gradient;
149-
- `stats`: structure holding the output of the algorithm (`GenericExecutionStats`), which contains, among other things:
150-
- `stats.iter`: current iteration counter;
151-
- `stats.objective`: current objective function value;
152-
- `stats.solver_specific[:smooth_obj]`: current value of the smooth part of the objective function;
153-
- `stats.solver_specific[:nonsmooth_obj]`: current value of the nonsmooth part of the objective function;
154-
- `stats.status`: current status of the algorithm. Should be `:unknown` unless the algorithm has attained a stopping criterion. Changing this to anything other than `:unknown` will stop the algorithm, but you should use `:user` to properly indicate the intention;
155-
- `stats.elapsed_time`: elapsed time in seconds.
141+
$(callback_docstring)
156142
"""
157143
function LM(nls::AbstractNLSModel, h::H, options::ROSolverOptions; kwargs...) where {H}
158144
kwargs_dict = Dict(kwargs...)

0 commit comments

Comments
 (0)