Skip to content

Commit 8070c16

Browse files
add tests for augmented lagrangian
1 parent 91ed408 commit 8070c16

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
@@ -18,6 +18,7 @@ SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843"
1818
Arpack = "7d9fca2a-8960-54d3-9f78-7d1dccf2cb97"
1919

2020
[compat]
21+
CUTEst = "1.3.4"
2122
LinearOperators = "2.10.0"
2223
NLPModels = "0.19, 0.20, 0.21"
2324
NLPModelsModifiers = "0.7"
@@ -30,10 +31,11 @@ Arpack = "0.5"
3031
julia = "^1.6.0"
3132

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

3840
[targets]
39-
test = ["Random", "RegularizedProblems", "Test", "TestSetExtensions"]
41+
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
@@ -57,5 +57,12 @@ end
5757
@test stats.status == :first_order
5858
end
5959
end
60+
@testset "Augmented Lagrangian" begin
61+
reg_nlp = RegularizedNLPModel(CUTEstModel("HS8"), h)
62+
solver = ALSolver(reg_nlp)
63+
stats = RegularizedExecutionStats(reg_nlp)
64+
@test @wrappedallocs(solve!(solver, reg_nlp, stats, atol = 1e-3)) == 0
65+
@test stats.status == :first_order
66+
end
6067
end
6168
end

0 commit comments

Comments
 (0)