ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_optimization::isFailedMinPowell Interface Reference

Generate and return .true. if and only if the algorithm fails to find the minimum value and the corresponding abscissa xmin(1:ndim) of the input arbitrary (ndim) dimensional-support function isolated to a fractional precision of about tol using the Powell unconstrained derivative-free minimization method.
More...

Detailed Description

Generate and return .true. if and only if the algorithm fails to find the minimum value and the corresponding abscissa xmin(1:ndim) of the input arbitrary (ndim) dimensional-support function isolated to a fractional precision of about tol using the Powell unconstrained derivative-free minimization method.

Parameters
[in]getFunc: The scalar function be minimized.
  1. On input, it must take a vector of size ndim of the same type and kind as the input/output argument xmin.
  2. On output, it must return a scalar of the same type and kind as the input/output argument xmin, containing the function value at the specified input vector point.
The following demonstrates the interface of getFunc,
function getFunc(x) result(func)
real(RKG), intent(in) :: x(ndim)
real(RKG) :: func
end function
where RKG can refer to any real type kind parameter any supported by the processor (e.g., RK, RK32, RK64, or RK128) supported by the library.
[in,out]xmin: The input/output vector of size ndim of type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128).
  1. On input, it must contain the initial best guess abscissa at the function minimum.
  2. On output, it will contain the inferred abscissa at the function minimum, if the algorithm succeeds.
[in,out]fmin: The input/output scalar of the same type and kind as the input/output argument xmin.
  1. On input, it must contain getFunc(xmin).
  2. On output, it will contain the function value at the identified minimum abscissa xmin.
(optional, default = getFunc(xmin))
[in]tol: The input positive scalar of the same type and kind as the input/output argument xmin, containing the minimum distance that a new function evaluation point xmin can have from any previously evaluated point.
Values smaller than the suggestion below might lead to algorithm failure due to roundoff error accumulation.
(optional, default = sqrt(epsilon(1._RKG))).
[in]niter: The input positive scalar of type integer of default kind IK containing the maximum number of allowed iterations at every step of the algorithm in search of a univariate minimum along a specific direction.
(optional, default = int(100 * precision(xmin) / 53.).)
Returns
failed : The output scalar of type logical of default kind LK that is .true. if and only if the algorithm fails to find the minimum of the function, otherwise it is .false. indicating convergence to the minimum.


Possible calling interfaces

use pm_kind, only: LK
logical(LK) :: failed
failed = isFailedMinPowell(getFunc, xmin(1:ndim), fmin = fmin, tol = tol, niter = niter)
Generate and return .true. if and only if the algorithm fails to find the minimum value and the corre...
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
This module contains procedures, generic interfaces, and types for numerical optimizations of mathema...
Warning
The condition fmin == getFunc(xmin) must hold for the corresponding input arguments.
The condition 0 < niter must hold for the corresponding input arguments.
The condition 0 < tol must hold for the corresponding input arguments.
Remarks
The procedures under discussion are impure.
The procedures under discussion are recursive.
See also
getMinBrent
setMinBrent
isFailedMinPowell
setMinPowell


Example usage

1program example
2
3 use pm_kind, only: SK, IK, LK
4 use pm_kind, only: RKG => RKH ! all processor kinds are supported.
5 use pm_io, only: display_type
7 use pm_arrayFill, only: getFilled
8
9 implicit none
10
11 integer(IK), parameter :: ndim = 4
12 real(RKG) :: xmin(ndim), fmin
13 type(display_type) :: disp
14 disp = display_type(file = "main.out.F90")
15
16 call disp%skip()
17 call disp%show("getSq(x) = sum(x - [real(RKG) :: 1, 2, 3, 4])**2)")
18 call disp%show("xmin = getFilled(0., ndim)")
19 xmin = getFilled(0., ndim)
20 call disp%show("if (isFailedMinPowell(getSq, xmin)) error stop 'minimization failed.'")
21 if (isFailedMinPowell(getSq, xmin)) error stop 'minimization failed.'
22 call disp%show("xmin")
23 call disp%show( xmin )
24 call disp%skip()
25
26 call disp%skip()
27 call disp%show("getSq(x) = (x - [real(RKG) :: 1, 2, 3, 4])**2")
28 call disp%show("xmin = getFilled(0., ndim); fmin = getSq(xmin)")
29 xmin = getFilled(0., ndim); fmin = getSq(xmin)
30 call disp%show("if (isFailedMinPowell(getSq, xmin, fmin, tol = epsilon(xmin)**.8, niter = 100)) error stop 'minimization failed.'")
31 if (isFailedMinPowell(getSq, xmin, fmin, tol = epsilon(xmin)**.8, niter = 100)) error stop 'minimization failed.'
32 call disp%show("[xmin, fmin]")
33 call disp%show( [xmin, fmin] )
34 call disp%skip()
35
36contains
37
38 function getSq(x) result(func)
39 real(RKG) , intent(in) :: x(ndim)
40 real(RKG) :: func
41 integer(IK) :: idim
42 func = sum((x - [real(RKG) :: (idim, idim = 1, ndim)])**2)
43 end function
44
45end program example
Generate and return an array of the specified rank and shape of arbitrary intrinsic type and kind wit...
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
This module contains procedures and generic interfaces for convenient allocation and filling of array...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RKH
The scalar integer constant of intrinsic default kind, representing the highest-precision real kind t...
Definition: pm_kind.F90:858
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2getSq(x) = sum(x - [real(RKG) :: 1, 2, 3, 4])**2)
3xmin = getFilled(0., ndim)
4if (isFailedMinPowell(getSq, xmin)) error stop 'minimization failed.'
5xmin
6+1.00000000000000000000000000000000000, +2.00000000000000000000000000000000000, +3.00000000000000000000000000000000077, +4.00000000000000000000000000000000000
7
8
9getSq(x) = (x - [real(RKG) :: 1, 2, 3, 4])**2
10xmin = getFilled(0., ndim); fmin = getSq(xmin)
11if (isFailedMinPowell(getSq, xmin, fmin, tol = epsilon(xmin)**.8, niter = 100)) error stop 'minimization failed.'
12[xmin, fmin]
13+1.00000000000000000000000000000000000, +2.00000000000000000000000000000000000, +3.00000000000000000000000000000000077, +4.00000000000000000000000000000000000, +0.593472984109987421717077641847622322E-66
14
15
Test:
test_pm_optimization


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, Tuesday March 7, 2017, 3:50 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 1089 of file pm_optimization.F90.


The documentation for this interface was generated from the following file: