Skip to content

Commit cfad387

Browse files
committed
add NLS solvers
1 parent 685cd0e commit cfad387

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

src/ARCTR.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ end
2727

2828
include("main.jl")
2929

30-
export ALL_solvers
30+
include("solvers.jl")
3131

32-
ALL_solvers = Symbol[]
32+
export ALL_solvers, NLS_solvers
3333

34-
include("solvers.jl")
34+
ALL_solvers = keys(solvers_const)
35+
NLS_solvers = keys(solvers_nls_const)
3536

3637
export TRARC
3738

@@ -89,10 +90,9 @@ function TRARC(nlp::AbstractNLPModel{T,S}; kwargs...) where {T,S}
8990
return stopping_to_stats(nlpstop)
9091
end
9192

92-
for fun in keys(solvers_const)
93-
push!(ALL_solvers, fun)
93+
for fun in union(keys(solvers_const), keys(solvers_nls_const))
9494

95-
ht, pt, sm, ka = ARCTR.solvers_const[fun]
95+
ht, pt, sm, ka = merge(solvers_const, solvers_nls_const)[fun]
9696
@eval begin
9797
function $fun(nlpstop::NLPStopping; kwargs...)
9898
kw_list = Dict{Symbol,Any}()

src/solvers.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,13 @@ const solvers_const = Dict(
3030
:TRKOp => (HessOp, PDataTRK, solve_modelTRK, ()),
3131
:TRKsparse => (HessSparse, PDataTRK, solve_modelTRK, ()),
3232
)
33+
34+
const solvers_nls_const = Dict(
35+
:ARCqKOpGN => (
36+
HessGaussNewtonOp,
37+
PDataKARC,
38+
solve_modelKARC,
39+
[:shifts => 10.0 .^ (collect(-10.0:0.5:20.0))],
40+
),
41+
:ST_TROpGN => (HessGaussNewtonOp, PDataST, solve_modelST_TR, ()),
42+
)

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ using ADNLPModels, NLPModels, OptimizationProblems.ADNLPProblems, SolverTest
88
using Stopping
99

1010
@testset "Testing NLP solvers" begin
11-
@testset "$name" for name in keys(ARCTR.solvers_const)
11+
@testset "$name" for name in ALL_solvers
1212
solver = eval(name)
1313
unconstrained_nlp(solver)
1414
multiprecision_nlp(solver, :unc)
1515
end
1616
end
1717

1818
@testset "Testing NLS solvers" begin
19-
@testset "$name" for name in keys(ARCTR.solvers_const)
19+
@testset "$name" for name in union(ALL_solvers, NLS_solvers)
2020
solver = eval(name)
2121
unconstrained_nls(solver)
2222
multiprecision_nls(solver, :unc)

0 commit comments

Comments
 (0)