89
89
90
90
@testset " NEWUOA" begin
91
91
println (" \n NEWUOA:" )
92
- kwds = (rhobeg = 1.0 , rhoend = 1e-3 , ftarget = - Inf ,
93
- maxfun = 200 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
92
+ kwds = (rhobeg = 1.0 , rhoend = 1e-6 , ftarget = - Inf ,
93
+ maxfun = 500 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
94
94
x, info = @inferred PRIMA. newuoa (f, x0; kwds... )
95
95
print_1 (x, info)
96
96
@test issuccess (info)
@@ -102,34 +102,34 @@ end
102
102
@test x1 == x
103
103
@test info1 == info
104
104
# Solve problem with scaling factors.
105
- kwds = (scale, rhobeg = 1.0 / scl, rhoend = 1e-3 / scl, ftarget = - Inf ,
106
- maxfun = 200 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
105
+ kwds = (scale, rhobeg = 1.0 / scl, rhoend = 1e-6 / scl, ftarget = - Inf ,
106
+ maxfun = 500 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
107
107
x1, info1 = @inferred PRIMA. newuoa (f, x0; kwds... )
108
108
@test x1 ≈ x
109
109
end
110
110
111
111
@testset " UOBYQA" begin
112
112
println (" \n UOBYQA:" )
113
- kwds = (rhobeg = 1.0 , rhoend = 1e-3 , ftarget = - Inf ,
114
- maxfun = 200 n , iprint = PRIMA. MSG_EXIT)
113
+ kwds = (rhobeg = 1.0 , rhoend = 1e-6 , ftarget = - Inf ,
114
+ maxfun = 500 n , iprint = PRIMA. MSG_EXIT)
115
115
x, info = @inferred PRIMA. uobyqa (f, x0; kwds... )
116
116
print_1 (x, info)
117
117
@test issuccess (info)
118
118
@test x ≈ [3 ,2 ] atol= 2e-2 rtol= 0
119
119
@test f (x) ≈ info. fx
120
120
@test x0 == x0_sav
121
121
# Solve problem with scaling factors.
122
- kwds = (scale, rhobeg = 1.0 / scl, rhoend = 1e-3 / scl, ftarget = - Inf ,
123
- maxfun = 200 n , iprint = PRIMA. MSG_EXIT)
122
+ kwds = (scale, rhobeg = 1.0 / scl, rhoend = 1e-6 / scl, ftarget = - Inf ,
123
+ maxfun = 500 n , iprint = PRIMA. MSG_EXIT)
124
124
x1, info1 = @inferred PRIMA. uobyqa (f, x0; kwds... )
125
125
@test x1 ≈ x
126
126
end
127
127
128
128
@testset " BOBYQA" begin
129
129
println (" \n BOBYQA:" )
130
130
kwds = (xl = xl, xu = xu,
131
- rhobeg = 1.0 , rhoend = 1e-3 , ftarget = - Inf ,
132
- maxfun = 200 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
131
+ rhobeg = 1.0 , rhoend = 1e-6 , ftarget = - Inf ,
132
+ maxfun = 500 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
133
133
x, info = @inferred PRIMA. bobyqa (f, x0; kwds... )
134
134
print_1 (x, info)
135
135
@test issuccess (info)
@@ -142,17 +142,17 @@ end
142
142
@test x1 == x
143
143
@test info1 == info
144
144
# Solve problem with scaling factors.
145
- kwds = (scale, rhobeg = 1.0 / scl, rhoend = 1e-3 / scl, ftarget = - Inf ,
146
- maxfun = 200 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
145
+ kwds = (scale, rhobeg = 1.0 / scl, rhoend = 1e-6 / scl, ftarget = - Inf ,
146
+ maxfun = 500 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
147
147
x1, info1 = @inferred PRIMA. bobyqa (f, x0; kwds... )
148
148
@test x1 ≈ x
149
149
end
150
150
151
151
@testset " COBYLA" begin
152
152
println (" \n COBYLA:" )
153
153
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
154
- rhobeg = 1.0 , rhoend = 1e-3 , ftarget = - Inf ,
155
- maxfun = 200 * n , iprint = PRIMA. MSG_EXIT)
154
+ rhobeg = 1.0 , rhoend = 1e-6 , ftarget = - Inf ,
155
+ maxfun = 500 n , iprint = PRIMA. MSG_EXIT)
156
156
# First call with just the number of non-linear inequality constraints.
157
157
x, info = @inferred PRIMA. cobyla (f, x0; kwds... ,
158
158
nonlinear_ineq = c_ineq)
174
174
@test info1 == info
175
175
# Solve problem with scaling factors.
176
176
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
177
- scale, rhobeg = 1.0 / scl, rhoend = 1e-3 / scl, ftarget = - Inf ,
178
- maxfun = 200 n , iprint = PRIMA. MSG_EXIT)
177
+ scale, rhobeg = 1.0 / scl, rhoend = 1e-6 / scl, ftarget = - Inf ,
178
+ maxfun = 500 n , iprint = PRIMA. MSG_EXIT)
179
179
x1, info1 = @inferred PRIMA. cobyla (f, x0; kwds... ,
180
180
nonlinear_ineq = c_ineq)
181
181
@test x1 ≈ x
184
184
@testset " LINCOA" begin
185
185
println (" \n LINCOA:" )
186
186
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
187
- rhobeg = 1.0 , rhoend = 1e-3 , ftarget = - Inf ,
188
- maxfun = 200 * n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
187
+ rhobeg = 1.0 , rhoend = 1e-6 , ftarget = - Inf ,
188
+ maxfun = 500 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
189
189
x, info = @inferred PRIMA. lincoa (f, x0; kwds... )
190
190
print_2 (x, info)
191
191
@test issuccess (info)
199
199
@test info1 == info
200
200
# Solve problem with scaling factors.
201
201
kwds = (xl = xl, xu = xu, linear_ineq = (A_ineq, b_ineq),
202
- scale, rhobeg = 1.0 / scl, rhoend = 1e-3 / scl, ftarget = - Inf ,
203
- maxfun = 200 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
202
+ scale, rhobeg = 1.0 / scl, rhoend = 1e-6 / scl, ftarget = - Inf ,
203
+ maxfun = 500 n , npt = 2 n + 1 , iprint = PRIMA. MSG_EXIT)
204
204
x1, info1 = @inferred PRIMA. lincoa (f, x0; kwds... )
205
205
@test x1 ≈ x
206
206
end
0 commit comments