Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update runtests.jl to use maxfun = 500n and rhoend = 1e-6 instead of maxfun = 200n and rhoend = 1e-3 #26

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ end

@testset "NEWUOA" begin
println("\nNEWUOA:")
kwds = (rhobeg = 1.0, rhoend = 1e-3, ftarget = -Inf,
maxfun = 200n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
kwds = (rhobeg = 1.0, rhoend = 1e-6, ftarget = -Inf,
maxfun = 500n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
x, info = @inferred PRIMA.newuoa(f, x0; kwds...)
print_1(x, info)
@test issuccess(info)
Expand All @@ -102,34 +102,34 @@ end
@test x1 == x
@test info1 == info
# Solve problem with scaling factors.
kwds = (scale, rhobeg = 1.0/scl, rhoend = 1e-3/scl, ftarget = -Inf,
maxfun = 200n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
kwds = (scale, rhobeg = 1.0/scl, rhoend = 1e-6/scl, ftarget = -Inf,
maxfun = 500n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
x1, info1 = @inferred PRIMA.newuoa(f, x0; kwds...)
@test x1 ≈ x
end

@testset "UOBYQA" begin
println("\nUOBYQA:")
kwds = (rhobeg = 1.0, rhoend = 1e-3, ftarget = -Inf,
maxfun = 200n, iprint = PRIMA.MSG_EXIT)
kwds = (rhobeg = 1.0, rhoend = 1e-6, ftarget = -Inf,
maxfun = 500n, iprint = PRIMA.MSG_EXIT)
x, info = @inferred PRIMA.uobyqa(f, x0; kwds...)
print_1(x, info)
@test issuccess(info)
@test x ≈ [3,2] atol=2e-2 rtol=0
@test f(x) ≈ info.fx
@test x0 == x0_sav
# Solve problem with scaling factors.
kwds = (scale, rhobeg = 1.0/scl, rhoend = 1e-3/scl, ftarget = -Inf,
maxfun = 200n, iprint = PRIMA.MSG_EXIT)
kwds = (scale, rhobeg = 1.0/scl, rhoend = 1e-6/scl, ftarget = -Inf,
maxfun = 500n, iprint = PRIMA.MSG_EXIT)
x1, info1 = @inferred PRIMA.uobyqa(f, x0; kwds...)
@test x1 ≈ x
end

@testset "BOBYQA" begin
println("\nBOBYQA:")
kwds = (xl = xl, xu = xu,
rhobeg = 1.0, rhoend = 1e-3, ftarget = -Inf,
maxfun = 200n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
rhobeg = 1.0, rhoend = 1e-6, ftarget = -Inf,
maxfun = 500n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
x, info = @inferred PRIMA.bobyqa(f, x0; kwds...)
print_1(x, info)
@test issuccess(info)
Expand All @@ -142,17 +142,17 @@ end
@test x1 == x
@test info1 == info
# Solve problem with scaling factors.
kwds = (scale, rhobeg = 1.0/scl, rhoend = 1e-3/scl, ftarget = -Inf,
maxfun = 200n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
kwds = (scale, rhobeg = 1.0/scl, rhoend = 1e-6/scl, ftarget = -Inf,
maxfun = 500n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
x1, info1 = @inferred PRIMA.bobyqa(f, x0; kwds...)
@test x1 ≈ x
end

@testset "COBYLA" begin
println("\nCOBYLA:")
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
rhobeg = 1.0, rhoend = 1e-3, ftarget = -Inf,
maxfun = 200*n, iprint = PRIMA.MSG_EXIT)
rhobeg = 1.0, rhoend = 1e-6, ftarget = -Inf,
maxfun = 500n, iprint = PRIMA.MSG_EXIT)
# First call with just the number of non-linear inequality constraints.
x, info = @inferred PRIMA.cobyla(f, x0; kwds...,
nonlinear_ineq = c_ineq)
Expand All @@ -174,8 +174,8 @@ end
@test info1 == info
# Solve problem with scaling factors.
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
scale, rhobeg = 1.0/scl, rhoend = 1e-3/scl, ftarget = -Inf,
maxfun = 200n, iprint = PRIMA.MSG_EXIT)
scale, rhobeg = 1.0/scl, rhoend = 1e-6/scl, ftarget = -Inf,
maxfun = 500n, iprint = PRIMA.MSG_EXIT)
x1, info1 = @inferred PRIMA.cobyla(f, x0; kwds...,
nonlinear_ineq = c_ineq)
@test x1 ≈ x
Expand All @@ -184,8 +184,8 @@ end
@testset "LINCOA" begin
println("\nLINCOA:")
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
rhobeg = 1.0, rhoend = 1e-3, ftarget = -Inf,
maxfun = 200*n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
rhobeg = 1.0, rhoend = 1e-6, ftarget = -Inf,
maxfun = 500n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
x, info = @inferred PRIMA.lincoa(f, x0; kwds...)
print_2(x, info)
@test issuccess(info)
Expand All @@ -199,8 +199,8 @@ end
@test info1 == info
# Solve problem with scaling factors.
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
scale, rhobeg = 1.0/scl, rhoend = 1e-3/scl, ftarget = -Inf,
maxfun = 200n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
scale, rhobeg = 1.0/scl, rhoend = 1e-6/scl, ftarget = -Inf,
maxfun = 500n, npt = 2n + 1, iprint = PRIMA.MSG_EXIT)
x1, info1 = @inferred PRIMA.lincoa(f, x0; kwds...)
@test x1 ≈ x
end
Expand Down
Loading