From 18a32f955c85a8ce996baa39157f247cc48d25bc Mon Sep 17 00:00:00 2001 From: tmigot Date: Fri, 5 Apr 2024 13:52:04 +0200 Subject: [PATCH 1/2] Update documentation of `solve!` --- src/method.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/method.jl b/src/method.jl index 8281ba5..7797fba 100644 --- a/src/method.jl +++ b/src/method.jl @@ -75,6 +75,10 @@ For advanced usage, first define a `PercivalSolver` to preallocate the memory us solver = PercivalSolver(nlp) solve!(solver, nlp) + stats = GenericExecutionStats(nlp) + solver = PercivalSolver(nlp) + solve!(solver, nlp, stats) + # Arguments - `nlp::AbstractNLPModel{T, V}` is the model to solve, see `NLPModels.jl`. @@ -132,10 +136,11 @@ stats = percival(nlp) "Execution stats: first-order stationary" ``` ```jldoctest -using Percival, ADNLPModels +using Percival, ADNLPModels, SolverCore nlp = ADNLPModel(x -> sum(x.^2), ones(3), x -> [x[1]], zeros(1), zeros(1)) +stats = GenericExecutionStats(nlp) solver = PercivalSolver(nlp) -stats = solve!(solver, nlp) +stats = solve!(solver, nlp, stats) # output From 0ee182aa2bb6ea00247f8a394752522618f164c9 Mon Sep 17 00:00:00 2001 From: tmigot Date: Fri, 5 Apr 2024 16:35:41 +0200 Subject: [PATCH 2/2] remove unused line in solve! tests --- test/allocs.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/allocs.jl b/test/allocs.jl index 69d0d8c..5e0f3de 100644 --- a/test/allocs.jl +++ b/test/allocs.jl @@ -62,7 +62,6 @@ if v"1.7" <= VERSION end solver = PercivalSolver(nlp) - x = copy(nlp.meta.x0) stats = GenericExecutionStats(nlp) SolverCore.solve!(solver, nlp, stats) reset!(solver)