Skip to content

Commit e7559cf

Browse files
add tests for augmented lagrangian
1 parent dfa059f commit e7559cf

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843"
2020

2121
[compat]
2222
Arpack = "0.5"
23+
CUTEst = "1.3.4"
2324
LinearOperators = "2.10.0"
2425
ManualNLPModels = "0.2.0"
2526
NLPModels = "0.19, 0.20, 0.21"
@@ -32,10 +33,11 @@ SolverCore = "0.3.0"
3233
julia = "^1.6.0"
3334

3435
[extras]
36+
CUTEst = "1b53aba6-35b6-5f92-a507-53c67d53f819"
3537
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3638
RegularizedProblems = "ea076b23-609f-44d2-bb12-a4ae45328278"
3739
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3840
TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04"
3941

4042
[targets]
41-
test = ["Random", "RegularizedProblems", "Test", "TestSetExtensions"]
43+
test = ["CUTEst", "Random", "RegularizedProblems", "Test", "TestSetExtensions"]

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using LinearAlgebra: length
22
using LinearAlgebra, Random, Test
33
using ProximalOperators
4-
using NLPModels, NLPModelsModifiers, RegularizedProblems, RegularizedOptimization, SolverCore
4+
using CUTEst, NLPModels, NLPModelsModifiers, RegularizedProblems, RegularizedOptimization, SolverCore
55

66
const global compound = 1
77
const global nz = 10 * compound
@@ -10,6 +10,8 @@ const global bpdn, bpdn_nls, sol = bpdn_model(compound)
1010
const global bpdn2, bpdn_nls2, sol2 = bpdn_model(compound, bounds = true)
1111
const global λ = norm(grad(bpdn, zeros(bpdn.meta.nvar)), Inf) / 10
1212

13+
include("test_AL.jl")
14+
1315
for (mod, mod_name) ((x -> x, "exact"), (LSR1Model, "lsr1"), (LBFGSModel, "lbfgs"))
1416
for (h, h_name) ((NormL0(λ), "l0"), (NormL1(λ), "l1"), (IndBallL0(10 * compound), "B0"))
1517
for solver_sym (:R2, :TR)

test/test_allocs.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,12 @@ end
6565
@test stats.status == :first_order
6666
end
6767
end
68+
@testset "Augmented Lagrangian" begin
69+
reg_nlp = RegularizedNLPModel(CUTEstModel("HS8"), h)
70+
solver = ALSolver(reg_nlp)
71+
stats = RegularizedExecutionStats(reg_nlp)
72+
@test @wrappedallocs(solve!(solver, reg_nlp, stats, atol = 1e-3)) == 0
73+
@test stats.status == :first_order
74+
end
6875
end
6976
end

0 commit comments

Comments
 (0)