14 use,
intrinsic :: iso_fortran_env, only : int32, real64
19 use linalg,
only : rank1_update, tri_mtx_mult, cholesky_rank1_update, &
20 cholesky_rank1_downdate, solve_cholesky, la_matrix_format_error
35 real(real64),
allocatable,
dimension(:,:) :: m_simplex
38 real(real64) :: m_initsize = 1.0d0
133 procedure,
public :: solve => nm_solve
144 procedure,
public :: get_simplex => nm_get_simplex
162 procedure,
public :: set_simplex => nm_set_simplex
175 procedure,
public :: get_initial_size => nm_get_size
192 procedure,
public :: set_initial_size => nm_set_size
213 procedure,
private :: extrapolate => nm_extrapolate
218 module subroutine nm_solve(this, fcn, x, fout, ib, err)
219 class(nelder_mead),
intent(inout) :: this
221 real(real64),
intent(inout),
dimension(:) :: x
222 real(real64),
intent(out),
optional :: fout
224 class(errors),
intent(inout),
optional,
target :: err
227 module function nm_extrapolate(this, fcn, y, pcent, ihi, fac, neval, &
229 class(nelder_mead),
intent(inout) :: this
231 real(real64),
intent(inout),
dimension(:) :: y, pcent
232 integer(int32),
intent(in) :: ihi
233 real(real64),
intent(in) :: fac
234 integer(int32),
intent(inout) :: neval
235 real(real64),
intent(out),
dimension(:) :: work
239 pure module function nm_get_simplex(this) result(p)
240 class(nelder_mead),
intent(in) :: this
241 real(real64),
allocatable,
dimension(:,:) :: p
244 module subroutine nm_set_simplex(this, x)
245 class(nelder_mead),
intent(inout) :: this
246 real(real64),
dimension(:,:) :: x
249 pure module function nm_get_size(this) result(x)
250 class(nelder_mead),
intent(in) :: this
254 module subroutine nm_set_size(this, x)
255 class(nelder_mead),
intent(inout) :: this
256 real(real64),
intent(in) :: x
271 logical :: m_uselinesearch = .true.
273 real(real64) :: m_xtol = 1.0d-12
284 procedure,
public :: get_line_search => lso_get_line_search
294 procedure,
public :: set_line_search => lso_set_line_search
304 procedure,
public :: set_default_line_search => lso_set_default
314 procedure,
public :: is_line_search_defined => &
315 lso_is_line_search_defined
325 procedure,
public :: get_use_line_search => lso_get_use_search
335 procedure,
public :: set_use_line_search => lso_set_use_search
345 procedure,
public :: get_var_tolerance => lso_get_var_tol
355 procedure,
public :: set_var_tolerance => lso_set_var_tol
360 module subroutine lso_get_line_search(this, ls)
361 class(line_search_optimizer),
intent(in) :: this
365 module subroutine lso_set_line_search(this, ls)
366 class(line_search_optimizer),
intent(inout) :: this
370 module subroutine lso_set_default(this)
371 class(line_search_optimizer),
intent(inout) :: this
375 pure module function lso_is_line_search_defined(this) result(x)
376 class(line_search_optimizer),
intent(in) :: this
380 pure module function lso_get_use_search(this) result(x)
381 class(line_search_optimizer),
intent(in) :: this
385 module subroutine lso_set_use_search(this, x)
386 class(line_search_optimizer),
intent(inout) :: this
387 logical,
intent(in) :: x
390 pure module function lso_get_var_tol(this) result(x)
391 class(line_search_optimizer),
intent(in) :: this
395 module subroutine lso_set_var_tol(this, x)
396 class(line_search_optimizer),
intent(inout) :: this
397 real(real64),
intent(in) :: x
404 type,
extends(line_search_optimizer) :: bfgs
488 procedure,
public :: solve => bfgs_solve
493 module subroutine bfgs_solve(this, fcn, x, fout, ib, err)
494 class(bfgs),
intent(inout) :: this
496 real(real64),
intent(inout),
dimension(:) :: x
497 real(real64),
intent(out),
optional :: fout
499 class(errors),
intent(inout),
optional,
target :: err
A base class for optimization of an equation of multiple variables.
Defines a type capable of encapsulating an equation of N variables.
Defines a set of parameters that describe the behavior of the iteration process.
Defines a type capable of performing an inexact, backtracking line search to find a point as far alon...
Defines a Broyden–Fletcher–Goldfarb–Shanno (BFGS) solver for minimization of functions of multiple va...
A class describing equation optimizers that use a line search algorithm to improve convergence behavi...
Defines a solver based upon Nelder and Mead's simplex algorithm for minimization of functions of mult...