Skip to content
Merged
Changes from 1 commit
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
19 changes: 6 additions & 13 deletions tutorials/introduction-to-solverbenchmark/index.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,12 @@ If a solver's `GenericExecutionStats` contains a `solver_specific` dictionary, t

Here is an example showing how to set a solver-specific flag so that it appears as a column in the resulting stats table and can be used for tabulation:
Comment thread
arnavk23 marked this conversation as resolved.
```julia
using NLPModelsTest, DataFrames, SolverCore, SolverBenchmark
using ADNLPModels, SolverCore

function newton(nlp)
stats = GenericExecutionStats(nlp)
set_solver_specific!(stats, :isConvex, true)
return stats
end

solvers = Dict(:newton => newton)
problems = [NLPModelsTest.BROWNDEN()]
stats = bmark_solvers(solvers, problems)
nlp = ADNLPModel(x -> sum(x .^ 2), [1.0, 1.0])
stats = GenericExecutionStats(nlp)
set_solver_specific!(stats, :isConvex, true)
set_solver_specific!(stats, :inner_iterations, 7)
Comment thread
arnavk23 marked this conversation as resolved.
Outdated

# Access the solver-specific column `:isConvex` for the `:newton` solver
df_newton = stats[:newton]
df_newton.isConvex
stats.solver_specific
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
```