|
39 | 39 |
|
40 | 40 | prob_min = OptimizationProblem(optf, x0, nothing; lb = lb, ub = ub) |
41 | 41 | sol_min = solve(prob_min, LBFGS(); x_abstol = 0.1) |
42 | | - @test isapprox(sol_min.u, [0.0, 0.0]; atol = 1e-2) |
43 | | - @test isapprox(sol_min.objective, 0.0; atol = 1e-2) |
| 42 | + @test isapprox(sol_min.u, [0.0, 0.0]; atol = 1.0e-2) |
| 43 | + @test isapprox(sol_min.objective, 0.0; atol = 1.0e-2) |
44 | 44 |
|
45 | 45 | prob_max = OptimizationProblem( |
46 | 46 | optf, x0, nothing; lb = lb, ub = ub, sense = OptimizationBase.MaxSense |
47 | 47 | ) |
48 | 48 | sol_max = solve(prob_max, LBFGS(); x_abstol = 0.1) |
49 | | - @test isapprox(sol_max.u, [10.0, 10.0]; atol = 1e-2) |
50 | | - @test isapprox(sol_max.objective, 20.0; atol = 1e-2) |
| 49 | + @test isapprox(sol_max.u, [10.0, 10.0]; atol = 1.0e-2) |
| 50 | + @test isapprox(sol_max.objective, 20.0; atol = 1.0e-2) |
51 | 51 | end |
52 | 52 |
|
53 | 53 | @testset "MaxSense with IPNewton" begin |
|
61 | 61 | optf, x0, nothing; lb = lb, ub = ub, sense = OptimizationBase.MaxSense |
62 | 62 | ) |
63 | 63 | sol_max = solve(prob_max, Optim.IPNewton(); x_abstol = 0.1) |
64 | | - @test isapprox(sol_max.u, [10.0, 10.0]; atol = 1e-2) |
65 | | - @test isapprox(sol_max.objective, 20.0; atol = 1e-2) |
| 64 | + @test isapprox(sol_max.u, [10.0, 10.0]; atol = 1.0e-2) |
| 65 | + @test isapprox(sol_max.objective, 20.0; atol = 1.0e-2) |
66 | 66 | end |
67 | 67 |
|
68 | 68 | rosenbrock(x, p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2 |
|
0 commit comments