Skip to content

Commit 34f54df

Browse files
authored
Revise the default maxfun to 500*n and default rhoend to 1.0e-6*rhobeg
This aligns with Powell's settings in his tests and the default settings of the Fortran code. Anyway, `maxfun = 100*n` is too small for a DFO solver.
1 parent 2c756f3 commit 34f54df

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/PRIMA.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ const LinearConstraints = Tuple{AbstractMatrix{<:Real},AbstractVector{<:Real}}
8585

8686
# Default settings.
8787
default_npt(x::AbstractVector{<:Real}) = 2*length(x) + 1
88-
default_maxfun(x::AbstractVector{<:Real}) = 100*length(x)
88+
const default_maxfun_dim_relative = 500
89+
default_maxfun(x::AbstractVector{<:Real}) = default_maxfun_dim_relative * length(x)
8990
const default_scale = nothing
9091
const default_rhobeg = 1.0
91-
const default_rhoend_relative = 1e-4
92+
const default_rhoend_relative = 1e-6
9293
default_rhoend(rhobeg::Real) = default_rhoend_relative*rhobeg
9394

9495
# The high level wrappers. First the methods, then their documentation.
@@ -138,7 +139,7 @@ Allowed keywords are (`n = length(x)` is the number of variables):
138139
algorithm is stopped as soon as `f(x) ≤ ftarget` and the status
139140
`PRIMA.FTARGET_ACHIEVED` is returned.
140141
141-
- `maxfun` (default `100n`) is the maximum number of function evaluations
142+
- `maxfun` (default `$default_maxfun_dim_relative *n`) is the maximum number of function evaluations
142143
allowed for the algorithm. If the number of calls to `f(x)` exceeds this
143144
value, the algorithm is stopped and the status `PRIMA.MAXFUN_REACHED` is
144145
returned.

0 commit comments

Comments
 (0)