You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/AL_alg.jl
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,21 @@ If adopted, the Hessian is accessed as an abstract operator and need not be the
120
120
# Output
121
121
122
122
- `stats::GenericExecutionStats`: solution and other info, see `SolverCore.jl`.
123
+
124
+
# Callback
125
+
The callback is called at each iteration.
126
+
The expected signature of the callback is `callback(nlp, solver, stats)`, and its output is ignored.
127
+
Changing any of the input arguments will affect the subsequent iterations.
128
+
In particular, setting `stats.status = :user` will stop the algorithm.
129
+
All relevant information should be available in `reg_nlp` and `solver`.
130
+
Notably, you can access, and modify, the following:
131
+
- `solver.x`: current iterate;
132
+
- `solver.y`: current dual estimate;
133
+
- `stats`: structure holding the output of the algorithm (`GenericExecutionStats`), which contains, among other things:
134
+
- `stats.iter`: current iteration counter;
135
+
- `stats.objective`: current objective function value;
136
+
- `stats.status`: current status of the algorithm. Should be `:unknown` unless the algorithm has attained a stopping criterion. Changing this to anything will stop the algorithm, but you should use `:user` to properly indicate the intention;
137
+
- `stats.elapsed_time`: elapsed time in seconds.
123
138
"""
124
139
mutable struct ALSolver{T, V, M, ST} <:AbstractOptimizationSolver
0 commit comments