Skip to content

Commit

Permalink
Revise the default maxfun to 500*n and default rhoend to `1.0e-…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
zaikunzhang authored Feb 22, 2024
1 parent 2c756f3 commit 34f54df
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PRIMA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ const LinearConstraints = Tuple{AbstractMatrix{<:Real},AbstractVector{<:Real}}

# Default settings.
default_npt(x::AbstractVector{<:Real}) = 2*length(x) + 1
default_maxfun(x::AbstractVector{<:Real}) = 100*length(x)
const default_maxfun_dim_relative = 500
default_maxfun(x::AbstractVector{<:Real}) = default_maxfun_dim_relative * length(x)
const default_scale = nothing
const default_rhobeg = 1.0
const default_rhoend_relative = 1e-4
const default_rhoend_relative = 1e-6
default_rhoend(rhobeg::Real) = default_rhoend_relative*rhobeg

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

0 comments on commit 34f54df

Please sign in to comment.