Skip to content

Commit 22ab387

Browse files
🤖 Format .jl files (#222)
Co-authored-by: tmigot <[email protected]>
1 parent aa4b467 commit 22ab387

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

test/test_linesearch.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ function test_armijo_wolfe(::Type{S}) where {S}
5757
@test nbk > 0
5858
@test nbW == 0
5959

60-
nlp = ADNLPModel(x -> (x[1] - 1)^2 + 4 * (x[2] - x[1]^2)^2, fill!(S(undef, 2), 0), matrix_free = true)
60+
nlp =
61+
ADNLPModel(x -> (x[1] - 1)^2 + 4 * (x[2] - x[1]^2)^2, fill!(S(undef, 2), 0), matrix_free = true)
6162
d = S([1.7; 3.2])
6263
lm = LineModel(nlp, nlp.meta.x0, d)
6364
t, good_grad, ft, nbk, nbW = armijo_wolfe(lm, obj(lm, t0), grad(lm, t0), g)
@@ -104,14 +105,8 @@ function test_armijo_goldstein2(::Type{S}) where {S}
104105
@test nbk == 4
105106
@test nbG == 10
106107

107-
t, ft, nbk, nbG = armijo_goldstein(
108-
lm,
109-
obj(lm, t0),
110-
grad(lm, t0);
111-
t = T(0.001),
112-
τ₀ = T(0.1),
113-
τ₁ = T(0.2),
114-
)
108+
t, ft, nbk, nbG =
109+
armijo_goldstein(lm, obj(lm, t0), grad(lm, t0); t = T(0.001), τ₀ = T(0.1), τ₁ = T(0.2))
115110
@test t < 1.0
116111
@test nbk == 2
117112
@test nbG == 10

test/test_trust_region.jl

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,34 @@ end
5454
@testset "Trust Region" begin
5555
S = Vector{Float64}
5656
@testset "aredpred-$(nlp.meta.name) - $S - $TRSolver" for nlp in (
57-
ADNLPModel(x -> x[1]^2 + 4 * x[2]^2, fill!(S(undef, 2), 1), name = "NLP", matrix_free = true),
58-
ADNLSModel(x -> [x[1]; 2 * x[2]], fill!(S(undef, 2), 1), 2, name = "NLS", matrix_free = true),
59-
), TRSolver in (TrustRegion, TRONTrustRegion)
57+
ADNLPModel(x -> x[1]^2 + 4 * x[2]^2, fill!(S(undef, 2), 1), name = "NLP", matrix_free = true),
58+
ADNLSModel(x -> [x[1]; 2 * x[2]], fill!(S(undef, 2), 1), 2, name = "NLS", matrix_free = true),
59+
),
60+
TRSolver in (TrustRegion, TRONTrustRegion)
61+
6062
test_aredpred(nlp, TRSolver, S)
6163
end
6264

6365
if CUDA.functional()
6466
CUDA.allowscalar() do
6567
S = CuVector{Float64}
6668
@testset "aredpred-$(nlp.meta.name) - $S - $TRSolver" for nlp in (
67-
ADNLPModel(x -> x[1]^2 + 4 * x[2]^2, fill!(S(undef, 2), 1), name = "NLP", matrix_free = true),
68-
ADNLSModel(x -> [x[1]; 2 * x[2]], fill!(S(undef, 2), 1), 2, name = "NLS", matrix_free = true),
69-
), TRSolver in (TrustRegion, TRONTrustRegion)
69+
ADNLPModel(
70+
x -> x[1]^2 + 4 * x[2]^2,
71+
fill!(S(undef, 2), 1),
72+
name = "NLP",
73+
matrix_free = true,
74+
),
75+
ADNLSModel(
76+
x -> [x[1]; 2 * x[2]],
77+
fill!(S(undef, 2), 1),
78+
2,
79+
name = "NLS",
80+
matrix_free = true,
81+
),
82+
),
83+
TRSolver in (TrustRegion, TRONTrustRegion)
84+
7085
test_aredpred(nlp, TRSolver, S)
7186
end
7287
end

0 commit comments

Comments
 (0)