ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_mathRootTest.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
42
43!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
46
47 use pm_val2str, only: getStr
48 use pm_option, only: getOption
49 use pm_kind, only: SK, IK, LK, RKH
50 use pm_str, only: getTTZ => getTrimmedTZ
51
52 implicit none
53
54 character(*, SK), parameter :: MODULE_NAME = "@pm_mathRootTest"
55
56!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57
85 type, abstract :: func_type
86 real(RKH) :: lb
87 real(RKH) :: ub
88 real(RKH) , allocatable :: root(:)
89 character(:, SK), allocatable :: desc
90 contains
91 procedure(get_proc) , deferred :: get
92 end type
93
94 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95
107 abstract interface
108 PURE function get_proc(self, x) result(func)
109 use pm_kind, only: RKG => RKH
110 import :: func_type
111 class(func_type) , intent(in) :: self
112 real(RKG) , intent(in) :: x
113 real(RKG) :: func
114 end function
115 end interface
116
117!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118
161 type, extends(func_type) :: func1_type
162 contains
163 procedure :: get => getFunc1
164 end type
165
167 interface func1_type
168 PURE module function func1_typer(lb, ub) result(self)
169#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
170 !DEC$ ATTRIBUTES DLLEXPORT :: func1_typer
171#endif
172 use pm_kind, only: RKG => RKH
173 real(RKG), intent(in), optional :: lb, ub
174 type(func1_type) :: self
175 end function
176 end interface
178
179!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
180
181 interface
182 PURE module function getFunc1(self, x) result(func)
183#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
184 !DEC$ ATTRIBUTES DLLEXPORT :: getFunc1
185#endif
186 use pm_kind, only: RKG => RKH
187 class(func1_type) , intent(in) :: self
188 real(RKG) , intent(in) :: x
189 real(RKG) :: func
190 end function
191 end interface
192
193!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194
195end module pm_mathRootTest
This is the abstract interface of the get() type-bound procedure of func_type class whose arguments o...
Generate and return the value of the optional input argument if it is present, otherwise,...
Definition: pm_option.F90:135
Generate and return a vector of single-characters each element of which corresponds to one character ...
Definition: pm_str.F90:1449
Generate and return the conversion of the input value to an output Fortran string,...
Definition: pm_val2str.F90:167
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
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
This module contains a collection of example functions for testing or examining the root-finding rout...
character(*, SK), parameter MODULE_NAME
This module contains procedures, generic interfaces, and types for generating default values for opti...
Definition: pm_option.F90:34
This module contains classes and procedures for various string manipulations and inquiries.
Definition: pm_str.F90:49
This module contains the generic procedures for converting values of different types and kinds to For...
Definition: pm_val2str.F90:58
This is the derived type for generating test function objects of the algebraic form as described belo...
This is the base type func_type standing abstract function type to generate a variety of function tes...