Line data Source code
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 :
17 : !> \brief
18 : !> This module contains classes and procedures for computing the roots of
19 : !> one-dimensional continuous mathematical functions using various root-finding methods.<br>
20 : !>
21 : !> \details
22 : !>
23 : !> In mathematics and computing, a **root-finding** algorithm is an algorithm for finding **zeros**, also called **roots**, of continuous functions.<br>
24 : !> A zero of a function \f$f\f$, from the real numbers to real numbers or from the complex numbers to the complex numbers, is a number \f$x\f$ such that \f$f(x) = 0\f$.<br>
25 : !> As, generally, the zeros of a function cannot be computed exactly nor expressed in closed form, root-finding algorithms provide approximations to zeros
26 : !> expressed either as floating-point numbers or as small isolating intervals, or disks for complex roots.<br>
27 : !> Solving an equation \f$f(x) = g(x)\f$ is the same as finding the roots of the function \f$h(x) = f(x) – g(x)\f$.<br>
28 : !> Thus root-finding algorithms allow solving any equation defined by continuous functions.<br>
29 : !> However, most root-finding algorithms do not guarantee that they will find all the roots.<br>
30 : !> If such an algorithm does not find any root, it does not mean that no root exists.<br>
31 : !>
32 : !> Most numerical root-finding methods use **iteration**, producing a sequence of numbers that hopefully converges towards the root as its limit.<br>
33 : !> They require one or more initial guesses of the root as starting values, then each iteration of the algorithm produces a successively more accurate approximation to the root.<br>
34 : !> Since the iteration must be stopped at some point, these methods produce an approximation to the root, not an exact solution.<br>
35 : !>
36 : !> Bracketing methods
37 : !> ==================
38 : !>
39 : !> Bracketing methods determine successively smaller intervals (brackets) that contain a root.<br>
40 : !> When the interval is small enough, then a root has been found.<br>
41 : !> They generally use the intermediate value theorem, which asserts that if a continuous function has values of
42 : !> opposite signs at the end points of an interval, then the function has at least one root in the interval.<br>
43 : !> Therefore, they *require to start with an interval such that the function takes opposite signs at the end points of the interval*.<br>
44 : !> There are [other methods](https://en.wikipedia.org/wiki/Descartes%27_rule_of_signs) for getting information on the number of roots of polynomials in an interval.<br>
45 : !>
46 : !> Bisection method
47 : !> ----------------
48 : !>
49 : !> The Bisection method consists of repeatedly bisecting a pre-specified interval known to contain at least one root.<br>
50 : !> The method selects the subinterval in which the function changes sign, and therefore must contain a root.<br>
51 : !> It is a very simple and robust, but relatively slow root-finding method.<br>
52 : !> As such, it is frequently used to obtain a rough approximation to the solution of a given root-finding problem.<br>
53 : !> The approximate solution is then used as a starting point for more rapidly converging methods.<br>
54 : !>
55 : !> <b>The Bisection Algorithm</b><br>
56 : !> The Bisection method numerically solves the real-valued equation \f$f(x) = 0\f$.<br>
57 : !> The continuous function \f$f\f$ is defined on a search interval \f$[a, b]\f$ with \f$f(a)\f$ and \f$f(b)\f$ having opposite signs.<br>
58 : !> In such a case \f$a\f$ and \f$b\f$ are said to **bracket a root** \f$f\f$ must have at least one root in the search interval \f$(a, b)\f$.<br>
59 : !> At each step, the method divides the interval in two parts (halves) by computing the midpoint \f$c = (a + b) / 2\f$ of the interval and \f$f(c)\f$.<br>
60 : !> If \f$c\f$ is a root then the process has succeeded and stops.<br>
61 : !> Otherwise, there are now only two possibilities:<br>
62 : !> <ol>
63 : !> <li> \f$f(a)\f$ and \f$f(c)\f$ have opposite signs and bracket a root.<br>
64 : !> <li> \f$f(c)\f$ and \f$f(b)\f$ have opposite signs and bracket a root.<br>
65 : !> </ol>
66 : !> If the function has the same sign at the endpoints of an interval, the endpoints may or may not bracket roots of the function.<br>
67 : !> The Bisection method selects the subinterval that is guaranteed to be a bracket as the new interval to be used in the next step.<br>
68 : !> In this way an interval that contains a zero of \f$f\f$ is reduced in width by half at each step.<br>
69 : !> The process is continued until the interval is sufficiently small.<br>
70 : !>
71 : !> \remark
72 : !> The finite precision of computers can cause serious problems for convergence of the Bisection method.<br>
73 : !> As such, the implementations of the method frequently include convergence tests or limits to the number of iterations.<br>
74 : !> Although \f$f\f$ is continuous, the finite precision of computer can preclude a function value ever being zero.<br>
75 : !> Additionally, the difference between the search interval limits cannot be less than the floating point precision of the computer.<br>
76 : !>
77 : !> \note
78 : !> The Bisection method is also known as the **Interval-Halving method**, the **Binary Search method**, or the **Dichotomy method**.
79 : !>
80 : !> False position (regula falsi) method
81 : !> ------------------------------------
82 : !>
83 : !> The False Position method is a root-finding algorithm is a very old method for solving an equation with one unknown.<br>
84 : !> In simple terms, the method is the trial and error technique of using test (*false*) values for the variable and
85 : !> then adjusting the test value according to the outcome.<br>
86 : !> This is sometimes also referred to as *guess and check*.<br>
87 : !> Versions of the method predate the advent of algebra and the use of equations.<br>
88 : !>
89 : !> <b>The False Position Algorithm</b><br>
90 : !>
91 : !> The Regula Falsi method calculates the new solution estimate as the x-intercept of the line segment joining the endpoints of the function on the current bracketing interval of the root.<br>
92 : !> Essentially, the root is being approximated by replacing the actual function by a line segment on the bracketing interval and
93 : !> then using the classical double false position formula on that line segment.<br>
94 : !>
95 : !> \image html pm_mathRoot@false.png width=500
96 : !>
97 : !> Suppose that in the \f$k\f$-th iteration the bracketing interval is \f$(a_k, b_k)\f$ as illustrated above.<br>
98 : !> Construct the line through the points \f$(a_k, f(a_k))\f$ and \f$(b_k, f(b_k))\f$.<br>
99 : !> The equation of the line is given by,<br>
100 : !> \f{equation}{
101 : !> \large
102 : !> y - f(b_k) = \frac{f(b_k) - f(a_k)}{b_k - a_k} (x - b_k) ~.
103 : !> \f}
104 : !> Now choose \f$c_k\f$ to be the x-intercept of this line, that is, the value of \f$x\f$ for which \f$y = 0\f$, and substitute these values to obtain,<br>
105 : !> \f{equation}{
106 : !> \large
107 : !> f(b_k) + \frac{f(b_k) - f(a_k)}{b_k - a_k}(c_k - b_k) = 0 ~.
108 : !> \f}
109 : !> Solving this equation for \f$c_k\f$ yields,<br>
110 : !> \f{equation}{
111 : !> \large
112 : !> c_k = b_k - f(b_k) \frac{b_k - a_k}{f(b_k) - f(a_k)} = \frac{a_k f(b_k) - b_k f(a_k)}{f(b_k) - f(a_k)} ~.
113 : !> \f}
114 : !> The last symmetrical form has a computational advantage;<br>
115 : !> As a solution is approached, \f$a_k\f$ and \f$b_k\f$ will be very close together and nearly always of the same sign.<br>
116 : !> Such a subtraction can lose significant digits.<br>
117 : !> Because \f$f(b_k)\f$ and \f$f(a_k)\f$ are always of opposite sign, the subtraction in the numerator of the improved formula is effectively an addition (as is the subtraction in the denominator).<br>
118 : !> At iteration number \f$k\f$, the number \f$c_k\f$ is calculated as above and then, if \f$f(a_k)\f$ and \f$f(c_k)\f$ have the same sign, set \f$a_k + 1 = c_k\f$ and \f$b_k + 1 = b_k\f$.<br>
119 : !> Otherwise set \f$a_k + 1 = a_k\f$ and \f$b_k + 1 = c_k\f$.<br>
120 : !> This process is repeated until the root is approximated sufficiently well.<br>
121 : !> The above formula is also used in the Secant method.<br>
122 : !> However, the Secant method always retains the last two computed points.<br>
123 : !> Therefore, while the Secant method is slightly faster, it does not preserve the root bracketing and may not converge.<br>
124 : !> The fact that **the Regula Falsi root-finding method always converges** makes it a good choice when speed is needed.<br>
125 : !> However, its rate of convergence can drop below that of the bisection method.<br>
126 : !>
127 : !> <b>The Convergence of the False Position Algorithm</b><br>
128 : !>
129 : !> The convergence rate of the False Position method can be better than the Bisection method but is worse than the Secant method.<br>
130 : !> The method often has a superlinear convergence rate.<br>
131 : !> However, estimation of the exact order of convergence is difficult (e.g., see Numerical Recipes in Fortran by Press et al. 1992 for a discussion).<br>
132 : !>
133 : !> \remark
134 : !> The finite precision of computers can cause problems for convergence of the False Position method.<br>
135 : !> As such, the implementations of the method frequently include convergence tests or limits to the number of iterations.<br>
136 : !> Although \f$f\f$ is continuous, the finite precision of computer can preclude a function value ever being zero.<br>
137 : !> Additionally, the difference between the search interval limits cannot be less than the floating point precision of the computer.<br>
138 : !>
139 : !> Iterative methods
140 : !> =================
141 : !>
142 : !> The Secant method
143 : !> -----------------
144 : !>
145 : !> The Secant method is a root-finding algorithm that uses a succession of roots of secant lines to better approximate a root of a function.<br>
146 : !> The Secant method can be thought of as a finite-difference approximation of the [Newton method](@ref pm_mathRoot).<br>
147 : !> However, the Secant method predates the Newton method by over 3000 years.<br>
148 : !>
149 : !> <b>The Secant Algorithm</b><br>
150 : !> The Secant method is defined by the following recursive relation,<br>
151 : !> \f{eqnarray}{
152 : !> \large
153 : !> x_{n}
154 : !> &=& x_{n-1} - f(x_{n-1}) \frac{x_{n-1} - x_{n-2}} {f(x_{n-1}) - f(x_{n-2})} ~, \\
155 : !> &=& \frac {x_{n-2} f(x_{n-1}) - x_{n-1} f(x_{n-2})} {f(x_{n-1}) - f(x_{n-2})} ~,
156 : !> \f}
157 : !> where the two initial values \f$x_0\f$ and \f$x_1\f$ should be chosen close to the desired zero.<br>
158 : !>
159 : !> \remark
160 : !> Unlike the other iterative root-finding methods such as the [Bisection](@ref pm_mathRoot) or the [Brent](@ref pm_mathRoot) methods,
161 : !> the Secant method does **not** require the initial starting values \f$x_0\f$ and \f$x_1\f$ to bracket the root of the function.
162 : !>
163 : !> <b>Convergence of the Secant Algorithm</b><br>
164 : !> The iterates \f$x_n\f$ of the Secant method converge to a root of a continuous function if the initial values \f$x_0\f$ and \f$x_1\f$ are sufficiently close to the root.<br>
165 : !> The order of convergence is the Golden Ratio \f$\phi = 1.618\f$, so that the limiting error in the root is,<br>
166 : !> \f{equation}{
167 : !> \large
168 : !> \lim_{k\rightarrow+\infty} |\epsilon_{k}| \propto |\epsilon_{k - 1}|^{1.618} ~.
169 : !> \f}
170 : !> The rate of convergence is therefore faster than the [Bisection](@ref pm_mathRoot).<br>
171 : !> In particular, the convergence is **super-linear**, but **sub-quadratic**.<br>
172 : !> This convergence rate only holds under some technical conditions, namely the **function must be twice continuously differentiable and the root in question be simple** (i.e., with multiplicity 1).<br>
173 : !> If the initial values are not close enough to the root, then there is no guarantee that the Secant method converges.<br>
174 : !> There is no general definition of *close enough*, but the criterion has to do with how *wiggly* the function is on the interval \f$[x_0, x_1]\f$.<br>
175 : !> For example, if the function is differentiable on the interval and there is a point where \f$f′(x) = 0\f$ on the interval, then the algorithm may not converge.<br>
176 : !> For functions that are not sufficiently continuous, the algorithm can therefore not be guaranteed to converge: Local behavior might send it off towards infinity.<br>
177 : !>
178 : !> \remark
179 : !> The finite precision of computers can cause problems for convergence of the Secant method.<br>
180 : !> As such, the implementations of the method frequently include convergence tests or limits to the number of iterations.<br>
181 : !> Although \f$f\f$ is continuous, the finite precision of computer can preclude a function value ever being zero.<br>
182 : !> Additionally, the difference between the search interval limits cannot be less than the floating point precision of the computer.<br>
183 : !>
184 : !> The Newton method
185 : !> -----------------
186 : !>
187 : !> The Newton method, also known as the Newton–Raphson method, named after Isaac Newton and Joseph Raphson,
188 : !> is a root-finding algorithm which produces successively better approximations to the roots (or zeroes) of a real-valued function.<br>
189 : !>
190 : !> <b>The Newton Algorithm</b><br>
191 : !>
192 : !> The most basic version of the method starts with,<br>
193 : !> <ol>
194 : !> <li> a single-variable function \f$f(x)\f$ defined for a real variable \f$x\f$,<br>
195 : !> <li> the function derivative \f$f′(x)\f$,<br>
196 : !> <li> an initial guess \f$x_0\f$ for a root of \f$f(x)\f$.<br>
197 : !> </ol>
198 : !> If the function satisfies sufficient assumptions and the initial guess is close, then,<br>
199 : !> \f{equation}{
200 : !> \large
201 : !> x_{1} = x_{0} - \frac{f(x_{0})}{f'(x_{0})} ~,
202 : !> \f}
203 : !> is a better approximation of the root than \f$x_0\f$ (as illustrated below).<br>
204 : !>
205 : !> \image html pm_mathRoot@newton.gif width=500
206 : !>
207 : !> Geometrically, \f$(x_1, 0)\f$ is the intersection of the x-axis and the tangent of the graph of \f$f\f$ at \f$(x_0, f(x_0))\f$.<br>
208 : !> In other words, the improved guess is the unique root of the linear approximation at the initial point.<br>
209 : !> The process is repeated as,<br>
210 : !> \f{equation}{
211 : !> \large
212 : !> x_{n+1} = x_{n} - \frac {f(x_{n})}{f'(x_{n})} ~,
213 : !> \f}
214 : !> until a sufficiently precise value is reached.<br>
215 : !> The Newton method can also be extended to complex functions and to systems of equations.<br>
216 : !>
217 : !> <b>The Convergence of the Newton Algorithm</b><br>
218 : !>
219 : !> The Newton method will usually converge, provided the initial guess is *close enough* to the unknown root of the function and \f$f\prime(x_0) \neq 0\f$.<br>
220 : !> Furthermore, for a root of multiplicity \f$1\f$, the convergence is at least quadratic in a neighborhood of the root.<br>
221 : !> This intuitively means that the number of correct digits roughly doubles in every step.<br>
222 : !> More details can be found in the analysis section below.
223 : !>
224 : !> <b>Practical Considerations for the Newton Algorithm</b><br>
225 : !>
226 : !> The Newton method is a powerful technique.<br>
227 : !> Convergence is generally quadratic.<br>
228 : !> However, there are some difficulties associated with the method.<br>
229 : !> <ul>
230 : !> <li> **The Newton method requires the function derivative.**<br>
231 : !> The Newton method requires that the derivative can be calculated directly.<br>
232 : !> An analytical expression for the derivative may not be easily obtainable or could be expensive to evaluate.<br>
233 : !> In these situations, it may be appropriate to approximate the derivative by using the slope of a line through two nearby points on the function.<br>
234 : !> However, numerical approximation of the derivative degrade the convergence rate and performance to the Secant method which is slower than the Newton method.<br>
235 : !> <li> **The Newton method can fail to converge to the root.**<br>
236 : !> The proof quadratic convergence of the Newton method requires certain assumptions that may not always hold.<br>
237 : !> One should therefore review the assumptions before using the Newton method.<br>
238 : !> For situations where the method fails to converge, it is because the assumptions made in the proof convergence are not met.<br>
239 : !> <li> **The Newton method can overshoot.**<br>
240 : !> If the first derivative is not well behaved in the neighborhood of a particular root, the method may overshoot, and diverge from that root.<br>
241 : !> An example of a function with one root, for which the derivative is not well behaved in the neighborhood of the root, is
242 : !> \f{equation}{
243 : !> \large
244 : !> f(x) = |x|^{a} ~, \quad 0 < a < \frac{1}{2} ~,
245 : !> \f}
246 : !> for which the root will be overshot and the sequence of \f$x\f$ will diverge.<br>
247 : !> For \f$a = 1/2\f$, the root will still be overshot, but the sequence will oscillate between two values.<br>
248 : !> For \f$1/2 < a < 1\f$, the root will still be overshot but the sequence will converge.<br>
249 : !> For \f$a \geq 1\f$ the root will not be overshot at all.<br>
250 : !> In some cases, the Newton method can be stabilized by using successive over-relaxation.<br>
251 : !> <li> **The Newton method can prematurely terminate upon encountering stationary points of the function.**<br>
252 : !> If a stationary point of the function is encountered, the derivative is zero and the method will terminate due to division by zero.<br>
253 : !> <li> **The Newton method can fail due to poor initial starting point for the search.**<br>
254 : !> A large error in the initial estimate can contribute to non-convergence of the algorithm.<br>
255 : !> To overcome this problem one can linearize the function that is being optimized.<br>
256 : !> Good initial estimates lie close to the final globally optimal parameter estimate.<br>
257 : !> </ul>
258 : !>
259 : !> \remark
260 : !> <b>The procedures of this module use a hybrid Newton-Bisection method to resolve the difficulties mentioned above.</b><br>
261 : !> See [this article](https://en.wikipedia.org/wiki/Newton%27s_method#Failure_analysis) for an exhaustive discussion of the failures and remedies.<br>
262 : !>
263 : !> \remark
264 : !> The finite precision of computers can cause problems for convergence of the Newton method.<br>
265 : !> As such, the implementations of the method frequently include convergence tests or limits to the number of iterations.<br>
266 : !> Although \f$f\f$ is continuous, the finite precision of computer can preclude a function value ever being zero.<br>
267 : !> Additionally, the difference between the search interval limits cannot be less than the floating point precision of the computer.<br>
268 : !>
269 : !> The Halley method
270 : !> -----------------
271 : !>
272 : !> In numerical analysis, the Halley method is a root-finding algorithm used for functions of one real variable **with a continuous second derivative**.<br>
273 : !> It is named after its inventor [Edmond Halley](https://en.wikipedia.org/wiki/Edmond_Halley).<br>
274 : !> The algorithm is second in the class of Householder methods, after Newton method.<br>
275 : !> Like the latter, it iteratively produces a sequence of approximations to the root.<br>
276 : !> The **rate of convergence** to the root is **cubic**.<br>
277 : !> The Halley method exactly finds the roots of a linear-over-linear Padé approximation to the function,
278 : !> in contrast to the Newton method or the Secant method which approximate the function linearly,
279 : !> or the Muller method which approximates the function quadratically.<br>
280 : !>
281 : !> <b>The Halley Algorithm</b><br>
282 : !>
283 : !> The Halley method solves the nonlinear equation \f$f(x) = 0\f$.<br>
284 : !> In this case, the function \f$f\f$ has to be a function of one real variable.<br>
285 : !> The method consists of a sequence of iterations:<br>
286 : !> \f{equation}{
287 : !> x_{{n+1}} = x_{n} - \frac{2f(x_{n})f'(x_{n})}{2{[f'(x_{n})]}^{2}-f(x_{n})f''(x_{n})} ~,
288 : !> \f}
289 : !> beginning with an initial guess \f$x_0\f$.<br>
290 : !>
291 : !> <b>The Convergence of the Halley Algorithm</b><br>
292 : !>
293 : !> The Halley method converges **cubically** to the function root.<br>
294 : !> That is, each iteration triples the number of significant digits in the final root.<br>
295 : !> In comparison, two steps of Newton-Raphson quadruple the number of digits in the final root.<br>
296 : !>
297 : !> <b>Practical Considerations for the Halley Algorithm</b><br>
298 : !>
299 : !> The use of the Halley method is sensible only when it is easy to calculate the second derivative of the target function.<br>
300 : !> The basin of convergence of the Halley method is not guaranteed to be larger than that of the Newton method.<br>
301 : !> This means that the Halley method does not necessarily yield faster convergence rates as evidenced by the examples of the generic interfaces of this module.<br>
302 : !> he current implementation of the Halley method in this module resolves over-compensations
303 : !> by the second derivative (leading to wrong search directions) by reverting the search method to a Newton-Raphson step.<br>
304 : !> If the method sends the search out of the initial user-specified bracket of the root, then the algorithm falls back to the bisection method to correct the search.<br>
305 : !>
306 : !> The Schroder method
307 : !> -------------------
308 : !>
309 : !> Similar to the Halley method, the Schroder method solves the nonlinear equation \f$f(x) = 0\f$ using the second derivative.<br>
310 : !> However, unlike the Newton and the Halley methods, the Schroder method is known to work well in the presence of multiple roots.<br>
311 : !> The method consists of a sequence of iterations:<br>
312 : !> \f{equation}{
313 : !> x_{{n+1}} = x_{n} - \frac{f(x_n)}{f'(x_n)} - \frac{[f(x_n)]^2 f''(x_n)}{2[f'(x_n)]^3} ~,
314 : !> \f}
315 : !> beginning with an initial guess \f$x_0\f$.<br>
316 : !> See [Stewart, 1993, G. W. On Infinitely Many Algorithms for Solving Equations](http://drum.lib.umd.edu/handle/1903/577)
317 : !> for the English translation of the original paper of Schroder and the derivation of the above equation on page 13.<br>
318 : !>
319 : !> Hybrid methods
320 : !> ==============
321 : !>
322 : !> The Brent method
323 : !> ----------------
324 : !>
325 : !> The Brent method is a **hybrid** root-finding algorithm combining<br>
326 : !> <ul>
327 : !> <li> the **Bisection method**,<br>
328 : !> <li> the **Secant method**, and<br>
329 : !> <li> the **inverse quadratic interpolation**.<br>
330 : !> </ul>
331 : !> It has the **reliability of the Bisection method** but potentially as fast as some of the less-reliable methods above.<br>
332 : !> The algorithm tries to use the potentially **fast-converging** Secant method or inverse quadratic interpolation if possible.<br>
333 : !> If necessary, it falls back to the more robust Bisection method.<br>
334 : !> The Brent method is due to [Richard Brent](https://en.wikipedia.org/wiki/Richard_P._Brent) and builds on an earlier algorithm by [Theodorus Dekker](https://en.wikipedia.org/wiki/Theodorus_Dekker).<br>
335 : !>
336 : !> The Quadratic method employed in the Brent method works well only when the function behaves smoothly.<br>
337 : !> However, they run the serious risk of giving very bad estimates of the root or causing machine failure by an inappropriate division by a very small number.<br>
338 : !> The Brent method guards against this problem by maintaining the search brackets on the root and checking where the interpolation would land before carrying out divisions.<br>
339 : !> When the corrections due to the Quadratic method would not land within the search bounds, or when the bounds are not collapsing rapidly enough, the algorithm takes a bisection step.<br>
340 : !> Thus, **the Brent method combines the sureness of the Bisection method with the speed of a higher-order method when appropriate**.<br>
341 : !>
342 : !> \remark
343 : !> The brent algorithm implemented in this module is a reimplementation of the original [FORTRAN77 Brent method from the NetLib library](https://netlib.org/go/zeroin.f)
344 : !> combined with improvements inspired by the [Numerical Recipes in Fortran, Press et al. 1991](http://numerical.recipes/).<br>
345 : !>
346 : !> \note
347 : !> The algorithm is also known as the **Van Wijngaarden–Dekker–Brent root-finding method** or the **Brent–Dekker root-finding method**.<br>
348 : !>
349 : !> \remark
350 : !> The finite precision of computers can cause problems for convergence of the Brent method.<br>
351 : !> As such, the implementations of the method frequently include convergence tests or limits to the number of iterations.<br>
352 : !> Although \f$f\f$ is continuous, the finite precision of computer can preclude a function value ever being zero.<br>
353 : !> Additionally, the difference between the search interval limits cannot be less than the floating point precision of the computer.<br>
354 : !>
355 : !> The Ridders method
356 : !> ------------------
357 : !>
358 : !> The Ridders method is a root-finding algorithm based on the False-Position method
359 : !> and the use of an exponential function to successively approximate a root of a continuous function.<br>
360 : !> The method is due to C. Ridders.<br>
361 : !>
362 : !> <b>The Ridders Algorithm</b><br>
363 : !>
364 : !> Given two values of the independent variable, \f$x_0 < \mathrm{root} < x_2\f$, the method begins by evaluating the function at the midpoint \f$x_1 = (x_0 + x_2) / 2\f$.<br>
365 : !> One then finds the unique exponential function \f$e^{ax}\f$ such that the function \f$h(x) = f(x) \exp(ax)\f$ satisfies \f$h(x_1) = (h(x_0) + h(x_2)) / 2\f$.<br>
366 : !> Specifically, the parameter \f$a\f$ is determined by,<br>
367 : !> \f{equation}{
368 : !> \large
369 : !> \exp\big(a(x_1 - x_0)\big) = \frac{f(x_1) - \mathrm{sign}\big(f(x_0)\big){\sqrt{f(x_1)^2 - f(x_0) f(x_2)}}}{f(x_2)} ~.
370 : !> \f}
371 : !> The False-Position method is then applied to the points \f$(x_0, h(x_0))\f$ and \f$(x_2, h(x_2))\f$,
372 : !> leading to a new value \f$x_3\f$ between \f$x_0\f$ and \f$x_2\f$,
373 : !> \f{equation}{
374 : !> \large
375 : !> x_3 = x_1 + (x_1 - x_0) \frac{\mathrm{sign}\big(f(x_0)\big) f(x_1)} {\sqrt{f(x_1)^2 - f(x_0) f(x_2)}} ~,
376 : !> \f}
377 : !> which will be used as one of the two bracketing values in the next step of the iteration.<br>
378 : !> The other bracketing value is taken to be \f$x_1\f$ if \f$f(x_1) f(x_3) < 0\f$ (well-behaved case),
379 : !> or otherwise whichever of \f$x_0\f$ and \f$x_2\f$ has function value of opposite sign to \f$f(x_3)\f$.<br>
380 : !> The procedure terminates when the desired accuracy is achieved.<br>
381 : !>
382 : !> <b>The Convergence of the Ridders Algorithm</b><br>
383 : !>
384 : !> The Ridders method is simpler than the Muller method or the Brent method but with similar performance.<br>
385 : !> The algorithm converges quadratically when the function is well-behaved.<br>
386 : !> This implies that the number of additional significant digits found at each step approximately doubles.<br>
387 : !> However, since the function has to be evaluated twice per iteration, the overall order of convergence of the method is \f$\sqrt{2}\f$.<br>
388 : !> The root remains bracketed and the length of the bracketing interval at least halves on each iteration, even the function is not well-behaved.<br>
389 : !> In all circumstances, the convergence is guaranteed.
390 : !>
391 : !> \remark
392 : !> The finite precision of computers can cause problems for convergence of the Ridders method.<br>
393 : !> As such, the implementations of the method frequently include convergence tests or limits to the number of iterations.<br>
394 : !> Although \f$f\f$ is continuous, the finite precision of computer can preclude a function value ever being zero.<br>
395 : !> Additionally, the difference between the search interval limits cannot be less than the floating point precision of the computer.<br>
396 : !>
397 : !> The TOMS748 method
398 : !> ------------------
399 : !>
400 : !> The [TOMS748 algorithm](https://na.math.kit.edu/alefeld/download/1995_Algorithm_748_Enclosing_Zeros_of_Continuous_Functions.pdf)
401 : !> is a hybrid root-finding algorithm introduced in,<br>
402 : !> <ul>
403 : !> <li> Alefeld, G. E., Potra, F. A., Shi, Yixun (1995). "Algorithm 748: Enclosing Zeros of Continuous Functions".
404 : !> ACM Transactions on Mathematical Software. 21 (3): 327–344. doi:10.1145/210089.210111
405 : !> </ul>
406 : !> that uses a mixture of cubic, quadratic and linear (secant) interpolation to locate the root of a function.<br>
407 : !> While there is widespread claims of the superior performance of this algorithm compared to the Brent method,
408 : !> there are [counter arguments](https://www.nongnu.org/lmi/toms_748.html) for such benchmarks.<br>
409 : !>
410 : !> The optimal root-finding method
411 : !> ===============================
412 : !>
413 : !> The best root-finding algorithm depends on the problem being solved:<br>
414 : !> <ol>
415 : !> <li> The Brent method is the recommended **algorithm of choice**
416 : !> for general one-dimensional root-finding problems **without** knowledge of function derivative (gradient).<br>
417 : !> <li> The [Newton-Raphson method](@ref pm_mathRoot) is the recommended **algorithm of choice**
418 : !> for general one-dimensional root-finding problems **with** knowledge of function derivative (gradient).<br>
419 : !> </ol>
420 : !>
421 : !> \see
422 : !> [pm_arraySearch](@ref pm_arraySearch)<br>
423 : !> [getPolyRoot](@ref pm_polynomial::getPolyRoot)<br>
424 : !> [setPolyRoot](@ref pm_polynomial::setPolyRoot)<br>
425 : !> [Regula Falsi](https://en.wikipedia.org/wiki/Regula_falsi)<br>
426 : !> [The Secant Algorithm](https://en.wikipedia.org/wiki/Secant_method)<br>
427 : !> [The Bisection Algorithm](https://en.wikipedia.org/wiki/Bisection_method)<br>
428 : !> [Root-Finding Algorithms](https://en.wikipedia.org/wiki/Root-finding_algorithms)<br>
429 : !> [Root-Finding Algorithms](https://en.wikipedia.org/wiki/Root-finding_algorithms)<br>
430 : !> [Method of False Position](https://mathworld.wolfram.com/MethodofFalsePosition.html#:~:text=An%20algorithm%20for%20finding%20roots,1992)<br>
431 : !> Brent, Richard P., 1971, *An algorithm with guaranteed convergence for finding a zero of a function*, The computer journal, 14, 4, 422-425<br>
432 : !> Newton, Richard P., 1971, *An algorithm with guaranteed convergence for finding a zero of a function*, The computer journal, 14, 4, 422-425<br>
433 : !> Ridders, C. F. J. *A New Algorithm for Computing a Single Root of a Real Continuous Function.* IEEE Trans. Circuits Systems 26, 979-980, 1979<br>
434 : !> Schröder, E. "Über unendlich viele Algorithmen zur Auflösung der Gleichungen." Math. Ann. 2, 317-365, 1870<br>
435 : !> [RootsFortran](https://github.com/jacobwilliams/roots-fortran): An extensive Fortran library for root-finding by [Jacob Williams](https://github.com/jacobwilliams)<br>
436 : !> Numerical Recipes in Fortran, Press et al. 1992<br>
437 : !> [SLATEC cdzro.f](https://netlib.org/slatec/src/)<br>
438 : !> [Boost library](https://www.boost.org/doc/libs/1_82_0/libs/math/doc/html/root_finding.html)<br>
439 : !>
440 : !> \test
441 : !> [test_pm_mathRoot](@ref test_pm_mathRoot)
442 : !>
443 : !> \todo
444 : !> \pmed
445 : !> The [Muller method](https://en.wikipedia.org/wiki/Muller%27s_method) of root-finding should be implemented.<br>
446 : !>
447 : !> \finmain
448 : !>
449 : !> \author
450 : !> \AmirShahmoradi, Oct 16, 2009, 11:14 AM, Michigan
451 :
452 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
453 :
454 : module pm_mathRoot
455 :
456 : use pm_kind, only: SK, IK, LK
457 :
458 : implicit none
459 :
460 : character(*, SK), parameter :: MODULE_NAME = "@pm_mathRoot"
461 :
462 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
463 :
464 : !> \brief
465 : !> This is an `abstract` derived type for constructing concrete derived types to
466 : !> distinguish various procedure signatures that require root-finding methods (e.g., Bisection, False Position, Secant, Newton, Brent, Ridders, ...).<br>
467 : !>
468 : !> \details
469 : !> This `abstract` derived type is not meant to be directly accessed by the end users.<br>
470 : !> Instead, the end users must use `parameter` objects instantiated from the concrete subclasses of this parent `abstract` derived type.<br>
471 : !>
472 : !> \see
473 : !> [brent](@ref pm_mathRoot::brent)<br>
474 : !> [false](@ref pm_mathRoot::false)<br>
475 : !> [secant](@ref pm_mathRoot::secant)<br>
476 : !> [halley](@ref pm_mathRoot::halley)<br>
477 : !> [newton](@ref pm_mathRoot::newton)<br>
478 : !> [ridders](@ref pm_mathRoot::ridders)<br>
479 : !> [toms748](@ref pm_mathRoot::toms748)<br>
480 : !> [schroder](@ref pm_mathRoot::schroder)<br>
481 : !> [bisection](@ref pm_mathRoot::bisection)<br>
482 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
483 : !> [false_type](@ref pm_mathRoot::false_type)<br>
484 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
485 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
486 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
487 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
488 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
489 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
490 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
491 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
492 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
493 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
494 : !> [method_type](@ref pm_mathRoot::method_type)<br>
495 : !>
496 : !> \finmain{method_type}
497 : !>
498 : !> \author
499 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
500 : type, abstract :: method_type
501 : end type
502 :
503 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
504 :
505 : !> \brief
506 : !> This is an `abstract` derived type for constructing concrete derived types to
507 : !> distinguish various procedure signatures that require **bracketing** root-finding methods (e.g., Bisection, False Position, ...).<br>
508 : !>
509 : !> \details
510 : !> This `abstract` derived type is not meant to be directly accessed by the end users.<br>
511 : !> Instead, the end users must use `parameter` objects instantiated from the concrete subclasses of this parent `abstract` derived type.<br>
512 : !>
513 : !> \see
514 : !> [brent](@ref pm_mathRoot::brent)<br>
515 : !> [false](@ref pm_mathRoot::false)<br>
516 : !> [secant](@ref pm_mathRoot::secant)<br>
517 : !> [halley](@ref pm_mathRoot::halley)<br>
518 : !> [newton](@ref pm_mathRoot::newton)<br>
519 : !> [ridders](@ref pm_mathRoot::ridders)<br>
520 : !> [toms748](@ref pm_mathRoot::toms748)<br>
521 : !> [schroder](@ref pm_mathRoot::schroder)<br>
522 : !> [bisection](@ref pm_mathRoot::bisection)<br>
523 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
524 : !> [false_type](@ref pm_mathRoot::false_type)<br>
525 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
526 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
527 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
528 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
529 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
530 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
531 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
532 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
533 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
534 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
535 : !> [method_type](@ref pm_mathRoot::method_type)<br>
536 : !>
537 : !> \finmain{bracket_type}
538 : !>
539 : !> \author
540 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
541 : type, abstract, extends(method_type) :: bracket_type
542 : end type
543 :
544 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
545 :
546 : !> \brief
547 : !> This is an `abstract` derived type for constructing concrete derived types to
548 : !> distinguish various procedure signatures that require **iterative** root-finding methods (e.g., Secant, Newton, ...).<br>
549 : !>
550 : !> \details
551 : !> This `abstract` derived type is not meant to be directly accessed by the end users.<br>
552 : !> Instead, the end users must use `parameter` objects instantiated from the concrete subclasses of this parent `abstract` derived type.<br>
553 : !>
554 : !> \see
555 : !> [brent](@ref pm_mathRoot::brent)<br>
556 : !> [false](@ref pm_mathRoot::false)<br>
557 : !> [secant](@ref pm_mathRoot::secant)<br>
558 : !> [halley](@ref pm_mathRoot::halley)<br>
559 : !> [newton](@ref pm_mathRoot::newton)<br>
560 : !> [ridders](@ref pm_mathRoot::ridders)<br>
561 : !> [toms748](@ref pm_mathRoot::toms748)<br>
562 : !> [schroder](@ref pm_mathRoot::schroder)<br>
563 : !> [bisection](@ref pm_mathRoot::bisection)<br>
564 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
565 : !> [false_type](@ref pm_mathRoot::false_type)<br>
566 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
567 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
568 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
569 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
570 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
571 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
572 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
573 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
574 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
575 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
576 : !> [method_type](@ref pm_mathRoot::method_type)<br>
577 : !>
578 : !> \finmain{iteration_type}
579 : !>
580 : !> \author
581 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
582 : type, abstract, extends(method_type) :: iteration_type
583 : end type
584 :
585 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
586 :
587 : !> \brief
588 : !> This is an `abstract` derived type for constructing concrete derived types to
589 : !> distinguish various procedure signatures that require **iterative** root-finding methods (e.g., Secant, Newton, ...).<br>
590 : !>
591 : !> \details
592 : !> This `abstract` derived type is not meant to be directly accessed by the end users.<br>
593 : !> Instead, the end users must use `parameter` objects instantiated from the concrete subclasses of this parent `abstract` derived type.<br>
594 : !>
595 : !> \see
596 : !> [brent](@ref pm_mathRoot::brent)<br>
597 : !> [false](@ref pm_mathRoot::false)<br>
598 : !> [secant](@ref pm_mathRoot::secant)<br>
599 : !> [halley](@ref pm_mathRoot::halley)<br>
600 : !> [newton](@ref pm_mathRoot::newton)<br>
601 : !> [ridders](@ref pm_mathRoot::ridders)<br>
602 : !> [toms748](@ref pm_mathRoot::toms748)<br>
603 : !> [schroder](@ref pm_mathRoot::schroder)<br>
604 : !> [bisection](@ref pm_mathRoot::bisection)<br>
605 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
606 : !> [false_type](@ref pm_mathRoot::false_type)<br>
607 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
608 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
609 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
610 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
611 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
612 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
613 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
614 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
615 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
616 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
617 : !> [method_type](@ref pm_mathRoot::method_type)<br>
618 : !>
619 : !> \finmain{hybrid_type}
620 : !>
621 : !> \author
622 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
623 : type, abstract, extends(method_type) :: hybrid_type
624 : end type
625 :
626 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
627 :
628 : !> \brief
629 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Brent method of root-finding.<br>
630 : !>
631 : !> \details
632 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
633 : !> Objects instantiated from this derived type are exclusively used to differentiate
634 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
635 : !> As such, this concrete derived type does not contain any attributes.<br>
636 : !>
637 : !> \note
638 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
639 : !> Instead, the end users should use the specific object parameter instance of this derived type
640 : !> (e.g., [brent](@ref pm_mathRoot::brent) as directed by the documentation of the specific procedure they intend to use.<br>
641 : !>
642 : !> \see
643 : !> [brent](@ref pm_mathRoot::brent)<br>
644 : !> [false](@ref pm_mathRoot::false)<br>
645 : !> [secant](@ref pm_mathRoot::secant)<br>
646 : !> [halley](@ref pm_mathRoot::halley)<br>
647 : !> [newton](@ref pm_mathRoot::newton)<br>
648 : !> [ridders](@ref pm_mathRoot::ridders)<br>
649 : !> [toms748](@ref pm_mathRoot::toms748)<br>
650 : !> [schroder](@ref pm_mathRoot::schroder)<br>
651 : !> [bisection](@ref pm_mathRoot::bisection)<br>
652 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
653 : !> [false_type](@ref pm_mathRoot::false_type)<br>
654 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
655 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
656 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
657 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
658 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
659 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
660 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
661 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
662 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
663 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
664 : !> [method_type](@ref pm_mathRoot::method_type)<br>
665 : !>
666 : !> \finmain{brent_type}
667 : !>
668 : !> \author
669 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
670 : type, extends(hybrid_type) :: brent_type
671 : end type
672 :
673 : !> \brief
674 : !> This is a scalar `parameter` object of type [brent_type](@ref pm_mathRoot::brent_type) that is exclusively used
675 : !> to signify the use of Brent method of root-finding within an interface of a procedure of the ParaMonte library.<br>
676 : !>
677 : !> \details
678 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
679 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
680 : !>
681 : !> \see
682 : !> [brent](@ref pm_mathRoot::brent)<br>
683 : !> [false](@ref pm_mathRoot::false)<br>
684 : !> [secant](@ref pm_mathRoot::secant)<br>
685 : !> [halley](@ref pm_mathRoot::halley)<br>
686 : !> [newton](@ref pm_mathRoot::newton)<br>
687 : !> [ridders](@ref pm_mathRoot::ridders)<br>
688 : !> [toms748](@ref pm_mathRoot::toms748)<br>
689 : !> [schroder](@ref pm_mathRoot::schroder)<br>
690 : !> [bisection](@ref pm_mathRoot::bisection)<br>
691 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
692 : !> [false_type](@ref pm_mathRoot::false_type)<br>
693 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
694 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
695 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
696 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
697 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
698 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
699 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
700 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
701 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
702 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
703 : !> [method_type](@ref pm_mathRoot::method_type)<br>
704 : !>
705 : !> \finmain{brent}
706 : !>
707 : !> \author
708 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
709 : type(brent_type), parameter :: brent = brent_type()
710 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
711 : !DIR$ ATTRIBUTES DLLEXPORT :: brent
712 : #endif
713 :
714 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
715 :
716 : !> \brief
717 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the TOMS748 method of root-finding.<br>
718 : !>
719 : !> \details
720 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
721 : !> Objects instantiated from this derived type are exclusively used to differentiate
722 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
723 : !> As such, this concrete derived type does not contain any attributes.<br>
724 : !>
725 : !> \note
726 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
727 : !> Instead, the end users should use the specific object parameter instance of this derived type
728 : !> (e.g., [toms748](@ref pm_mathRoot::toms748) as directed by the documentation of the specific procedure they intend to use.<br>
729 : !>
730 : !> \see
731 : !> [brent](@ref pm_mathRoot::brent)<br>
732 : !> [false](@ref pm_mathRoot::false)<br>
733 : !> [secant](@ref pm_mathRoot::secant)<br>
734 : !> [halley](@ref pm_mathRoot::halley)<br>
735 : !> [newton](@ref pm_mathRoot::newton)<br>
736 : !> [ridders](@ref pm_mathRoot::ridders)<br>
737 : !> [toms748](@ref pm_mathRoot::toms748)<br>
738 : !> [schroder](@ref pm_mathRoot::schroder)<br>
739 : !> [bisection](@ref pm_mathRoot::bisection)<br>
740 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
741 : !> [false_type](@ref pm_mathRoot::false_type)<br>
742 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
743 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
744 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
745 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
746 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
747 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
748 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
749 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
750 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
751 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
752 : !> [method_type](@ref pm_mathRoot::method_type)<br>
753 : !>
754 : !> \finmain{toms748_type}
755 : !>
756 : !> \author
757 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
758 : type, extends(hybrid_type) :: toms748_type
759 : end type
760 :
761 : !> \brief
762 : !> This is a scalar `parameter` object of type [toms748_type](@ref pm_mathRoot::toms748_type) that is exclusively used
763 : !> to signify the use of TOMS748 method of root-finding within an interface of a procedure of the ParaMonte library.<br>
764 : !>
765 : !> \details
766 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
767 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
768 : !>
769 : !> \see
770 : !> [brent](@ref pm_mathRoot::brent)<br>
771 : !> [false](@ref pm_mathRoot::false)<br>
772 : !> [secant](@ref pm_mathRoot::secant)<br>
773 : !> [halley](@ref pm_mathRoot::halley)<br>
774 : !> [newton](@ref pm_mathRoot::newton)<br>
775 : !> [ridders](@ref pm_mathRoot::ridders)<br>
776 : !> [toms748](@ref pm_mathRoot::toms748)<br>
777 : !> [schroder](@ref pm_mathRoot::schroder)<br>
778 : !> [bisection](@ref pm_mathRoot::bisection)<br>
779 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
780 : !> [false_type](@ref pm_mathRoot::false_type)<br>
781 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
782 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
783 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
784 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
785 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
786 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
787 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
788 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
789 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
790 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
791 : !> [method_type](@ref pm_mathRoot::method_type)<br>
792 : !>
793 : !> \finmain{toms748}
794 : !>
795 : !> \author
796 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
797 : type(toms748_type), parameter :: toms748 = toms748_type()
798 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
799 : !DIR$ ATTRIBUTES DLLEXPORT :: toms748
800 : #endif
801 :
802 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
803 :
804 : !> \brief
805 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the False-Position method of root-finding.<br>
806 : !>
807 : !> \details
808 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
809 : !> Objects instantiated from this derived type are exclusively used to differentiate
810 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
811 : !> As such, this concrete derived type does not contain any attributes.<br>
812 : !>
813 : !> \note
814 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
815 : !> Instead, the end users should use the specific object parameter instance of this derived type
816 : !> (e.g., [false](@ref pm_mathRoot::false) as directed by the documentation of the specific procedure they intend to use.<br>
817 : !>
818 : !> \see
819 : !> [brent](@ref pm_mathRoot::brent)<br>
820 : !> [false](@ref pm_mathRoot::false)<br>
821 : !> [secant](@ref pm_mathRoot::secant)<br>
822 : !> [halley](@ref pm_mathRoot::halley)<br>
823 : !> [newton](@ref pm_mathRoot::newton)<br>
824 : !> [ridders](@ref pm_mathRoot::ridders)<br>
825 : !> [toms748](@ref pm_mathRoot::toms748)<br>
826 : !> [schroder](@ref pm_mathRoot::schroder)<br>
827 : !> [bisection](@ref pm_mathRoot::bisection)<br>
828 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
829 : !> [false_type](@ref pm_mathRoot::false_type)<br>
830 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
831 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
832 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
833 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
834 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
835 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
836 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
837 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
838 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
839 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
840 : !> [method_type](@ref pm_mathRoot::method_type)<br>
841 : !>
842 : !> \finmain{false_type}
843 : !>
844 : !> \author
845 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
846 : type, extends(bracket_type) :: false_type
847 : end type
848 :
849 : !> \brief
850 : !> This is a scalar `parameter` object of type [false_type](@ref pm_mathRoot::false_type) that is exclusively used
851 : !> to signify the use of False-Position method of root-finding within an interface of a procedure of the ParaMonte library.<br>
852 : !>
853 : !> \details
854 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
855 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
856 : !>
857 : !> \see
858 : !> [brent](@ref pm_mathRoot::brent)<br>
859 : !> [false](@ref pm_mathRoot::false)<br>
860 : !> [secant](@ref pm_mathRoot::secant)<br>
861 : !> [halley](@ref pm_mathRoot::halley)<br>
862 : !> [newton](@ref pm_mathRoot::newton)<br>
863 : !> [ridders](@ref pm_mathRoot::ridders)<br>
864 : !> [toms748](@ref pm_mathRoot::toms748)<br>
865 : !> [schroder](@ref pm_mathRoot::schroder)<br>
866 : !> [bisection](@ref pm_mathRoot::bisection)<br>
867 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
868 : !> [false_type](@ref pm_mathRoot::false_type)<br>
869 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
870 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
871 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
872 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
873 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
874 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
875 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
876 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
877 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
878 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
879 : !> [method_type](@ref pm_mathRoot::method_type)<br>
880 : !>
881 : !> \finmain{false}
882 : !>
883 : !> \author
884 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
885 : type(false_type), parameter :: false = false_type()
886 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
887 : !DIR$ ATTRIBUTES DLLEXPORT :: false
888 : #endif
889 :
890 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
891 :
892 : !> \brief
893 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Secant method of root-finding.<br>
894 : !>
895 : !> \details
896 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
897 : !> Objects instantiated from this derived type are exclusively used to differentiate
898 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
899 : !> As such, this concrete derived type does not contain any attributes.<br>
900 : !>
901 : !> \note
902 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
903 : !> Instead, the end users should use the specific object parameter instance of this derived type
904 : !> (e.g., [secant](@ref pm_mathRoot::secant) as directed by the documentation of the specific procedure they intend to use.<br>
905 : !>
906 : !> \see
907 : !> [brent](@ref pm_mathRoot::brent)<br>
908 : !> [false](@ref pm_mathRoot::false)<br>
909 : !> [secant](@ref pm_mathRoot::secant)<br>
910 : !> [halley](@ref pm_mathRoot::halley)<br>
911 : !> [newton](@ref pm_mathRoot::newton)<br>
912 : !> [ridders](@ref pm_mathRoot::ridders)<br>
913 : !> [toms748](@ref pm_mathRoot::toms748)<br>
914 : !> [schroder](@ref pm_mathRoot::schroder)<br>
915 : !> [bisection](@ref pm_mathRoot::bisection)<br>
916 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
917 : !> [false_type](@ref pm_mathRoot::false_type)<br>
918 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
919 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
920 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
921 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
922 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
923 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
924 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
925 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
926 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
927 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
928 : !> [method_type](@ref pm_mathRoot::method_type)<br>
929 : !>
930 : !> \finmain{secant_type}
931 : !>
932 : !> \author
933 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
934 : type, extends(iteration_type) :: secant_type
935 : end type
936 :
937 : !> \brief
938 : !> This is a scalar `parameter` object of type [secant_type](@ref pm_mathRoot::secant_type) that is exclusively used
939 : !> to signify the use of Secant method of root-finding within an interface of a procedure of the ParaMonte library.<br>
940 : !>
941 : !> \details
942 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
943 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
944 : !>
945 : !> \see
946 : !> [brent](@ref pm_mathRoot::brent)<br>
947 : !> [false](@ref pm_mathRoot::false)<br>
948 : !> [secant](@ref pm_mathRoot::secant)<br>
949 : !> [halley](@ref pm_mathRoot::halley)<br>
950 : !> [newton](@ref pm_mathRoot::newton)<br>
951 : !> [ridders](@ref pm_mathRoot::ridders)<br>
952 : !> [toms748](@ref pm_mathRoot::toms748)<br>
953 : !> [schroder](@ref pm_mathRoot::schroder)<br>
954 : !> [bisection](@ref pm_mathRoot::bisection)<br>
955 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
956 : !> [false_type](@ref pm_mathRoot::false_type)<br>
957 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
958 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
959 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
960 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
961 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
962 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
963 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
964 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
965 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
966 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
967 : !> [method_type](@ref pm_mathRoot::method_type)<br>
968 : !>
969 : !> \finmain{secant}
970 : !>
971 : !> \author
972 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
973 : type(secant_type), parameter :: secant = secant_type()
974 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
975 : !DIR$ ATTRIBUTES DLLEXPORT :: secant
976 : #endif
977 :
978 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
979 :
980 : !> \brief
981 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Newton method of root-finding.<br>
982 : !>
983 : !> \details
984 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
985 : !> Objects instantiated from this derived type are exclusively used to differentiate
986 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
987 : !> As such, this concrete derived type does not contain any attributes.<br>
988 : !>
989 : !> \note
990 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
991 : !> Instead, the end users should use the specific object parameter instance of this derived type
992 : !> (e.g., [newton](@ref pm_mathRoot::newton) as directed by the documentation of the specific procedure they intend to use.<br>
993 : !>
994 : !> \see
995 : !> [brent](@ref pm_mathRoot::brent)<br>
996 : !> [false](@ref pm_mathRoot::false)<br>
997 : !> [secant](@ref pm_mathRoot::secant)<br>
998 : !> [halley](@ref pm_mathRoot::halley)<br>
999 : !> [newton](@ref pm_mathRoot::newton)<br>
1000 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1001 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1002 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1003 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1004 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1005 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1006 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1007 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1008 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1009 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1010 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1011 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1012 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1013 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1014 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1015 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1016 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1017 : !>
1018 : !> \finmain{newton_type}
1019 : !>
1020 : !> \author
1021 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1022 : type, extends(iteration_type) :: newton_type
1023 : end type
1024 :
1025 : !> \brief
1026 : !> This is a scalar `parameter` object of type [newton_type](@ref pm_mathRoot::newton_type) that is exclusively used
1027 : !> to signify the use of Newton method of root-finding within an interface of a procedure of the ParaMonte library.<br>
1028 : !>
1029 : !> \details
1030 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1031 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
1032 : !>
1033 : !> \see
1034 : !> [brent](@ref pm_mathRoot::brent)<br>
1035 : !> [false](@ref pm_mathRoot::false)<br>
1036 : !> [secant](@ref pm_mathRoot::secant)<br>
1037 : !> [halley](@ref pm_mathRoot::halley)<br>
1038 : !> [newton](@ref pm_mathRoot::newton)<br>
1039 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1040 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1041 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1042 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1043 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1044 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1045 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1046 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1047 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1048 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1049 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1050 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1051 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1052 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1053 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1054 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1055 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1056 : !>
1057 : !> \finmain{newton}
1058 : !>
1059 : !> \author
1060 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1061 : type(newton_type), parameter :: newton = newton_type()
1062 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1063 : !DIR$ ATTRIBUTES DLLEXPORT :: newton
1064 : #endif
1065 :
1066 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1067 :
1068 : !> \brief
1069 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Halley method of root-finding.<br>
1070 : !>
1071 : !> \details
1072 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1073 : !> Objects instantiated from this derived type are exclusively used to differentiate
1074 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
1075 : !> As such, this concrete derived type does not contain any attributes.<br>
1076 : !>
1077 : !> \note
1078 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
1079 : !> Instead, the end users should use the specific object parameter instance of this derived type
1080 : !> (e.g., [halley](@ref pm_mathRoot::halley) as directed by the documentation of the specific procedure they intend to use.<br>
1081 : !>
1082 : !> \see
1083 : !> [brent](@ref pm_mathRoot::brent)<br>
1084 : !> [false](@ref pm_mathRoot::false)<br>
1085 : !> [secant](@ref pm_mathRoot::secant)<br>
1086 : !> [halley](@ref pm_mathRoot::halley)<br>
1087 : !> [newton](@ref pm_mathRoot::newton)<br>
1088 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1089 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1090 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1091 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1092 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1093 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1094 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1095 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1096 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1097 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1098 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1099 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1100 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1101 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1102 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1103 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1104 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1105 : !>
1106 : !> \finmain{halley_type}
1107 : !>
1108 : !> \author
1109 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1110 : type, extends(iteration_type) :: halley_type
1111 : end type
1112 :
1113 : !> \brief
1114 : !> This is a scalar `parameter` object of type [halley_type](@ref pm_mathRoot::halley_type) that is exclusively used
1115 : !> to signify the use of Halley method of root-finding within an interface of a procedure of the ParaMonte library.<br>
1116 : !>
1117 : !> \details
1118 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1119 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
1120 : !>
1121 : !> \see
1122 : !> [brent](@ref pm_mathRoot::brent)<br>
1123 : !> [false](@ref pm_mathRoot::false)<br>
1124 : !> [secant](@ref pm_mathRoot::secant)<br>
1125 : !> [halley](@ref pm_mathRoot::halley)<br>
1126 : !> [newton](@ref pm_mathRoot::newton)<br>
1127 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1128 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1129 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1130 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1131 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1132 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1133 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1134 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1135 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1136 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1137 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1138 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1139 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1140 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1141 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1142 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1143 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1144 : !>
1145 : !> \finmain{halley}
1146 : !>
1147 : !> \author
1148 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1149 : type(halley_type), parameter :: halley = halley_type()
1150 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1151 : !DIR$ ATTRIBUTES DLLEXPORT :: halley
1152 : #endif
1153 :
1154 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1155 :
1156 : !> \brief
1157 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Schroder method of root-finding.<br>
1158 : !>
1159 : !> \details
1160 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1161 : !> Objects instantiated from this derived type are exclusively used to differentiate
1162 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
1163 : !> As such, this concrete derived type does not contain any attributes.<br>
1164 : !>
1165 : !> \note
1166 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
1167 : !> Instead, the end users should use the specific object parameter instance of this derived type
1168 : !> (e.g., [schroder](@ref pm_mathRoot::schroder) as directed by the documentation of the specific procedure they intend to use.<br>
1169 : !>
1170 : !> \see
1171 : !> [brent](@ref pm_mathRoot::brent)<br>
1172 : !> [false](@ref pm_mathRoot::false)<br>
1173 : !> [secant](@ref pm_mathRoot::secant)<br>
1174 : !> [halley](@ref pm_mathRoot::halley)<br>
1175 : !> [newton](@ref pm_mathRoot::newton)<br>
1176 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1177 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1178 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1179 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1180 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1181 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1182 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1183 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1184 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1185 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1186 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1187 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1188 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1189 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1190 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1191 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1192 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1193 : !>
1194 : !> \finmain{schroder_type}
1195 : !>
1196 : !> \author
1197 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1198 : type, extends(iteration_type) :: schroder_type
1199 : end type
1200 :
1201 : !> \brief
1202 : !> This is a scalar `parameter` object of type [schroder_type](@ref pm_mathRoot::schroder_type) that is exclusively used
1203 : !> to signify the use of Schroder method of root-finding within an interface of a procedure of the ParaMonte library.<br>
1204 : !>
1205 : !> \details
1206 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1207 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
1208 : !>
1209 : !> \see
1210 : !> [brent](@ref pm_mathRoot::brent)<br>
1211 : !> [false](@ref pm_mathRoot::false)<br>
1212 : !> [secant](@ref pm_mathRoot::secant)<br>
1213 : !> [halley](@ref pm_mathRoot::halley)<br>
1214 : !> [newton](@ref pm_mathRoot::newton)<br>
1215 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1216 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1217 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1218 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1219 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1220 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1221 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1222 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1223 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1224 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1225 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1226 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1227 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1228 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1229 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1230 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1231 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1232 : !>
1233 : !> \finmain{schroder}
1234 : !>
1235 : !> \author
1236 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1237 : type(schroder_type), parameter :: schroder = schroder_type()
1238 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1239 : !DIR$ ATTRIBUTES DLLEXPORT :: schroder
1240 : #endif
1241 :
1242 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1243 :
1244 : !> \brief
1245 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Ridders method of root-finding.<br>
1246 : !>
1247 : !> \details
1248 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1249 : !> Objects instantiated from this derived type are exclusively used to differentiate
1250 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
1251 : !> As such, this concrete derived type does not contain any attributes.<br>
1252 : !>
1253 : !> \note
1254 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
1255 : !> Instead, the end users should use the specific object parameter instance of this derived type
1256 : !> (e.g., [ridders](@ref pm_mathRoot::ridders) as directed by the documentation of the specific procedure they intend to use.<br>
1257 : !>
1258 : !> \see
1259 : !> [brent](@ref pm_mathRoot::brent)<br>
1260 : !> [false](@ref pm_mathRoot::false)<br>
1261 : !> [secant](@ref pm_mathRoot::secant)<br>
1262 : !> [halley](@ref pm_mathRoot::halley)<br>
1263 : !> [newton](@ref pm_mathRoot::newton)<br>
1264 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1265 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1266 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1267 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1268 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1269 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1270 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1271 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1272 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1273 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1274 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1275 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1276 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1277 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1278 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1279 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1280 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1281 : !>
1282 : !> \finmain{ridders_type}
1283 : !>
1284 : !> \author
1285 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1286 : type, extends(hybrid_type) :: ridders_type
1287 : end type
1288 :
1289 : !> \brief
1290 : !> This is a scalar `parameter` object of type [ridders_type](@ref pm_mathRoot::ridders_type) that is exclusively used
1291 : !> to signify the use of Ridders method of root-finding within an interface of a procedure of the ParaMonte library.<br>
1292 : !>
1293 : !> \details
1294 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1295 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
1296 : !>
1297 : !> \see
1298 : !> [brent](@ref pm_mathRoot::brent)<br>
1299 : !> [false](@ref pm_mathRoot::false)<br>
1300 : !> [secant](@ref pm_mathRoot::secant)<br>
1301 : !> [halley](@ref pm_mathRoot::halley)<br>
1302 : !> [newton](@ref pm_mathRoot::newton)<br>
1303 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1304 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1305 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1306 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1307 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1308 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1309 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1310 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1311 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1312 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1313 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1314 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1315 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1316 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1317 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1318 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1319 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1320 : !>
1321 : !> \finmain{ridders}
1322 : !>
1323 : !> \author
1324 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1325 : type(ridders_type), parameter :: ridders = ridders_type()
1326 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1327 : !DIR$ ATTRIBUTES DLLEXPORT :: ridders
1328 : #endif
1329 :
1330 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1331 :
1332 : !> \brief
1333 : !> This is a concrete derived type whose instances are exclusively used to signify the use of the Bisection method of root-finding.<br>
1334 : !>
1335 : !> \details
1336 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1337 : !> Objects instantiated from this derived type are exclusively used to differentiate
1338 : !> the procedures within the various generic interfaces of the ParaMonte library.<br>
1339 : !> As such, this concrete derived type does not contain any attributes.<br>
1340 : !>
1341 : !> \note
1342 : !> This concrete derived type is not meant to be directly accessed by the end users.<br>
1343 : !> Instead, the end users should use the specific object parameter instance of this derived type
1344 : !> (e.g., [bisection](@ref pm_mathRoot::bisection) as directed by the documentation of the specific procedure they intend to use.<br>
1345 : !>
1346 : !> \see
1347 : !> [brent](@ref pm_mathRoot::brent)<br>
1348 : !> [false](@ref pm_mathRoot::false)<br>
1349 : !> [secant](@ref pm_mathRoot::secant)<br>
1350 : !> [halley](@ref pm_mathRoot::halley)<br>
1351 : !> [newton](@ref pm_mathRoot::newton)<br>
1352 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1353 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1354 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1355 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1356 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1357 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1358 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1359 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1360 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1361 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1362 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1363 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1364 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1365 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1366 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1367 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1368 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1369 : !>
1370 : !> \finmain{bisection_type}
1371 : !>
1372 : !> \author
1373 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1374 : type, extends(bracket_type) :: bisection_type
1375 : end type
1376 :
1377 : !> \brief
1378 : !> This is a scalar `parameter` object of type [bisection_type](@ref pm_mathRoot::bisection_type) that is exclusively used
1379 : !> to signify the use of Bisection method of root-finding within an interface of a procedure of the ParaMonte library.<br>
1380 : !>
1381 : !> \details
1382 : !> See the root-finding section in the documentation of [pm_mathRoot](@ref pm_mathRoot) for more details about this root-finding method.<br>
1383 : !> For example usage, see the documentation of the target procedure requiring this object.<br>
1384 : !>
1385 : !> \see
1386 : !> [brent](@ref pm_mathRoot::brent)<br>
1387 : !> [false](@ref pm_mathRoot::false)<br>
1388 : !> [secant](@ref pm_mathRoot::secant)<br>
1389 : !> [halley](@ref pm_mathRoot::halley)<br>
1390 : !> [newton](@ref pm_mathRoot::newton)<br>
1391 : !> [ridders](@ref pm_mathRoot::ridders)<br>
1392 : !> [toms748](@ref pm_mathRoot::toms748)<br>
1393 : !> [schroder](@ref pm_mathRoot::schroder)<br>
1394 : !> [bisection](@ref pm_mathRoot::bisection)<br>
1395 : !> [brent_type](@ref pm_mathRoot::brent_type)<br>
1396 : !> [false_type](@ref pm_mathRoot::false_type)<br>
1397 : !> [secant_type](@ref pm_mathRoot::secant_type)<br>
1398 : !> [halley_type](@ref pm_mathRoot::halley_type)<br>
1399 : !> [newton_type](@ref pm_mathRoot::newton_type)<br>
1400 : !> [ridders_type](@ref pm_mathRoot::ridders_type)<br>
1401 : !> [toms748_type](@ref pm_mathRoot::toms748_type)<br>
1402 : !> [schroder_type](@ref pm_mathRoot::schroder_type)<br>
1403 : !> [bisection_type](@ref pm_mathRoot::bisection_type)<br>
1404 : !> [iteration_type](@ref pm_mathRoot::iteration_type)<br>
1405 : !> [bracket_type](@ref pm_mathRoot::bracket_type)<br>
1406 : !> [hybrid_type](@ref pm_mathRoot::hybrid_type)<br>
1407 : !> [method_type](@ref pm_mathRoot::method_type)<br>
1408 : !>
1409 : !> \finmain{bisection}
1410 : !>
1411 : !> \author
1412 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
1413 : type(bisection_type), parameter :: bisection = bisection_type()
1414 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1415 : !DIR$ ATTRIBUTES DLLEXPORT :: bisection
1416 : #endif
1417 :
1418 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1419 :
1420 : !> \brief
1421 : !> Generate and return a root of a specified continuous real-valued one-dimensional
1422 : !> mathematical function such that \f$f(\mathrm{root}) = 0\f$ with the user-specified or the default root-finding method.<br>
1423 : !>
1424 : !> \details
1425 : !> See the documentation of [pm_mathRoot](@ref pm_mathRoot) for details of the various root-finding methods.<br>
1426 : !>
1427 : !> \note
1428 : !> <b>Which root-finding method should I use among all available?</b><br>
1429 : !> The [brent](@ref pm_mathRoot::brent) method is the recommended **algorithm of choice**
1430 : !> for general one-dimensional root-finding problems **without** knowledge of function **derivative** (gradient).<br>
1431 : !> The [Newton-Raphson method](@ref pm_mathRoot::newton) is the recommended **algorithm of choice**
1432 : !> for general one-dimensional root-finding problems **with** knowledge of function **derivative** (gradient).<br>
1433 : !>
1434 : !> \param[in] method : The input scalar constant that can be one of the following:<br>
1435 : !> <ol>
1436 : !> <li> The constant [false](@ref pm_mathRoot::false) or an object of type [false_type](@ref pm_mathRoot::false_type),
1437 : !> signifying the use of the **False-Position** root-finding method within the algorithm.<br>
1438 : !> <li> The constant [bisection](@ref pm_mathRoot::bisection) or an object of type [bisection_type](@ref pm_mathRoot::bisection_type),
1439 : !> signifying the use of the **Bisection** root-finding method within the algorithm.<br>
1440 : !> <li> The constant [secant](@ref pm_mathRoot::secant) or an object of type [secant_type](@ref pm_mathRoot::secant_type),
1441 : !> signifying the use of the **Secant** root-finding method within the algorithm.<br>
1442 : !> <li> The constant [brent](@ref pm_mathRoot::brent) or an object of type [brent_type](@ref pm_mathRoot::brent_type),
1443 : !> signifying the use of the **Brent** root-finding method within the algorithm.<br>
1444 : !> <li> The constant [ridders](@ref pm_mathRoot::ridders) or an object of type [ridders_type](@ref pm_mathRoot::ridders_type),
1445 : !> signifying the use of the **Ridders** root-finding method within the algorithm.<br>
1446 : !> <li> The constant [toms748](@ref pm_mathRoot::toms748) or an object of type [toms748_type](@ref pm_mathRoot::toms748_type),
1447 : !> signifying the use of the **TOMS748** root-finding method within the algorithm.<br>
1448 : !> <li> The constant [newton](@ref pm_mathRoot::newton) or an object of type [newton_type](@ref pm_mathRoot::newton_type),
1449 : !> signifying the use of the **Newton** root-finding method within the algorithm.<br>
1450 : !> <li> The constant [halley](@ref pm_mathRoot::halley) or an object of type [halley_type](@ref pm_mathRoot::halley_type),
1451 : !> signifying the use of the **Halley** root-finding method within the algorithm.<br>
1452 : !> <li> The constant [schroder](@ref pm_mathRoot::schroder) or an object of type [schroder_type](@ref pm_mathRoot::schroder_type),
1453 : !> signifying the use of the **Schroder** root-finding method within the algorithm.<br>
1454 : !> </ol>
1455 : !> (**optional**, default = [brent](@ref pm_mathRoot::brent). Note the implicit constraint this default option sets on the input `getFunc()` interface below.)
1456 : !> \param[in] getFunc : The `external` user-specified function whose interface depends on the specified value for the input argument `method`.<br>
1457 : !> <ol>
1458 : !> <li> If the specified `method` is any of the following,<br>
1459 : !> <ol>
1460 : !> <li> the constant [brent](@ref pm_mathRoot::brent) or an object of type [brent_type](@ref pm_mathRoot::brent_type),<br>
1461 : !> <li> the constant [false](@ref pm_mathRoot::false) or an object of type [false_type](@ref pm_mathRoot::false_type),<br>
1462 : !> <li> the constant [secant](@ref pm_mathRoot::secant) or an object of type [secant_type](@ref pm_mathRoot::secant_type),<br>
1463 : !> <li> the constant [ridders](@ref pm_mathRoot::ridders) or an object of type [ridders_type](@ref pm_mathRoot::ridders_type),<br>
1464 : !> <li> the constant [toms748](@ref pm_mathRoot::toms748) or an object of type [toms748_type](@ref pm_mathRoot::toms748_type),<br>
1465 : !> <li> the constant [bisection](@ref pm_mathRoot::bisection) or an object of type [bisection_type](@ref pm_mathRoot::bisection_type),<br>
1466 : !> </ol>
1467 : !> none of which require the derivative of the target function to find the function root,
1468 : !> then `getFunc()` must take a single scalar input argument `x` of the same type and kind as the output argument `root` (below).<br>
1469 : !> On output, `getFunc()` must return a scalar of the same type and kind as the function input argument `x`,
1470 : !> containing the value of the target function evaluated at the specified input `x`.<br>
1471 : !> The following illustrates the generic interface of `getFunc()` for the above values of `method`,
1472 : !> \code{.F90}
1473 : !> function getFunc(x) result(func)
1474 : !> real(RKC) , intent(in) :: x
1475 : !> real(RKC) :: func
1476 : !> end function
1477 : !> \endcode
1478 : !> where `RKC` refers to the kind of the output argument `root`.<br>
1479 : !> <li> If the specified `method` is any of the following,
1480 : !> <ol>
1481 : !> <li> the constant [newton](@ref pm_mathRoot::newton) or an object of type [newton_type](@ref pm_mathRoot::newton_type),<br>
1482 : !> <li> the constant [halley](@ref pm_mathRoot::halley) or an object of type [halley_type](@ref pm_mathRoot::halley_type),<br>
1483 : !> <li> the constant [schroder](@ref pm_mathRoot::schroder) or an object of type [schroder_type](@ref pm_mathRoot::schroder_type),<br>
1484 : !> </ol>
1485 : !> all of which either require the first (Newton) or higher derivatives (Halley/Schroder) of the target function to find the function root,
1486 : !> then `getFunc()` must take a two arguments:<br>
1487 : !> <ol>
1488 : !> <li> A scalar input argument `x` of the same type and kind as the output argument `root` (below).<br>
1489 : !> <li> A scalar input argument `order` of type `integer` of default kind \IK.<br>
1490 : !> </ol>
1491 : !> On output, `getFunc()` must return a scalar of the same type and kind as the function input argument `x`,
1492 : !> containing the derivative of the specified input `order` of the target function evaluated at the specified input `x`:<br>
1493 : !> <ol>
1494 : !> <li> An input `order` value of `0` must yield the target function value at the input `x`.<br>
1495 : !> <li> An input `order` value of `1` must yield the target function first derivative at the input `x`.<br>
1496 : !> <li> An input `order` value of `1` must yield the target function second derivative at the input `x`.<br>
1497 : !> </ol>
1498 : !> The following illustrates the generic interface of `getFunc()` for the above values of `method`,
1499 : !> \code{.F90}
1500 : !> function getFunc(x, order) result(func)
1501 : !> real(RKC) , intent(in) :: x
1502 : !> integer(IK) , intent(in) :: order
1503 : !> real(RKC) :: func
1504 : !> end function
1505 : !> \endcode
1506 : !> where `RKC` refers to the kind of the output argument `root`.<br>
1507 : !> </ol>
1508 : !> \param[inout] root : The input/output scalar of type `real` of kind \RKALL.<br>
1509 : !> On input,<br>
1510 : !> <ol>
1511 : !> <li> If the specified `method` is of type [newton_type](@ref pm_mathRoot::newton_type) or [halley_type](@ref pm_mathRoot::halley_type),
1512 : !> then `root` must contain the best guess initial value for the function `root` within the bracket specified by the input arguments `lb` and `ub`.<br>
1513 : !> <li> Otherwise, any input value for `root` is ignored for all other root-finding methods.<br>
1514 : !> </ol>
1515 : !> On output, `root` contains the best approximation to the root of the user-specified
1516 : !> function `getFunc()` within the specified search interval `[lb, ub]` and tolerance threshold `abstol`.<br>
1517 : !> \param[in] lb : The input scalar of same type and kind as the output `root`, representing the lower bound of the bracket (search) interval.<br>
1518 : !> \param[in] ub : The input scalar of same type and kind as the output `root`, representing the upper bound of the bracket (search) interval.<br>
1519 : !> \param[in] abstol : The input scalar of same type and kind as the output `root`, representing the absolute tolerance used as the stopping criterion of the search.<br>
1520 : !> The iterations of the specified input `method` continue until the search interval becomes smaller than `abstol` in absolute units.<br>
1521 : !> Care must be taken for specifying a reasonable value for `abstol` (see the warnings below).<br>
1522 : !> If no suitable value for `abstol` is known a priori, try `abstol = epsilon(0._RKC)**.8 * (abs(lb) + abs(ub))`
1523 : !> where `RKC` refers to the kind of the output argument `root`.<br>
1524 : !> (**optional**, default = `epsilon(0._RKC)**.8 * (abs(lb) + abs(ub))`)
1525 : !> \param[out] neval : The output scalar argument of type `integer` of default kind \IK, containing the total number of `getFunc()` function calls made by the algorithm.<br>
1526 : !> <ol>
1527 : !> <li> A positive output `neval` implies the **successful** convergence of the algorithm to the function root after `+neval` function evaluations.<br>
1528 : !> <li> A negative output `neval` implies the **failure** of convergence of the algorithm to the function root after `-neval` function evaluations.<br>
1529 : !> <li> A zero output `neval` only occurs if the root lies at the search bracket boundaries specified by the input argument `lb` or `ub`.<br>
1530 : !> </ol>
1531 : !> Convergence failures rarely occur. If they do, setting the input arguments `abstol` and/or `niter` to larger values may resolve the failure.<br>
1532 : !> \param[in] niter : The input scalar of type `integer` of default kind \IK, representing the **maximum number of iterations allowed** for the specified `method` to find the root.<br>
1533 : !> The default number of steps `niter` within the algorithm is a compile-time constant that depends on the `kind` of the `real` input arguments.<br>
1534 : !> (**optional**, default = `ceiling(2 * precision(lb) / log10(2.))`)
1535 : !>
1536 : !> \interface{getRoot}
1537 : !> \code{.F90}
1538 : !>
1539 : !> use pm_mathRoot, only: getRoot
1540 : !>
1541 : !> root = getRoot(getFunc, lb, ub, abstol = abstol, neval = neval, niter = niter)
1542 : !> root = getRoot(method, getFunc, lb, ub, abstol = abstol, neval = neval, niter = niter)
1543 : !>
1544 : !> \endcode
1545 : !>
1546 : !> \warning
1547 : !> The condition `lb < ub` must hold for the corresponding input arguments.<br>
1548 : !> The condition `0 < abstol` must hold for the corresponding input arguments.<br>
1549 : !> The condition `abstol < (ub - lb)` must hold for the corresponding input arguments.<br>
1550 : !> The condition `abs(getFunc(lb), lf) < abstol` must hold for the corresponding input arguments.<br>
1551 : !> The condition `abs(getFunc(ub), uf) < abstol` must hold for the corresponding input arguments.<br>
1552 : !> The condition `sign(lf, 1.) /= sign(uf, 1.)` must hold for the corresponding input arguments.<br>
1553 : !> The condition `0 < niter` must hold for the corresponding input arguments.<br>
1554 : !> \vericons
1555 : !>
1556 : !> \warning
1557 : !> It is crucial to keep in mind that computers use a fixed number of binary digits to represent floating-point numbers.<br>
1558 : !> While the user-specified function might analytically pass through zero, it is possible that its computed value is never zero, for any floating-point argument.<br>
1559 : !> One must also decide on what accuracy on the root is attainable.<br>
1560 : !> For example, convergence to within \f$10^{−6}\f$ in absolute value is reasonable when the root lies near \f$1\f$,
1561 : !> but unachievable if the root lies near an extremely large number near floating-point overflow.<br>
1562 : !>
1563 : !> \impure
1564 : !>
1565 : !> \recursive
1566 : !>
1567 : !> \see
1568 : !> [getRoot](@ref pm_mathRoot::getRoot)<br>
1569 : !> [setRoot](@ref pm_mathRoot::setRoot)<br>
1570 : !> [getPolyRoot](@ref pm_polynomial::getPolyRoot)<br>
1571 : !> [setPolyRoot](@ref pm_polynomial::setPolyRoot)<br>
1572 : !>
1573 : !> \example{getRoot}
1574 : !> \include{lineno} example/pm_mathRoot/getRoot/main.F90
1575 : !> \compilef{getRoot}
1576 : !> \output{getRoot}
1577 : !> \include{lineno} example/pm_mathRoot/getRoot/main.out.F90
1578 : !>
1579 : !> \test
1580 : !> [test_pm_mathRoot](@ref test_pm_mathRoot)
1581 : !>
1582 : !> \finmain{getRoot}
1583 : !>
1584 : !> \author
1585 : !> \AmirShahmoradi, Oct 16, 2009, 11:14 AM, Michigan
1586 :
1587 : ! Default
1588 :
1589 : interface getRoot
1590 :
1591 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1592 :
1593 : #if RK5_ENABLED
1594 : recursive module function getRootDef_RK5(getFunc, lb, ub, abstol, neval, niter) result(root)
1595 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1596 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootDef_RK5
1597 : #endif
1598 : use pm_kind, only: RKC => RK5
1599 : procedure(real(RKC)) :: getFunc
1600 : real(RKC) , intent(in) :: lb, ub
1601 : real(RKC) , intent(in) , optional :: abstol
1602 : integer(IK) , intent(in) , optional :: niter
1603 : integer(IK) , intent(out) , optional :: neval
1604 : real(RKC) :: root
1605 : end function
1606 : #endif
1607 :
1608 : #if RK4_ENABLED
1609 : recursive module function getRootDef_RK4(getFunc, lb, ub, abstol, neval, niter) result(root)
1610 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1611 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootDef_RK4
1612 : #endif
1613 : use pm_kind, only: RKC => RK4
1614 : procedure(real(RKC)) :: getFunc
1615 : real(RKC) , intent(in) :: lb, ub
1616 : real(RKC) , intent(in) , optional :: abstol
1617 : integer(IK) , intent(in) , optional :: niter
1618 : integer(IK) , intent(out) , optional :: neval
1619 : real(RKC) :: root
1620 : end function
1621 : #endif
1622 :
1623 : #if RK3_ENABLED
1624 : recursive module function getRootDef_RK3(getFunc, lb, ub, abstol, neval, niter) result(root)
1625 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1626 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootDef_RK3
1627 : #endif
1628 : use pm_kind, only: RKC => RK3
1629 : procedure(real(RKC)) :: getFunc
1630 : real(RKC) , intent(in) :: lb, ub
1631 : real(RKC) , intent(in) , optional :: abstol
1632 : integer(IK) , intent(in) , optional :: niter
1633 : integer(IK) , intent(out) , optional :: neval
1634 : real(RKC) :: root
1635 : end function
1636 : #endif
1637 :
1638 : #if RK2_ENABLED
1639 : recursive module function getRootDef_RK2(getFunc, lb, ub, abstol, neval, niter) result(root)
1640 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1641 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootDef_RK2
1642 : #endif
1643 : use pm_kind, only: RKC => RK2
1644 : procedure(real(RKC)) :: getFunc
1645 : real(RKC) , intent(in) :: lb, ub
1646 : real(RKC) , intent(in) , optional :: abstol
1647 : integer(IK) , intent(in) , optional :: niter
1648 : integer(IK) , intent(out) , optional :: neval
1649 : real(RKC) :: root
1650 : end function
1651 : #endif
1652 :
1653 : #if RK1_ENABLED
1654 : recursive module function getRootDef_RK1(getFunc, lb, ub, abstol, neval, niter) result(root)
1655 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1656 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootDef_RK1
1657 : #endif
1658 : use pm_kind, only: RKC => RK1
1659 : procedure(real(RKC)) :: getFunc
1660 : real(RKC) , intent(in) :: lb, ub
1661 : real(RKC) , intent(in) , optional :: abstol
1662 : integer(IK) , intent(in) , optional :: niter
1663 : integer(IK) , intent(out) , optional :: neval
1664 : real(RKC) :: root
1665 : end function
1666 : #endif
1667 :
1668 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1669 :
1670 : end interface
1671 :
1672 : ! False
1673 :
1674 : interface getRoot
1675 :
1676 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1677 :
1678 : #if RK5_ENABLED
1679 : recursive module function getRootFalse_RK5(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1680 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1681 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootFalse_RK5
1682 : #endif
1683 : use pm_kind, only: RKC => RK5
1684 : procedure(real(RKC)) :: getFunc
1685 : type(false_type) , intent(in) :: method
1686 : real(RKC) , intent(in) :: lb, ub
1687 : real(RKC) , intent(in) , optional :: abstol
1688 : integer(IK) , intent(in) , optional :: niter
1689 : integer(IK) , intent(out) , optional :: neval
1690 : real(RKC) :: root
1691 : end function
1692 : #endif
1693 :
1694 : #if RK4_ENABLED
1695 : recursive module function getRootFalse_RK4(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1696 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1697 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootFalse_RK4
1698 : #endif
1699 : use pm_kind, only: RKC => RK4
1700 : procedure(real(RKC)) :: getFunc
1701 : type(false_type) , intent(in) :: method
1702 : real(RKC) , intent(in) :: lb, ub
1703 : real(RKC) , intent(in) , optional :: abstol
1704 : integer(IK) , intent(in) , optional :: niter
1705 : integer(IK) , intent(out) , optional :: neval
1706 : real(RKC) :: root
1707 : end function
1708 : #endif
1709 :
1710 : #if RK3_ENABLED
1711 : recursive module function getRootFalse_RK3(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1712 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1713 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootFalse_RK3
1714 : #endif
1715 : use pm_kind, only: RKC => RK3
1716 : procedure(real(RKC)) :: getFunc
1717 : type(false_type) , intent(in) :: method
1718 : real(RKC) , intent(in) :: lb, ub
1719 : real(RKC) , intent(in) , optional :: abstol
1720 : integer(IK) , intent(in) , optional :: niter
1721 : integer(IK) , intent(out) , optional :: neval
1722 : real(RKC) :: root
1723 : end function
1724 : #endif
1725 :
1726 : #if RK2_ENABLED
1727 : recursive module function getRootFalse_RK2(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1728 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1729 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootFalse_RK2
1730 : #endif
1731 : use pm_kind, only: RKC => RK2
1732 : procedure(real(RKC)) :: getFunc
1733 : type(false_type) , intent(in) :: method
1734 : real(RKC) , intent(in) :: lb, ub
1735 : real(RKC) , intent(in) , optional :: abstol
1736 : integer(IK) , intent(in) , optional :: niter
1737 : integer(IK) , intent(out) , optional :: neval
1738 : real(RKC) :: root
1739 : end function
1740 : #endif
1741 :
1742 : #if RK1_ENABLED
1743 : recursive module function getRootFalse_RK1(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1744 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1745 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootFalse_RK1
1746 : #endif
1747 : use pm_kind, only: RKC => RK1
1748 : procedure(real(RKC)) :: getFunc
1749 : type(false_type) , intent(in) :: method
1750 : real(RKC) , intent(in) :: lb, ub
1751 : real(RKC) , intent(in) , optional :: abstol
1752 : integer(IK) , intent(in) , optional :: niter
1753 : integer(IK) , intent(out) , optional :: neval
1754 : real(RKC) :: root
1755 : end function
1756 : #endif
1757 :
1758 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1759 :
1760 : end interface
1761 :
1762 : ! Bisection
1763 :
1764 : interface getRoot
1765 :
1766 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1767 :
1768 : #if RK5_ENABLED
1769 : recursive module function getRootBisection_RK5(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1770 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1771 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBisection_RK5
1772 : #endif
1773 : use pm_kind, only: RKC => RK5
1774 : procedure(real(RKC)) :: getFunc
1775 : type(bisection_type) , intent(in) :: method
1776 : real(RKC) , intent(in) :: lb, ub
1777 : real(RKC) , intent(in) , optional :: abstol
1778 : integer(IK) , intent(in) , optional :: niter
1779 : integer(IK) , intent(out) , optional :: neval
1780 : real(RKC) :: root
1781 : end function
1782 : #endif
1783 :
1784 : #if RK4_ENABLED
1785 : recursive module function getRootBisection_RK4(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1786 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1787 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBisection_RK4
1788 : #endif
1789 : use pm_kind, only: RKC => RK4
1790 : procedure(real(RKC)) :: getFunc
1791 : type(bisection_type) , intent(in) :: method
1792 : real(RKC) , intent(in) :: lb, ub
1793 : real(RKC) , intent(in) , optional :: abstol
1794 : integer(IK) , intent(in) , optional :: niter
1795 : integer(IK) , intent(out) , optional :: neval
1796 : real(RKC) :: root
1797 : end function
1798 : #endif
1799 :
1800 : #if RK3_ENABLED
1801 : recursive module function getRootBisection_RK3(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1802 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1803 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBisection_RK3
1804 : #endif
1805 : use pm_kind, only: RKC => RK3
1806 : procedure(real(RKC)) :: getFunc
1807 : type(bisection_type) , intent(in) :: method
1808 : real(RKC) , intent(in) :: lb, ub
1809 : real(RKC) , intent(in) , optional :: abstol
1810 : integer(IK) , intent(in) , optional :: niter
1811 : integer(IK) , intent(out) , optional :: neval
1812 : real(RKC) :: root
1813 : end function
1814 : #endif
1815 :
1816 : #if RK2_ENABLED
1817 : recursive module function getRootBisection_RK2(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1818 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1819 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBisection_RK2
1820 : #endif
1821 : use pm_kind, only: RKC => RK2
1822 : procedure(real(RKC)) :: getFunc
1823 : type(bisection_type) , intent(in) :: method
1824 : real(RKC) , intent(in) :: lb, ub
1825 : real(RKC) , intent(in) , optional :: abstol
1826 : integer(IK) , intent(in) , optional :: niter
1827 : integer(IK) , intent(out) , optional :: neval
1828 : real(RKC) :: root
1829 : end function
1830 : #endif
1831 :
1832 : #if RK1_ENABLED
1833 : recursive module function getRootBisection_RK1(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1834 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1835 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBisection_RK1
1836 : #endif
1837 : use pm_kind, only: RKC => RK1
1838 : procedure(real(RKC)) :: getFunc
1839 : type(bisection_type) , intent(in) :: method
1840 : real(RKC) , intent(in) :: lb, ub
1841 : real(RKC) , intent(in) , optional :: abstol
1842 : integer(IK) , intent(in) , optional :: niter
1843 : integer(IK) , intent(out) , optional :: neval
1844 : real(RKC) :: root
1845 : end function
1846 : #endif
1847 :
1848 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1849 :
1850 : end interface
1851 :
1852 : ! Secant
1853 :
1854 : interface getRoot
1855 :
1856 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1857 :
1858 : #if RK5_ENABLED
1859 : recursive module function getRootSecant_RK5(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1860 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1861 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSecant_RK5
1862 : #endif
1863 : use pm_kind, only: RKC => RK5
1864 : procedure(real(RKC)) :: getFunc
1865 : type(secant_type) , intent(in) :: method
1866 : real(RKC) , intent(in) :: lb, ub
1867 : real(RKC) , intent(in) , optional :: abstol
1868 : integer(IK) , intent(in) , optional :: niter
1869 : integer(IK) , intent(out) , optional :: neval
1870 : real(RKC) :: root
1871 : end function
1872 : #endif
1873 :
1874 : #if RK4_ENABLED
1875 : recursive module function getRootSecant_RK4(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1876 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1877 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSecant_RK4
1878 : #endif
1879 : use pm_kind, only: RKC => RK4
1880 : procedure(real(RKC)) :: getFunc
1881 : type(secant_type) , intent(in) :: method
1882 : real(RKC) , intent(in) :: lb, ub
1883 : real(RKC) , intent(in) , optional :: abstol
1884 : integer(IK) , intent(in) , optional :: niter
1885 : integer(IK) , intent(out) , optional :: neval
1886 : real(RKC) :: root
1887 : end function
1888 : #endif
1889 :
1890 : #if RK3_ENABLED
1891 : recursive module function getRootSecant_RK3(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1892 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1893 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSecant_RK3
1894 : #endif
1895 : use pm_kind, only: RKC => RK3
1896 : procedure(real(RKC)) :: getFunc
1897 : type(secant_type) , intent(in) :: method
1898 : real(RKC) , intent(in) :: lb, ub
1899 : real(RKC) , intent(in) , optional :: abstol
1900 : integer(IK) , intent(in) , optional :: niter
1901 : integer(IK) , intent(out) , optional :: neval
1902 : real(RKC) :: root
1903 : end function
1904 : #endif
1905 :
1906 : #if RK2_ENABLED
1907 : recursive module function getRootSecant_RK2(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1908 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1909 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSecant_RK2
1910 : #endif
1911 : use pm_kind, only: RKC => RK2
1912 : procedure(real(RKC)) :: getFunc
1913 : type(secant_type) , intent(in) :: method
1914 : real(RKC) , intent(in) :: lb, ub
1915 : real(RKC) , intent(in) , optional :: abstol
1916 : integer(IK) , intent(in) , optional :: niter
1917 : integer(IK) , intent(out) , optional :: neval
1918 : real(RKC) :: root
1919 : end function
1920 : #endif
1921 :
1922 : #if RK1_ENABLED
1923 : recursive module function getRootSecant_RK1(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1924 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1925 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSecant_RK1
1926 : #endif
1927 : use pm_kind, only: RKC => RK1
1928 : procedure(real(RKC)) :: getFunc
1929 : type(secant_type) , intent(in) :: method
1930 : real(RKC) , intent(in) :: lb, ub
1931 : real(RKC) , intent(in) , optional :: abstol
1932 : integer(IK) , intent(in) , optional :: niter
1933 : integer(IK) , intent(out) , optional :: neval
1934 : real(RKC) :: root
1935 : end function
1936 : #endif
1937 :
1938 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1939 :
1940 : end interface
1941 :
1942 : ! Brent
1943 :
1944 : interface getRoot
1945 :
1946 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1947 :
1948 : #if RK5_ENABLED
1949 : recursive module function getRootBrent_RK5(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1950 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1951 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBrent_RK5
1952 : #endif
1953 : use pm_kind, only: RKC => RK5
1954 : procedure(real(RKC)) :: getFunc
1955 : type(brent_type) , intent(in) :: method
1956 : real(RKC) , intent(in) :: lb, ub
1957 : real(RKC) , intent(in) , optional :: abstol
1958 : integer(IK) , intent(in) , optional :: niter
1959 : integer(IK) , intent(out) , optional :: neval
1960 : real(RKC) :: root
1961 : end function
1962 : #endif
1963 :
1964 : #if RK4_ENABLED
1965 : recursive module function getRootBrent_RK4(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1966 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1967 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBrent_RK4
1968 : #endif
1969 : use pm_kind, only: RKC => RK4
1970 : procedure(real(RKC)) :: getFunc
1971 : type(brent_type) , intent(in) :: method
1972 : real(RKC) , intent(in) :: lb, ub
1973 : real(RKC) , intent(in) , optional :: abstol
1974 : integer(IK) , intent(in) , optional :: niter
1975 : integer(IK) , intent(out) , optional :: neval
1976 : real(RKC) :: root
1977 : end function
1978 : #endif
1979 :
1980 : #if RK3_ENABLED
1981 : recursive module function getRootBrent_RK3(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1982 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1983 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBrent_RK3
1984 : #endif
1985 : use pm_kind, only: RKC => RK3
1986 : procedure(real(RKC)) :: getFunc
1987 : type(brent_type) , intent(in) :: method
1988 : real(RKC) , intent(in) :: lb, ub
1989 : real(RKC) , intent(in) , optional :: abstol
1990 : integer(IK) , intent(in) , optional :: niter
1991 : integer(IK) , intent(out) , optional :: neval
1992 : real(RKC) :: root
1993 : end function
1994 : #endif
1995 :
1996 : #if RK2_ENABLED
1997 : recursive module function getRootBrent_RK2(method, getFunc, lb, ub, abstol, neval, niter) result(root)
1998 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
1999 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBrent_RK2
2000 : #endif
2001 : use pm_kind, only: RKC => RK2
2002 : procedure(real(RKC)) :: getFunc
2003 : type(brent_type) , intent(in) :: method
2004 : real(RKC) , intent(in) :: lb, ub
2005 : real(RKC) , intent(in) , optional :: abstol
2006 : integer(IK) , intent(in) , optional :: niter
2007 : integer(IK) , intent(out) , optional :: neval
2008 : real(RKC) :: root
2009 : end function
2010 : #endif
2011 :
2012 : #if RK1_ENABLED
2013 : recursive module function getRootBrent_RK1(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2014 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2015 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootBrent_RK1
2016 : #endif
2017 : use pm_kind, only: RKC => RK1
2018 : procedure(real(RKC)) :: getFunc
2019 : type(brent_type) , intent(in) :: method
2020 : real(RKC) , intent(in) :: lb, ub
2021 : real(RKC) , intent(in) , optional :: abstol
2022 : integer(IK) , intent(in) , optional :: niter
2023 : integer(IK) , intent(out) , optional :: neval
2024 : real(RKC) :: root
2025 : end function
2026 : #endif
2027 :
2028 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2029 :
2030 : end interface
2031 :
2032 : ! Ridders
2033 :
2034 : interface getRoot
2035 :
2036 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2037 :
2038 : #if RK5_ENABLED
2039 : recursive module function getRootRidders_RK5(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2040 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2041 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootRidders_RK5
2042 : #endif
2043 : use pm_kind, only: RKC => RK5
2044 : procedure(real(RKC)) :: getFunc
2045 : type(ridders_type) , intent(in) :: method
2046 : real(RKC) , intent(in) :: lb, ub
2047 : real(RKC) , intent(in) , optional :: abstol
2048 : integer(IK) , intent(in) , optional :: niter
2049 : integer(IK) , intent(out) , optional :: neval
2050 : real(RKC) :: root
2051 : end function
2052 : #endif
2053 :
2054 : #if RK4_ENABLED
2055 : recursive module function getRootRidders_RK4(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2056 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2057 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootRidders_RK4
2058 : #endif
2059 : use pm_kind, only: RKC => RK4
2060 : procedure(real(RKC)) :: getFunc
2061 : type(ridders_type) , intent(in) :: method
2062 : real(RKC) , intent(in) :: lb, ub
2063 : real(RKC) , intent(in) , optional :: abstol
2064 : integer(IK) , intent(in) , optional :: niter
2065 : integer(IK) , intent(out) , optional :: neval
2066 : real(RKC) :: root
2067 : end function
2068 : #endif
2069 :
2070 : #if RK3_ENABLED
2071 : recursive module function getRootRidders_RK3(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2072 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2073 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootRidders_RK3
2074 : #endif
2075 : use pm_kind, only: RKC => RK3
2076 : procedure(real(RKC)) :: getFunc
2077 : type(ridders_type) , intent(in) :: method
2078 : real(RKC) , intent(in) :: lb, ub
2079 : real(RKC) , intent(in) , optional :: abstol
2080 : integer(IK) , intent(in) , optional :: niter
2081 : integer(IK) , intent(out) , optional :: neval
2082 : real(RKC) :: root
2083 : end function
2084 : #endif
2085 :
2086 : #if RK2_ENABLED
2087 : recursive module function getRootRidders_RK2(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2088 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2089 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootRidders_RK2
2090 : #endif
2091 : use pm_kind, only: RKC => RK2
2092 : procedure(real(RKC)) :: getFunc
2093 : type(ridders_type) , intent(in) :: method
2094 : real(RKC) , intent(in) :: lb, ub
2095 : real(RKC) , intent(in) , optional :: abstol
2096 : integer(IK) , intent(in) , optional :: niter
2097 : integer(IK) , intent(out) , optional :: neval
2098 : real(RKC) :: root
2099 : end function
2100 : #endif
2101 :
2102 : #if RK1_ENABLED
2103 : recursive module function getRootRidders_RK1(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2104 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2105 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootRidders_RK1
2106 : #endif
2107 : use pm_kind, only: RKC => RK1
2108 : procedure(real(RKC)) :: getFunc
2109 : type(ridders_type) , intent(in) :: method
2110 : real(RKC) , intent(in) :: lb, ub
2111 : real(RKC) , intent(in) , optional :: abstol
2112 : integer(IK) , intent(in) , optional :: niter
2113 : integer(IK) , intent(out) , optional :: neval
2114 : real(RKC) :: root
2115 : end function
2116 : #endif
2117 :
2118 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2119 :
2120 : end interface
2121 :
2122 : ! TOMS748
2123 :
2124 : interface getRoot
2125 :
2126 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2127 :
2128 : #if RK5_ENABLED
2129 : recursive module function getRootTOMS748_RK5(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2130 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2131 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootTOMS748_RK5
2132 : #endif
2133 : use pm_kind, only: RKC => RK5
2134 : procedure(real(RKC)) :: getFunc
2135 : type(toms748_type) , intent(in) :: method
2136 : real(RKC) , intent(in) :: lb, ub
2137 : real(RKC) , intent(in) , optional :: abstol
2138 : integer(IK) , intent(in) , optional :: niter
2139 : integer(IK) , intent(out) , optional :: neval
2140 : real(RKC) :: root
2141 : end function
2142 : #endif
2143 :
2144 : #if RK4_ENABLED
2145 : recursive module function getRootTOMS748_RK4(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2146 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2147 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootTOMS748_RK4
2148 : #endif
2149 : use pm_kind, only: RKC => RK4
2150 : procedure(real(RKC)) :: getFunc
2151 : type(toms748_type) , intent(in) :: method
2152 : real(RKC) , intent(in) :: lb, ub
2153 : real(RKC) , intent(in) , optional :: abstol
2154 : integer(IK) , intent(in) , optional :: niter
2155 : integer(IK) , intent(out) , optional :: neval
2156 : real(RKC) :: root
2157 : end function
2158 : #endif
2159 :
2160 : #if RK3_ENABLED
2161 : recursive module function getRootTOMS748_RK3(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2162 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2163 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootTOMS748_RK3
2164 : #endif
2165 : use pm_kind, only: RKC => RK3
2166 : procedure(real(RKC)) :: getFunc
2167 : type(toms748_type) , intent(in) :: method
2168 : real(RKC) , intent(in) :: lb, ub
2169 : real(RKC) , intent(in) , optional :: abstol
2170 : integer(IK) , intent(in) , optional :: niter
2171 : integer(IK) , intent(out) , optional :: neval
2172 : real(RKC) :: root
2173 : end function
2174 : #endif
2175 :
2176 : #if RK2_ENABLED
2177 : recursive module function getRootTOMS748_RK2(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2178 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2179 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootTOMS748_RK2
2180 : #endif
2181 : use pm_kind, only: RKC => RK2
2182 : procedure(real(RKC)) :: getFunc
2183 : type(toms748_type) , intent(in) :: method
2184 : real(RKC) , intent(in) :: lb, ub
2185 : real(RKC) , intent(in) , optional :: abstol
2186 : integer(IK) , intent(in) , optional :: niter
2187 : integer(IK) , intent(out) , optional :: neval
2188 : real(RKC) :: root
2189 : end function
2190 : #endif
2191 :
2192 : #if RK1_ENABLED
2193 : recursive module function getRootTOMS748_RK1(method, getFunc, lb, ub, abstol, neval, niter) result(root)
2194 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2195 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootTOMS748_RK1
2196 : #endif
2197 : use pm_kind, only: RKC => RK1
2198 : procedure(real(RKC)) :: getFunc
2199 : type(toms748_type) , intent(in) :: method
2200 : real(RKC) , intent(in) :: lb, ub
2201 : real(RKC) , intent(in) , optional :: abstol
2202 : integer(IK) , intent(in) , optional :: niter
2203 : integer(IK) , intent(out) , optional :: neval
2204 : real(RKC) :: root
2205 : end function
2206 : #endif
2207 :
2208 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2209 :
2210 : end interface
2211 :
2212 : ! Newton
2213 :
2214 : interface getRoot
2215 :
2216 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2217 :
2218 : #if RK5_ENABLED
2219 : recursive module function getRootNewton_RK5(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2220 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2221 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootNewton_RK5
2222 : #endif
2223 : use pm_kind, only: RKC => RK5
2224 : procedure(real(RKC)) :: getFunc
2225 : type(newton_type) , intent(in) :: method
2226 : real(RKC) , intent(in) :: lb, ub
2227 : real(RKC) , intent(in) , optional :: abstol
2228 : integer(IK) , intent(in) , optional :: niter
2229 : integer(IK) , intent(out) , optional :: neval
2230 : real(RKC) , intent(in) , optional :: init
2231 : real(RKC) :: root
2232 : end function
2233 : #endif
2234 :
2235 : #if RK4_ENABLED
2236 : recursive module function getRootNewton_RK4(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2237 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2238 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootNewton_RK4
2239 : #endif
2240 : use pm_kind, only: RKC => RK4
2241 : procedure(real(RKC)) :: getFunc
2242 : type(newton_type) , intent(in) :: method
2243 : real(RKC) , intent(in) :: lb, ub
2244 : real(RKC) , intent(in) , optional :: abstol
2245 : integer(IK) , intent(in) , optional :: niter
2246 : integer(IK) , intent(out) , optional :: neval
2247 : real(RKC) , intent(in) , optional :: init
2248 : real(RKC) :: root
2249 : end function
2250 : #endif
2251 :
2252 : #if RK3_ENABLED
2253 : recursive module function getRootNewton_RK3(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2254 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2255 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootNewton_RK3
2256 : #endif
2257 : use pm_kind, only: RKC => RK3
2258 : procedure(real(RKC)) :: getFunc
2259 : type(newton_type) , intent(in) :: method
2260 : real(RKC) , intent(in) :: lb, ub
2261 : real(RKC) , intent(in) , optional :: abstol
2262 : integer(IK) , intent(in) , optional :: niter
2263 : integer(IK) , intent(out) , optional :: neval
2264 : real(RKC) , intent(in) , optional :: init
2265 : real(RKC) :: root
2266 : end function
2267 : #endif
2268 :
2269 : #if RK2_ENABLED
2270 : recursive module function getRootNewton_RK2(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2271 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2272 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootNewton_RK2
2273 : #endif
2274 : use pm_kind, only: RKC => RK2
2275 : procedure(real(RKC)) :: getFunc
2276 : type(newton_type) , intent(in) :: method
2277 : real(RKC) , intent(in) :: lb, ub
2278 : real(RKC) , intent(in) , optional :: abstol
2279 : integer(IK) , intent(in) , optional :: niter
2280 : integer(IK) , intent(out) , optional :: neval
2281 : real(RKC) , intent(in) , optional :: init
2282 : real(RKC) :: root
2283 : end function
2284 : #endif
2285 :
2286 : #if RK1_ENABLED
2287 : recursive module function getRootNewton_RK1(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2288 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2289 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootNewton_RK1
2290 : #endif
2291 : use pm_kind, only: RKC => RK1
2292 : procedure(real(RKC)) :: getFunc
2293 : type(newton_type) , intent(in) :: method
2294 : real(RKC) , intent(in) :: lb, ub
2295 : real(RKC) , intent(in) , optional :: abstol
2296 : integer(IK) , intent(in) , optional :: niter
2297 : integer(IK) , intent(out) , optional :: neval
2298 : real(RKC) , intent(in) , optional :: init
2299 : real(RKC) :: root
2300 : end function
2301 : #endif
2302 :
2303 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2304 :
2305 : end interface
2306 :
2307 : ! Halley
2308 :
2309 : interface getRoot
2310 :
2311 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2312 :
2313 : #if RK5_ENABLED
2314 : recursive module function getRootHalley_RK5(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2315 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2316 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootHalley_RK5
2317 : #endif
2318 : use pm_kind, only: RKC => RK5
2319 : procedure(real(RKC)) :: getFunc
2320 : type(halley_type) , intent(in) :: method
2321 : real(RKC) , intent(in) :: lb, ub
2322 : real(RKC) , intent(in) , optional :: abstol
2323 : integer(IK) , intent(in) , optional :: niter
2324 : integer(IK) , intent(out) , optional :: neval
2325 : real(RKC) , intent(in) , optional :: init
2326 : real(RKC) :: root
2327 : end function
2328 : #endif
2329 :
2330 : #if RK4_ENABLED
2331 : recursive module function getRootHalley_RK4(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2332 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2333 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootHalley_RK4
2334 : #endif
2335 : use pm_kind, only: RKC => RK4
2336 : procedure(real(RKC)) :: getFunc
2337 : type(halley_type) , intent(in) :: method
2338 : real(RKC) , intent(in) :: lb, ub
2339 : real(RKC) , intent(in) , optional :: abstol
2340 : integer(IK) , intent(in) , optional :: niter
2341 : integer(IK) , intent(out) , optional :: neval
2342 : real(RKC) , intent(in) , optional :: init
2343 : real(RKC) :: root
2344 : end function
2345 : #endif
2346 :
2347 : #if RK3_ENABLED
2348 : recursive module function getRootHalley_RK3(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2349 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2350 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootHalley_RK3
2351 : #endif
2352 : use pm_kind, only: RKC => RK3
2353 : procedure(real(RKC)) :: getFunc
2354 : type(halley_type) , intent(in) :: method
2355 : real(RKC) , intent(in) :: lb, ub
2356 : real(RKC) , intent(in) , optional :: abstol
2357 : integer(IK) , intent(in) , optional :: niter
2358 : integer(IK) , intent(out) , optional :: neval
2359 : real(RKC) , intent(in) , optional :: init
2360 : real(RKC) :: root
2361 : end function
2362 : #endif
2363 :
2364 : #if RK2_ENABLED
2365 : recursive module function getRootHalley_RK2(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2366 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2367 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootHalley_RK2
2368 : #endif
2369 : use pm_kind, only: RKC => RK2
2370 : procedure(real(RKC)) :: getFunc
2371 : type(halley_type) , intent(in) :: method
2372 : real(RKC) , intent(in) :: lb, ub
2373 : real(RKC) , intent(in) , optional :: abstol
2374 : integer(IK) , intent(in) , optional :: niter
2375 : integer(IK) , intent(out) , optional :: neval
2376 : real(RKC) , intent(in) , optional :: init
2377 : real(RKC) :: root
2378 : end function
2379 : #endif
2380 :
2381 : #if RK1_ENABLED
2382 : recursive module function getRootHalley_RK1(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2383 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2384 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootHalley_RK1
2385 : #endif
2386 : use pm_kind, only: RKC => RK1
2387 : procedure(real(RKC)) :: getFunc
2388 : type(halley_type) , intent(in) :: method
2389 : real(RKC) , intent(in) :: lb, ub
2390 : real(RKC) , intent(in) , optional :: abstol
2391 : integer(IK) , intent(in) , optional :: niter
2392 : integer(IK) , intent(out) , optional :: neval
2393 : real(RKC) , intent(in) , optional :: init
2394 : real(RKC) :: root
2395 : end function
2396 : #endif
2397 :
2398 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2399 :
2400 : end interface
2401 :
2402 : ! Schroder
2403 :
2404 : interface getRoot
2405 :
2406 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2407 :
2408 : #if RK5_ENABLED
2409 : recursive module function getRootSchroder_RK5(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2410 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2411 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSchroder_RK5
2412 : #endif
2413 : use pm_kind, only: RKC => RK5
2414 : procedure(real(RKC)) :: getFunc
2415 : type(schroder_type) , intent(in) :: method
2416 : real(RKC) , intent(in) :: lb, ub
2417 : real(RKC) , intent(in) , optional :: abstol
2418 : integer(IK) , intent(in) , optional :: niter
2419 : integer(IK) , intent(out) , optional :: neval
2420 : real(RKC) , intent(in) , optional :: init
2421 : real(RKC) :: root
2422 : end function
2423 : #endif
2424 :
2425 : #if RK4_ENABLED
2426 : recursive module function getRootSchroder_RK4(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2427 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2428 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSchroder_RK4
2429 : #endif
2430 : use pm_kind, only: RKC => RK4
2431 : procedure(real(RKC)) :: getFunc
2432 : type(schroder_type) , intent(in) :: method
2433 : real(RKC) , intent(in) :: lb, ub
2434 : real(RKC) , intent(in) , optional :: abstol
2435 : integer(IK) , intent(in) , optional :: niter
2436 : integer(IK) , intent(out) , optional :: neval
2437 : real(RKC) , intent(in) , optional :: init
2438 : real(RKC) :: root
2439 : end function
2440 : #endif
2441 :
2442 : #if RK3_ENABLED
2443 : recursive module function getRootSchroder_RK3(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2444 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2445 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSchroder_RK3
2446 : #endif
2447 : use pm_kind, only: RKC => RK3
2448 : procedure(real(RKC)) :: getFunc
2449 : type(schroder_type) , intent(in) :: method
2450 : real(RKC) , intent(in) :: lb, ub
2451 : real(RKC) , intent(in) , optional :: abstol
2452 : integer(IK) , intent(in) , optional :: niter
2453 : integer(IK) , intent(out) , optional :: neval
2454 : real(RKC) , intent(in) , optional :: init
2455 : real(RKC) :: root
2456 : end function
2457 : #endif
2458 :
2459 : #if RK2_ENABLED
2460 : recursive module function getRootSchroder_RK2(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2461 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2462 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSchroder_RK2
2463 : #endif
2464 : use pm_kind, only: RKC => RK2
2465 : procedure(real(RKC)) :: getFunc
2466 : type(schroder_type) , intent(in) :: method
2467 : real(RKC) , intent(in) :: lb, ub
2468 : real(RKC) , intent(in) , optional :: abstol
2469 : integer(IK) , intent(in) , optional :: niter
2470 : integer(IK) , intent(out) , optional :: neval
2471 : real(RKC) , intent(in) , optional :: init
2472 : real(RKC) :: root
2473 : end function
2474 : #endif
2475 :
2476 : #if RK1_ENABLED
2477 : recursive module function getRootSchroder_RK1(method, getFunc, lb, ub, abstol, neval, niter, init) result(root)
2478 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2479 : !DEC$ ATTRIBUTES DLLEXPORT :: getRootSchroder_RK1
2480 : #endif
2481 : use pm_kind, only: RKC => RK1
2482 : procedure(real(RKC)) :: getFunc
2483 : type(schroder_type) , intent(in) :: method
2484 : real(RKC) , intent(in) :: lb, ub
2485 : real(RKC) , intent(in) , optional :: abstol
2486 : integer(IK) , intent(in) , optional :: niter
2487 : integer(IK) , intent(out) , optional :: neval
2488 : real(RKC) , intent(in) , optional :: init
2489 : real(RKC) :: root
2490 : end function
2491 : #endif
2492 :
2493 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2494 :
2495 : end interface
2496 :
2497 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2498 :
2499 : !> \brief
2500 : !> Return a root of a specified continuous real-valued one-dimensional
2501 : !> mathematical function such that \f$f(\mathrm{root}) = 0\f$ with the user-specified or the default root-finding method.<br>
2502 : !>
2503 : !> \details
2504 : !> See the documentation of [pm_mathRoot](@ref pm_mathRoot) for details of the various root-finding methods.<br>
2505 : !>
2506 : !> \note
2507 : !> <b>Which root-finding method should I use among all available?</b><br>
2508 : !> The [brent](@ref pm_mathRoot::brent) method is the recommended **algorithm of choice**
2509 : !> for general one-dimensional root-finding problems **without** knowledge of function **derivative** (gradient).<br>
2510 : !> The [Newton-Raphson method](@ref pm_mathRoot::newton) is the recommended **algorithm of choice**
2511 : !> for general one-dimensional root-finding problems **with** knowledge of function **derivative** (gradient).<br>
2512 : !>
2513 : !> \param[in] method : The input scalar constant that can be one of the following:<br>
2514 : !> <ol>
2515 : !> <li> The constant [false](@ref pm_mathRoot::false) or an object of type [false_type](@ref pm_mathRoot::false_type),
2516 : !> signifying the use of the **False-Position** root-finding method within the algorithm.<br>
2517 : !> <li> The constant [bisection](@ref pm_mathRoot::bisection) or an object of type [bisection_type](@ref pm_mathRoot::bisection_type),
2518 : !> signifying the use of the **Bisection** root-finding method within the algorithm.<br>
2519 : !> <li> The constant [secant](@ref pm_mathRoot::secant) or an object of type [secant_type](@ref pm_mathRoot::secant_type),
2520 : !> signifying the use of the **Secant** root-finding method within the algorithm.<br>
2521 : !> <li> The constant [brent](@ref pm_mathRoot::brent) or an object of type [brent_type](@ref pm_mathRoot::brent_type),
2522 : !> signifying the use of the **Brent** root-finding method within the algorithm.<br>
2523 : !> <li> The constant [ridders](@ref pm_mathRoot::ridders) or an object of type [ridders_type](@ref pm_mathRoot::ridders_type),
2524 : !> signifying the use of the **Ridders** root-finding method within the algorithm.<br>
2525 : !> <li> The constant [toms748](@ref pm_mathRoot::toms748) or an object of type [toms748_type](@ref pm_mathRoot::toms748_type),
2526 : !> signifying the use of the **TOMS748** root-finding method within the algorithm.<br>
2527 : !> <li> The constant [newton](@ref pm_mathRoot::newton) or an object of type [newton_type](@ref pm_mathRoot::newton_type),
2528 : !> signifying the use of the **Newton** root-finding method within the algorithm.<br>
2529 : !> <li> The constant [halley](@ref pm_mathRoot::halley) or an object of type [halley_type](@ref pm_mathRoot::halley_type),
2530 : !> signifying the use of the **Halley** root-finding method within the algorithm.<br>
2531 : !> <li> The constant [schroder](@ref pm_mathRoot::schroder) or an object of type [schroder_type](@ref pm_mathRoot::schroder_type),
2532 : !> signifying the use of the **Schroder** root-finding method within the algorithm.<br>
2533 : !> </ol>
2534 : !> \param[in] getFunc : The `external` user-specified function whose interface depends on the specified value for the input argument `method`.<br>
2535 : !> <ol>
2536 : !> <li> If the specified `method` is any of the following,<br>
2537 : !> <ol>
2538 : !> <li> the constant [brent](@ref pm_mathRoot::brent) or an object of type [brent_type](@ref pm_mathRoot::brent_type),<br>
2539 : !> <li> the constant [false](@ref pm_mathRoot::false) or an object of type [false_type](@ref pm_mathRoot::false_type),<br>
2540 : !> <li> the constant [secant](@ref pm_mathRoot::secant) or an object of type [secant_type](@ref pm_mathRoot::secant_type),<br>
2541 : !> <li> the constant [ridders](@ref pm_mathRoot::ridders) or an object of type [ridders_type](@ref pm_mathRoot::ridders_type),<br>
2542 : !> <li> the constant [toms748](@ref pm_mathRoot::toms748) or an object of type [toms748_type](@ref pm_mathRoot::toms748_type),<br>
2543 : !> <li> the constant [bisection](@ref pm_mathRoot::bisection) or an object of type [bisection_type](@ref pm_mathRoot::bisection_type),<br>
2544 : !> </ol>
2545 : !> none of which require the derivative of the target function to find the function root,
2546 : !> then `getFunc()` must take a single scalar input argument `x` of the same type and kind as the output argument `root` (below).<br>
2547 : !> On output, `getFunc()` must return a scalar of the same type and kind as the function input argument `x`,
2548 : !> containing the value of the target function evaluated at the specified input `x`.<br>
2549 : !> The following illustrates the generic interface of `getFunc()` for the above values of `method`,
2550 : !> \code{.F90}
2551 : !> function getFunc(x) result(func)
2552 : !> real(RKC) , intent(in) :: x
2553 : !> real(RKC) :: func
2554 : !> end function
2555 : !> \endcode
2556 : !> where `RKC` refers to the kind of the output argument `root`.<br>
2557 : !> <li> If the specified `method` is any of the following,
2558 : !> <ol>
2559 : !> <li> the constant [newton](@ref pm_mathRoot::newton) or an object of type [newton_type](@ref pm_mathRoot::newton_type),<br>
2560 : !> <li> the constant [halley](@ref pm_mathRoot::halley) or an object of type [halley_type](@ref pm_mathRoot::halley_type),<br>
2561 : !> <li> the constant [schroder](@ref pm_mathRoot::schroder) or an object of type [schroder_type](@ref pm_mathRoot::schroder_type),<br>
2562 : !> </ol>
2563 : !> all of which either require the first (Newton) or higher derivatives (Halley/Schroder) of the target function to find the function root,
2564 : !> then `getFunc()` must take a two arguments:<br>
2565 : !> <ol>
2566 : !> <li> A scalar input argument `x` of the same type and kind as the output argument `root` (below).<br>
2567 : !> <li> A scalar input argument `order` of type `integer` of default kind \IK.<br>
2568 : !> </ol>
2569 : !> On output, `getFunc()` must return a scalar of the same type and kind as the function input argument `x`,
2570 : !> containing the derivative of the specified input `order` of the target function evaluated at the specified input `x`:<br>
2571 : !> <ol>
2572 : !> <li> An input `order` value of `0` must yield the target function value at the input `x`.<br>
2573 : !> <li> An input `order` value of `1` must yield the target function first derivative at the input `x`.<br>
2574 : !> <li> An input `order` value of `1` must yield the target function second derivative at the input `x`.<br>
2575 : !> </ol>
2576 : !> The following illustrates the generic interface of `getFunc()` for the above values of `method`,
2577 : !> \code{.F90}
2578 : !> function getFunc(x, order) result(func)
2579 : !> real(RKC) , intent(in) :: x
2580 : !> integer(IK) , intent(in) :: order
2581 : !> real(RKC) :: func
2582 : !> end function
2583 : !> \endcode
2584 : !> where `RKC` refers to the kind of the output argument `root`.<br>
2585 : !> </ol>
2586 : !> \param[inout] root : The input/output scalar of type `real` of kind \RKALL.<br>
2587 : !> On input,<br>
2588 : !> <ol>
2589 : !> <li> If the specified `method` is of type [newton_type](@ref pm_mathRoot::newton_type) or [halley_type](@ref pm_mathRoot::halley_type),
2590 : !> and if `lb < root .and. root <ub`, then the specified input value for `root` will be used as the best guess initial value
2591 : !> for the function `root` within the bracket specified by the input arguments `lb` and `ub`.<br>
2592 : !> Otherwise the center of the specifie dinput bracket `[lb, ub]` wil be used as the initial best-guess.<br>
2593 : !> <li> Any input value for `root` is ignored for all other root-finding methods.<br>
2594 : !> </ol>
2595 : !> On output, `root` contains the best approximation to the root of the user-specified
2596 : !> function `getFunc()` within the specified search interval `[lb, ub]` and tolerance threshold `abstol`.<br>
2597 : !> \param[in] lb : The input scalar of same type and kind as the output `root`, representing the lower bound of the bracket (search) interval.<br>
2598 : !> \param[in] ub : The input scalar of same type and kind as the output `root`, representing the upper bound of the bracket (search) interval.<br>
2599 : !> \param[in] abstol : The input scalar of same type and kind as the output `root`, representing the absolute tolerance used as the stopping criterion of the search.<br>
2600 : !> The iterations of the specified input `method` continue until the search interval becomes smaller than `abstol` in absolute units.<br>
2601 : !> Care must be taken for specifying a reasonable value for `abstol` (see the warnings below).<br>
2602 : !> If no suitable value for `abstol` is known a priori, try `abstol = epsilon(0._RKC)**.8 * (abs(lb) + abs(ub))`
2603 : !> where `RKC` refers to the kind of the output argument `root`.<br>
2604 : !> \param[out] neval : The output scalar argument of type `integer` of default kind \IK, containing the total number of `getFunc()` function calls made by the algorithm.<br>
2605 : !> <ol>
2606 : !> <li> A positive output `neval` implies the **successful** convergence of the algorithm to the function root after `+neval` function evaluations.<br>
2607 : !> <li> A negative output `neval` implies the **failure** of convergence of the algorithm to the function root after `-neval` function evaluations.<br>
2608 : !> <li> A zero output `neval` only occurs if the root lies at the search bracket boundaries specified by the input argument `lb` or `ub`.<br>
2609 : !> </ol>
2610 : !> Convergence failures rarely occur. If they do, setting the input arguments `abstol` and/or `niter` to larger values may resolve the failure.<br>
2611 : !> \param[in] niter : The input scalar of type `integer` of default kind \IK, representing the **maximum number of iterations allowed** for the specified `method` to find the root.<br>
2612 : !> The default number of steps `niter` within the algorithm is a compile-time constant that depends on the `kind` of the `real` input arguments.<br>
2613 : !> (**optional**, default = `ceiling(2 * precision(lb) / log10(2.))`)
2614 : !>
2615 : !> \interface{setRoot}
2616 : !> \code{.F90}
2617 : !>
2618 : !> use pm_mathRoot, only: setRoot
2619 : !>
2620 : !> call setRoot(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2621 : !> call setRoot(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2622 : !>
2623 : !> \endcode
2624 : !>
2625 : !> \warning
2626 : !> The condition `lb < ub` must hold for the corresponding input arguments.<br>
2627 : !> The condition `0._RKC < abstol` must hold for the corresponding input arguments.<br>
2628 : !> The condition `abstol < (ub - lb)` must hold for the corresponding input arguments.<br>
2629 : !> The condition `abs(getFunc(lb), lf) < abstol` must hold for the corresponding input arguments.<br>
2630 : !> The condition `abs(getFunc(ub), uf) < abstol` must hold for the corresponding input arguments.<br>
2631 : !> The condition `sign(lf, 1.) /= sign(uf, 1.)` must hold for the corresponding input arguments.<br>
2632 : !> The condition `0 < niter` must hold for the corresponding input arguments.<br>
2633 : !> \vericons
2634 : !>
2635 : !> \warning
2636 : !> It is crucial to keep in mind that computers use a fixed number of binary digits to represent floating-point numbers.<br>
2637 : !> While the user-specified function might analytically pass through zero, it is possible that its computed value is never zero, for any floating-point argument.<br>
2638 : !> One must also decide on what accuracy on the root is attainable.<br>
2639 : !> For example, convergence to within \f$10^{−6}\f$ in absolute value is reasonable when the root lies near \f$1\f$,
2640 : !> but unachievable if the root lies near an extremely large number near floating-point overflow.<br>
2641 : !>
2642 : !> \impure
2643 : !>
2644 : !> \recursive
2645 : !>
2646 : !> \see
2647 : !> [getRoot](@ref pm_mathRoot::getRoot)<br>
2648 : !> [setRoot](@ref pm_mathRoot::setRoot)<br>
2649 : !> [getPolyRoot](@ref pm_polynomial::getPolyRoot)<br>
2650 : !> [setPolyRoot](@ref pm_polynomial::setPolyRoot)<br>
2651 : !>
2652 : !> \example{setRoot}
2653 : !> \include{lineno} example/pm_mathRoot/setRoot/main.F90
2654 : !> \compilef{setRoot}
2655 : !> \output{setRoot}
2656 : !> \include{lineno} example/pm_mathRoot/setRoot/main.out.F90
2657 : !>
2658 : !> \test
2659 : !> [test_pm_mathRoot](@ref test_pm_mathRoot)
2660 : !>
2661 : !> \todo
2662 : !> \phigh
2663 : !> The current implementation of the Schroder method does not converge for **certain problems** that the Halley method converges readily.<br>
2664 : !> This may be due to the nature of the Schroder update.<br>
2665 : !> Regardless, this should be further investigated.<br>
2666 : !> For now, Schroder is diverted to Halley.<br>
2667 : !>
2668 : !> \finmain{setRoot}
2669 : !>
2670 : !> \author
2671 : !> \AmirShahmoradi, Oct 16, 2009, 11:14 AM, Michigan
2672 :
2673 : ! False
2674 :
2675 : interface setRoot
2676 :
2677 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2678 :
2679 : #if RK5_ENABLED
2680 : recursive module subroutine setRootFalseFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2681 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2682 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseFixed_RK5
2683 : #endif
2684 : use pm_kind, only: RKC => RK5
2685 : procedure(real(RKC)) :: getFunc
2686 : type(false_type) , intent(in) :: method
2687 : real(RKC) , intent(out) :: root
2688 : real(RKC) , value :: lb, ub
2689 : real(RKC) , value :: lf, uf
2690 : real(RKC) , intent(in) :: abstol
2691 : integer(IK) , intent(out) :: neval
2692 : end subroutine
2693 : #endif
2694 :
2695 : #if RK4_ENABLED
2696 : recursive module subroutine setRootFalseFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2697 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2698 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseFixed_RK4
2699 : #endif
2700 : use pm_kind, only: RKC => RK4
2701 : procedure(real(RKC)) :: getFunc
2702 : type(false_type) , intent(in) :: method
2703 : real(RKC) , intent(out) :: root
2704 : real(RKC) , value :: lb, ub
2705 : real(RKC) , value :: lf, uf
2706 : real(RKC) , intent(in) :: abstol
2707 : integer(IK) , intent(out) :: neval
2708 : end subroutine
2709 : #endif
2710 :
2711 : #if RK3_ENABLED
2712 : recursive module subroutine setRootFalseFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2713 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2714 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseFixed_RK3
2715 : #endif
2716 : use pm_kind, only: RKC => RK3
2717 : procedure(real(RKC)) :: getFunc
2718 : type(false_type) , intent(in) :: method
2719 : real(RKC) , intent(out) :: root
2720 : real(RKC) , value :: lb, ub
2721 : real(RKC) , value :: lf, uf
2722 : real(RKC) , intent(in) :: abstol
2723 : integer(IK) , intent(out) :: neval
2724 : end subroutine
2725 : #endif
2726 :
2727 : #if RK2_ENABLED
2728 : recursive module subroutine setRootFalseFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2729 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2730 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseFixed_RK2
2731 : #endif
2732 : use pm_kind, only: RKC => RK2
2733 : procedure(real(RKC)) :: getFunc
2734 : type(false_type) , intent(in) :: method
2735 : real(RKC) , intent(out) :: root
2736 : real(RKC) , value :: lb, ub
2737 : real(RKC) , value :: lf, uf
2738 : real(RKC) , intent(in) :: abstol
2739 : integer(IK) , intent(out) :: neval
2740 : end subroutine
2741 : #endif
2742 :
2743 : #if RK1_ENABLED
2744 : recursive module subroutine setRootFalseFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2745 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2746 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseFixed_RK1
2747 : #endif
2748 : use pm_kind, only: RKC => RK1
2749 : procedure(real(RKC)) :: getFunc
2750 : type(false_type) , intent(in) :: method
2751 : real(RKC) , intent(out) :: root
2752 : real(RKC) , value :: lb, ub
2753 : real(RKC) , value :: lf, uf
2754 : real(RKC) , intent(in) :: abstol
2755 : integer(IK) , intent(out) :: neval
2756 : end subroutine
2757 : #endif
2758 :
2759 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2760 :
2761 : #if RK5_ENABLED
2762 : recursive module subroutine setRootFalseNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2763 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2764 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseNiter_RK5
2765 : #endif
2766 : use pm_kind, only: RKC => RK5
2767 : procedure(real(RKC)) :: getFunc
2768 : type(false_type) , intent(in) :: method
2769 : real(RKC) , intent(out) :: root
2770 : real(RKC) , value :: lb, ub
2771 : real(RKC) , value :: lf, uf
2772 : real(RKC) , intent(in) :: abstol
2773 : integer(IK) , intent(out) :: neval
2774 : integer(IK) , intent(in) :: niter
2775 : end subroutine
2776 : #endif
2777 :
2778 : #if RK4_ENABLED
2779 : recursive module subroutine setRootFalseNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2780 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2781 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseNiter_RK4
2782 : #endif
2783 : use pm_kind, only: RKC => RK4
2784 : procedure(real(RKC)) :: getFunc
2785 : type(false_type) , intent(in) :: method
2786 : real(RKC) , intent(out) :: root
2787 : real(RKC) , value :: lb, ub
2788 : real(RKC) , value :: lf, uf
2789 : real(RKC) , intent(in) :: abstol
2790 : integer(IK) , intent(out) :: neval
2791 : integer(IK) , intent(in) :: niter
2792 : end subroutine
2793 : #endif
2794 :
2795 : #if RK3_ENABLED
2796 : recursive module subroutine setRootFalseNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2797 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2798 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseNiter_RK3
2799 : #endif
2800 : use pm_kind, only: RKC => RK3
2801 : procedure(real(RKC)) :: getFunc
2802 : type(false_type) , intent(in) :: method
2803 : real(RKC) , intent(out) :: root
2804 : real(RKC) , value :: lb, ub
2805 : real(RKC) , value :: lf, uf
2806 : real(RKC) , intent(in) :: abstol
2807 : integer(IK) , intent(out) :: neval
2808 : integer(IK) , intent(in) :: niter
2809 : end subroutine
2810 : #endif
2811 :
2812 : #if RK2_ENABLED
2813 : recursive module subroutine setRootFalseNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2814 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2815 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseNiter_RK2
2816 : #endif
2817 : use pm_kind, only: RKC => RK2
2818 : procedure(real(RKC)) :: getFunc
2819 : type(false_type) , intent(in) :: method
2820 : real(RKC) , intent(out) :: root
2821 : real(RKC) , value :: lb, ub
2822 : real(RKC) , value :: lf, uf
2823 : real(RKC) , intent(in) :: abstol
2824 : integer(IK) , intent(out) :: neval
2825 : integer(IK) , intent(in) :: niter
2826 : end subroutine
2827 : #endif
2828 :
2829 : #if RK1_ENABLED
2830 : recursive module subroutine setRootFalseNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2831 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2832 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootFalseNiter_RK1
2833 : #endif
2834 : use pm_kind, only: RKC => RK1
2835 : procedure(real(RKC)) :: getFunc
2836 : type(false_type) , intent(in) :: method
2837 : real(RKC) , intent(out) :: root
2838 : real(RKC) , value :: lb, ub
2839 : real(RKC) , value :: lf, uf
2840 : real(RKC) , intent(in) :: abstol
2841 : integer(IK) , intent(out) :: neval
2842 : integer(IK) , intent(in) :: niter
2843 : end subroutine
2844 : #endif
2845 :
2846 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2847 :
2848 : end interface
2849 :
2850 : ! Bisection
2851 :
2852 : interface setRoot
2853 :
2854 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2855 :
2856 : #if RK5_ENABLED
2857 : recursive module subroutine setRootBisectionFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2858 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2859 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionFixed_RK5
2860 : #endif
2861 : use pm_kind, only: RKC => RK5
2862 : procedure(real(RKC)) :: getFunc
2863 : type(bisection_type) , intent(in) :: method
2864 : real(RKC) , intent(out) :: root
2865 : real(RKC) , value :: lb, ub
2866 : real(RKC) , value :: lf, uf
2867 : real(RKC) , intent(in) :: abstol
2868 : integer(IK) , intent(out) :: neval
2869 : end subroutine
2870 : #endif
2871 :
2872 : #if RK4_ENABLED
2873 : recursive module subroutine setRootBisectionFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2874 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2875 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionFixed_RK4
2876 : #endif
2877 : use pm_kind, only: RKC => RK4
2878 : procedure(real(RKC)) :: getFunc
2879 : type(bisection_type) , intent(in) :: method
2880 : real(RKC) , intent(out) :: root
2881 : real(RKC) , value :: lb, ub
2882 : real(RKC) , value :: lf, uf
2883 : real(RKC) , intent(in) :: abstol
2884 : integer(IK) , intent(out) :: neval
2885 : end subroutine
2886 : #endif
2887 :
2888 : #if RK3_ENABLED
2889 : recursive module subroutine setRootBisectionFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2890 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2891 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionFixed_RK3
2892 : #endif
2893 : use pm_kind, only: RKC => RK3
2894 : procedure(real(RKC)) :: getFunc
2895 : type(bisection_type) , intent(in) :: method
2896 : real(RKC) , intent(out) :: root
2897 : real(RKC) , value :: lb, ub
2898 : real(RKC) , value :: lf, uf
2899 : real(RKC) , intent(in) :: abstol
2900 : integer(IK) , intent(out) :: neval
2901 : end subroutine
2902 : #endif
2903 :
2904 : #if RK2_ENABLED
2905 : recursive module subroutine setRootBisectionFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2906 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2907 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionFixed_RK2
2908 : #endif
2909 : use pm_kind, only: RKC => RK2
2910 : procedure(real(RKC)) :: getFunc
2911 : type(bisection_type) , intent(in) :: method
2912 : real(RKC) , intent(out) :: root
2913 : real(RKC) , value :: lb, ub
2914 : real(RKC) , value :: lf, uf
2915 : real(RKC) , intent(in) :: abstol
2916 : integer(IK) , intent(out) :: neval
2917 : end subroutine
2918 : #endif
2919 :
2920 : #if RK1_ENABLED
2921 : recursive module subroutine setRootBisectionFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
2922 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2923 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionFixed_RK1
2924 : #endif
2925 : use pm_kind, only: RKC => RK1
2926 : procedure(real(RKC)) :: getFunc
2927 : type(bisection_type) , intent(in) :: method
2928 : real(RKC) , intent(out) :: root
2929 : real(RKC) , value :: lb, ub
2930 : real(RKC) , value :: lf, uf
2931 : real(RKC) , intent(in) :: abstol
2932 : integer(IK) , intent(out) :: neval
2933 : end subroutine
2934 : #endif
2935 :
2936 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2937 :
2938 : #if RK5_ENABLED
2939 : recursive module subroutine setRootBisectionNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2940 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2941 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionNiter_RK5
2942 : #endif
2943 : use pm_kind, only: RKC => RK5
2944 : procedure(real(RKC)) :: getFunc
2945 : type(bisection_type) , intent(in) :: method
2946 : real(RKC) , intent(out) :: root
2947 : real(RKC) , value :: lb, ub
2948 : real(RKC) , value :: lf, uf
2949 : real(RKC) , intent(in) :: abstol
2950 : integer(IK) , intent(out) :: neval
2951 : integer(IK) , intent(in) :: niter
2952 : end subroutine
2953 : #endif
2954 :
2955 : #if RK4_ENABLED
2956 : recursive module subroutine setRootBisectionNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2957 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2958 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionNiter_RK4
2959 : #endif
2960 : use pm_kind, only: RKC => RK4
2961 : procedure(real(RKC)) :: getFunc
2962 : type(bisection_type) , intent(in) :: method
2963 : real(RKC) , intent(out) :: root
2964 : real(RKC) , value :: lb, ub
2965 : real(RKC) , value :: lf, uf
2966 : real(RKC) , intent(in) :: abstol
2967 : integer(IK) , intent(out) :: neval
2968 : integer(IK) , intent(in) :: niter
2969 : end subroutine
2970 : #endif
2971 :
2972 : #if RK3_ENABLED
2973 : recursive module subroutine setRootBisectionNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2974 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2975 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionNiter_RK3
2976 : #endif
2977 : use pm_kind, only: RKC => RK3
2978 : procedure(real(RKC)) :: getFunc
2979 : type(bisection_type) , intent(in) :: method
2980 : real(RKC) , intent(out) :: root
2981 : real(RKC) , value :: lb, ub
2982 : real(RKC) , value :: lf, uf
2983 : real(RKC) , intent(in) :: abstol
2984 : integer(IK) , intent(out) :: neval
2985 : integer(IK) , intent(in) :: niter
2986 : end subroutine
2987 : #endif
2988 :
2989 : #if RK2_ENABLED
2990 : recursive module subroutine setRootBisectionNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
2991 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
2992 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionNiter_RK2
2993 : #endif
2994 : use pm_kind, only: RKC => RK2
2995 : procedure(real(RKC)) :: getFunc
2996 : type(bisection_type) , intent(in) :: method
2997 : real(RKC) , intent(out) :: root
2998 : real(RKC) , value :: lb, ub
2999 : real(RKC) , value :: lf, uf
3000 : real(RKC) , intent(in) :: abstol
3001 : integer(IK) , intent(out) :: neval
3002 : integer(IK) , intent(in) :: niter
3003 : end subroutine
3004 : #endif
3005 :
3006 : #if RK1_ENABLED
3007 : recursive module subroutine setRootBisectionNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3008 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3009 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBisectionNiter_RK1
3010 : #endif
3011 : use pm_kind, only: RKC => RK1
3012 : procedure(real(RKC)) :: getFunc
3013 : type(bisection_type) , intent(in) :: method
3014 : real(RKC) , intent(out) :: root
3015 : real(RKC) , value :: lb, ub
3016 : real(RKC) , value :: lf, uf
3017 : real(RKC) , intent(in) :: abstol
3018 : integer(IK) , intent(out) :: neval
3019 : integer(IK) , intent(in) :: niter
3020 : end subroutine
3021 : #endif
3022 :
3023 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3024 :
3025 : end interface
3026 :
3027 : ! Secant
3028 :
3029 : interface setRoot
3030 :
3031 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3032 :
3033 : #if RK5_ENABLED
3034 : recursive module subroutine setRootSecantFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3035 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3036 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantFixed_RK5
3037 : #endif
3038 : use pm_kind, only: RKC => RK5
3039 : procedure(real(RKC)) :: getFunc
3040 : type(secant_type) , intent(in) :: method
3041 : real(RKC) , intent(out) :: root
3042 : real(RKC) , value :: lb, ub
3043 : real(RKC) , value :: lf, uf
3044 : real(RKC) , intent(in) :: abstol
3045 : integer(IK) , intent(out) :: neval
3046 : end subroutine
3047 : #endif
3048 :
3049 : #if RK4_ENABLED
3050 : recursive module subroutine setRootSecantFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3051 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3052 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantFixed_RK4
3053 : #endif
3054 : use pm_kind, only: RKC => RK4
3055 : procedure(real(RKC)) :: getFunc
3056 : type(secant_type) , intent(in) :: method
3057 : real(RKC) , intent(out) :: root
3058 : real(RKC) , value :: lb, ub
3059 : real(RKC) , value :: lf, uf
3060 : real(RKC) , intent(in) :: abstol
3061 : integer(IK) , intent(out) :: neval
3062 : end subroutine
3063 : #endif
3064 :
3065 : #if RK3_ENABLED
3066 : recursive module subroutine setRootSecantFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3067 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3068 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantFixed_RK3
3069 : #endif
3070 : use pm_kind, only: RKC => RK3
3071 : procedure(real(RKC)) :: getFunc
3072 : type(secant_type) , intent(in) :: method
3073 : real(RKC) , intent(out) :: root
3074 : real(RKC) , value :: lb, ub
3075 : real(RKC) , value :: lf, uf
3076 : real(RKC) , intent(in) :: abstol
3077 : integer(IK) , intent(out) :: neval
3078 : end subroutine
3079 : #endif
3080 :
3081 : #if RK2_ENABLED
3082 : recursive module subroutine setRootSecantFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3083 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3084 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantFixed_RK2
3085 : #endif
3086 : use pm_kind, only: RKC => RK2
3087 : procedure(real(RKC)) :: getFunc
3088 : type(secant_type) , intent(in) :: method
3089 : real(RKC) , intent(out) :: root
3090 : real(RKC) , value :: lb, ub
3091 : real(RKC) , value :: lf, uf
3092 : real(RKC) , intent(in) :: abstol
3093 : integer(IK) , intent(out) :: neval
3094 : end subroutine
3095 : #endif
3096 :
3097 : #if RK1_ENABLED
3098 : recursive module subroutine setRootSecantFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3099 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3100 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantFixed_RK1
3101 : #endif
3102 : use pm_kind, only: RKC => RK1
3103 : procedure(real(RKC)) :: getFunc
3104 : type(secant_type) , intent(in) :: method
3105 : real(RKC) , intent(out) :: root
3106 : real(RKC) , value :: lb, ub
3107 : real(RKC) , value :: lf, uf
3108 : real(RKC) , intent(in) :: abstol
3109 : integer(IK) , intent(out) :: neval
3110 : end subroutine
3111 : #endif
3112 :
3113 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3114 :
3115 : #if RK5_ENABLED
3116 : recursive module subroutine setRootSecantNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3117 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3118 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantNiter_RK5
3119 : #endif
3120 : use pm_kind, only: RKC => RK5
3121 : procedure(real(RKC)) :: getFunc
3122 : type(secant_type) , intent(in) :: method
3123 : real(RKC) , intent(out) :: root
3124 : real(RKC) , value :: lb, ub
3125 : real(RKC) , value :: lf, uf
3126 : real(RKC) , intent(in) :: abstol
3127 : integer(IK) , intent(out) :: neval
3128 : integer(IK) , intent(in) :: niter
3129 : end subroutine
3130 : #endif
3131 :
3132 : #if RK4_ENABLED
3133 : recursive module subroutine setRootSecantNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3134 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3135 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantNiter_RK4
3136 : #endif
3137 : use pm_kind, only: RKC => RK4
3138 : procedure(real(RKC)) :: getFunc
3139 : type(secant_type) , intent(in) :: method
3140 : real(RKC) , intent(out) :: root
3141 : real(RKC) , value :: lb, ub
3142 : real(RKC) , value :: lf, uf
3143 : real(RKC) , intent(in) :: abstol
3144 : integer(IK) , intent(out) :: neval
3145 : integer(IK) , intent(in) :: niter
3146 : end subroutine
3147 : #endif
3148 :
3149 : #if RK3_ENABLED
3150 : recursive module subroutine setRootSecantNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3151 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3152 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantNiter_RK3
3153 : #endif
3154 : use pm_kind, only: RKC => RK3
3155 : procedure(real(RKC)) :: getFunc
3156 : type(secant_type) , intent(in) :: method
3157 : real(RKC) , intent(out) :: root
3158 : real(RKC) , value :: lb, ub
3159 : real(RKC) , value :: lf, uf
3160 : real(RKC) , intent(in) :: abstol
3161 : integer(IK) , intent(out) :: neval
3162 : integer(IK) , intent(in) :: niter
3163 : end subroutine
3164 : #endif
3165 :
3166 : #if RK2_ENABLED
3167 : recursive module subroutine setRootSecantNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3168 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3169 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantNiter_RK2
3170 : #endif
3171 : use pm_kind, only: RKC => RK2
3172 : procedure(real(RKC)) :: getFunc
3173 : type(secant_type) , intent(in) :: method
3174 : real(RKC) , intent(out) :: root
3175 : real(RKC) , value :: lb, ub
3176 : real(RKC) , value :: lf, uf
3177 : real(RKC) , intent(in) :: abstol
3178 : integer(IK) , intent(out) :: neval
3179 : integer(IK) , intent(in) :: niter
3180 : end subroutine
3181 : #endif
3182 :
3183 : #if RK1_ENABLED
3184 : recursive module subroutine setRootSecantNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3185 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3186 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSecantNiter_RK1
3187 : #endif
3188 : use pm_kind, only: RKC => RK1
3189 : procedure(real(RKC)) :: getFunc
3190 : type(secant_type) , intent(in) :: method
3191 : real(RKC) , intent(out) :: root
3192 : real(RKC) , value :: lb, ub
3193 : real(RKC) , value :: lf, uf
3194 : real(RKC) , intent(in) :: abstol
3195 : integer(IK) , intent(out) :: neval
3196 : integer(IK) , intent(in) :: niter
3197 : end subroutine
3198 : #endif
3199 :
3200 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3201 :
3202 : end interface
3203 :
3204 : ! Brent
3205 :
3206 : interface setRoot
3207 :
3208 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3209 :
3210 : #if RK5_ENABLED
3211 : recursive module subroutine setRootBrentFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3212 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3213 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentFixed_RK5
3214 : #endif
3215 : use pm_kind, only: RKC => RK5
3216 : procedure(real(RKC)) :: getFunc
3217 : type(brent_type) , intent(in) :: method
3218 : real(RKC) , intent(out) :: root
3219 : real(RKC) , value :: lb, ub
3220 : real(RKC) , value :: lf, uf
3221 : real(RKC) , intent(in) :: abstol
3222 : integer(IK) , intent(out) :: neval
3223 : end subroutine
3224 : #endif
3225 :
3226 : #if RK4_ENABLED
3227 : recursive module subroutine setRootBrentFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3228 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3229 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentFixed_RK4
3230 : #endif
3231 : use pm_kind, only: RKC => RK4
3232 : procedure(real(RKC)) :: getFunc
3233 : type(brent_type) , intent(in) :: method
3234 : real(RKC) , intent(out) :: root
3235 : real(RKC) , value :: lb, ub
3236 : real(RKC) , value :: lf, uf
3237 : real(RKC) , intent(in) :: abstol
3238 : integer(IK) , intent(out) :: neval
3239 : end subroutine
3240 : #endif
3241 :
3242 : #if RK3_ENABLED
3243 : recursive module subroutine setRootBrentFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3244 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3245 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentFixed_RK3
3246 : #endif
3247 : use pm_kind, only: RKC => RK3
3248 : procedure(real(RKC)) :: getFunc
3249 : type(brent_type) , intent(in) :: method
3250 : real(RKC) , intent(out) :: root
3251 : real(RKC) , value :: lb, ub
3252 : real(RKC) , value :: lf, uf
3253 : real(RKC) , intent(in) :: abstol
3254 : integer(IK) , intent(out) :: neval
3255 : end subroutine
3256 : #endif
3257 :
3258 : #if RK2_ENABLED
3259 : recursive module subroutine setRootBrentFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3260 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3261 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentFixed_RK2
3262 : #endif
3263 : use pm_kind, only: RKC => RK2
3264 : procedure(real(RKC)) :: getFunc
3265 : type(brent_type) , intent(in) :: method
3266 : real(RKC) , intent(out) :: root
3267 : real(RKC) , value :: lb, ub
3268 : real(RKC) , value :: lf, uf
3269 : real(RKC) , intent(in) :: abstol
3270 : integer(IK) , intent(out) :: neval
3271 : end subroutine
3272 : #endif
3273 :
3274 : #if RK1_ENABLED
3275 : recursive module subroutine setRootBrentFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3276 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3277 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentFixed_RK1
3278 : #endif
3279 : use pm_kind, only: RKC => RK1
3280 : procedure(real(RKC)) :: getFunc
3281 : type(brent_type) , intent(in) :: method
3282 : real(RKC) , intent(out) :: root
3283 : real(RKC) , value :: lb, ub
3284 : real(RKC) , value :: lf, uf
3285 : real(RKC) , intent(in) :: abstol
3286 : integer(IK) , intent(out) :: neval
3287 : end subroutine
3288 : #endif
3289 :
3290 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3291 :
3292 : #if RK5_ENABLED
3293 : recursive module subroutine setRootBrentNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3294 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3295 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentNiter_RK5
3296 : #endif
3297 : use pm_kind, only: RKC => RK5
3298 : procedure(real(RKC)) :: getFunc
3299 : type(brent_type) , intent(in) :: method
3300 : real(RKC) , intent(out) :: root
3301 : real(RKC) , value :: lb, ub
3302 : real(RKC) , value :: lf, uf
3303 : real(RKC) , intent(in) :: abstol
3304 : integer(IK) , intent(out) :: neval
3305 : integer(IK) , intent(in) :: niter
3306 : end subroutine
3307 : #endif
3308 :
3309 : #if RK4_ENABLED
3310 : recursive module subroutine setRootBrentNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3311 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3312 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentNiter_RK4
3313 : #endif
3314 : use pm_kind, only: RKC => RK4
3315 : procedure(real(RKC)) :: getFunc
3316 : type(brent_type) , intent(in) :: method
3317 : real(RKC) , intent(out) :: root
3318 : real(RKC) , value :: lb, ub
3319 : real(RKC) , value :: lf, uf
3320 : real(RKC) , intent(in) :: abstol
3321 : integer(IK) , intent(out) :: neval
3322 : integer(IK) , intent(in) :: niter
3323 : end subroutine
3324 : #endif
3325 :
3326 : #if RK3_ENABLED
3327 : recursive module subroutine setRootBrentNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3328 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3329 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentNiter_RK3
3330 : #endif
3331 : use pm_kind, only: RKC => RK3
3332 : procedure(real(RKC)) :: getFunc
3333 : type(brent_type) , intent(in) :: method
3334 : real(RKC) , intent(out) :: root
3335 : real(RKC) , value :: lb, ub
3336 : real(RKC) , value :: lf, uf
3337 : real(RKC) , intent(in) :: abstol
3338 : integer(IK) , intent(out) :: neval
3339 : integer(IK) , intent(in) :: niter
3340 : end subroutine
3341 : #endif
3342 :
3343 : #if RK2_ENABLED
3344 : recursive module subroutine setRootBrentNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3345 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3346 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentNiter_RK2
3347 : #endif
3348 : use pm_kind, only: RKC => RK2
3349 : procedure(real(RKC)) :: getFunc
3350 : type(brent_type) , intent(in) :: method
3351 : real(RKC) , intent(out) :: root
3352 : real(RKC) , value :: lb, ub
3353 : real(RKC) , value :: lf, uf
3354 : real(RKC) , intent(in) :: abstol
3355 : integer(IK) , intent(out) :: neval
3356 : integer(IK) , intent(in) :: niter
3357 : end subroutine
3358 : #endif
3359 :
3360 : #if RK1_ENABLED
3361 : recursive module subroutine setRootBrentNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3362 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3363 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootBrentNiter_RK1
3364 : #endif
3365 : use pm_kind, only: RKC => RK1
3366 : procedure(real(RKC)) :: getFunc
3367 : type(brent_type) , intent(in) :: method
3368 : real(RKC) , intent(out) :: root
3369 : real(RKC) , value :: lb, ub
3370 : real(RKC) , value :: lf, uf
3371 : real(RKC) , intent(in) :: abstol
3372 : integer(IK) , intent(out) :: neval
3373 : integer(IK) , intent(in) :: niter
3374 : end subroutine
3375 : #endif
3376 :
3377 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3378 :
3379 : end interface
3380 :
3381 : ! Ridders
3382 :
3383 : interface setRoot
3384 :
3385 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3386 :
3387 : #if RK5_ENABLED
3388 : recursive module subroutine setRootRiddersFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3389 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3390 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersFixed_RK5
3391 : #endif
3392 : use pm_kind, only: RKC => RK5
3393 : procedure(real(RKC)) :: getFunc
3394 : type(ridders_type) , intent(in) :: method
3395 : real(RKC) , intent(out) :: root
3396 : real(RKC) , value :: lb, ub
3397 : real(RKC) , value :: lf, uf
3398 : real(RKC) , intent(in) :: abstol
3399 : integer(IK) , intent(out) :: neval
3400 : end subroutine
3401 : #endif
3402 :
3403 : #if RK4_ENABLED
3404 : recursive module subroutine setRootRiddersFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3405 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3406 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersFixed_RK4
3407 : #endif
3408 : use pm_kind, only: RKC => RK4
3409 : procedure(real(RKC)) :: getFunc
3410 : type(ridders_type) , intent(in) :: method
3411 : real(RKC) , intent(out) :: root
3412 : real(RKC) , value :: lb, ub
3413 : real(RKC) , value :: lf, uf
3414 : real(RKC) , intent(in) :: abstol
3415 : integer(IK) , intent(out) :: neval
3416 : end subroutine
3417 : #endif
3418 :
3419 : #if RK3_ENABLED
3420 : recursive module subroutine setRootRiddersFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3421 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3422 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersFixed_RK3
3423 : #endif
3424 : use pm_kind, only: RKC => RK3
3425 : procedure(real(RKC)) :: getFunc
3426 : type(ridders_type) , intent(in) :: method
3427 : real(RKC) , intent(out) :: root
3428 : real(RKC) , value :: lb, ub
3429 : real(RKC) , value :: lf, uf
3430 : real(RKC) , intent(in) :: abstol
3431 : integer(IK) , intent(out) :: neval
3432 : end subroutine
3433 : #endif
3434 :
3435 : #if RK2_ENABLED
3436 : recursive module subroutine setRootRiddersFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3437 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3438 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersFixed_RK2
3439 : #endif
3440 : use pm_kind, only: RKC => RK2
3441 : procedure(real(RKC)) :: getFunc
3442 : type(ridders_type) , intent(in) :: method
3443 : real(RKC) , intent(out) :: root
3444 : real(RKC) , value :: lb, ub
3445 : real(RKC) , value :: lf, uf
3446 : real(RKC) , intent(in) :: abstol
3447 : integer(IK) , intent(out) :: neval
3448 : end subroutine
3449 : #endif
3450 :
3451 : #if RK1_ENABLED
3452 : recursive module subroutine setRootRiddersFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3453 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3454 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersFixed_RK1
3455 : #endif
3456 : use pm_kind, only: RKC => RK1
3457 : procedure(real(RKC)) :: getFunc
3458 : type(ridders_type) , intent(in) :: method
3459 : real(RKC) , intent(out) :: root
3460 : real(RKC) , value :: lb, ub
3461 : real(RKC) , value :: lf, uf
3462 : real(RKC) , intent(in) :: abstol
3463 : integer(IK) , intent(out) :: neval
3464 : end subroutine
3465 : #endif
3466 :
3467 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3468 :
3469 : #if RK5_ENABLED
3470 : recursive module subroutine setRootRiddersNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3471 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3472 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersNiter_RK5
3473 : #endif
3474 : use pm_kind, only: RKC => RK5
3475 : procedure(real(RKC)) :: getFunc
3476 : type(ridders_type) , intent(in) :: method
3477 : real(RKC) , intent(out) :: root
3478 : real(RKC) , value :: lb, ub
3479 : real(RKC) , value :: lf, uf
3480 : real(RKC) , intent(in) :: abstol
3481 : integer(IK) , intent(out) :: neval
3482 : integer(IK) , intent(in) :: niter
3483 : end subroutine
3484 : #endif
3485 :
3486 : #if RK4_ENABLED
3487 : recursive module subroutine setRootRiddersNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3488 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3489 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersNiter_RK4
3490 : #endif
3491 : use pm_kind, only: RKC => RK4
3492 : procedure(real(RKC)) :: getFunc
3493 : type(ridders_type) , intent(in) :: method
3494 : real(RKC) , intent(out) :: root
3495 : real(RKC) , value :: lb, ub
3496 : real(RKC) , value :: lf, uf
3497 : real(RKC) , intent(in) :: abstol
3498 : integer(IK) , intent(out) :: neval
3499 : integer(IK) , intent(in) :: niter
3500 : end subroutine
3501 : #endif
3502 :
3503 : #if RK3_ENABLED
3504 : recursive module subroutine setRootRiddersNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3505 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3506 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersNiter_RK3
3507 : #endif
3508 : use pm_kind, only: RKC => RK3
3509 : procedure(real(RKC)) :: getFunc
3510 : type(ridders_type) , intent(in) :: method
3511 : real(RKC) , intent(out) :: root
3512 : real(RKC) , value :: lb, ub
3513 : real(RKC) , value :: lf, uf
3514 : real(RKC) , intent(in) :: abstol
3515 : integer(IK) , intent(out) :: neval
3516 : integer(IK) , intent(in) :: niter
3517 : end subroutine
3518 : #endif
3519 :
3520 : #if RK2_ENABLED
3521 : recursive module subroutine setRootRiddersNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3522 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3523 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersNiter_RK2
3524 : #endif
3525 : use pm_kind, only: RKC => RK2
3526 : procedure(real(RKC)) :: getFunc
3527 : type(ridders_type) , intent(in) :: method
3528 : real(RKC) , intent(out) :: root
3529 : real(RKC) , value :: lb, ub
3530 : real(RKC) , value :: lf, uf
3531 : real(RKC) , intent(in) :: abstol
3532 : integer(IK) , intent(out) :: neval
3533 : integer(IK) , intent(in) :: niter
3534 : end subroutine
3535 : #endif
3536 :
3537 : #if RK1_ENABLED
3538 : recursive module subroutine setRootRiddersNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3539 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3540 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootRiddersNiter_RK1
3541 : #endif
3542 : use pm_kind, only: RKC => RK1
3543 : procedure(real(RKC)) :: getFunc
3544 : type(ridders_type) , intent(in) :: method
3545 : real(RKC) , intent(out) :: root
3546 : real(RKC) , value :: lb, ub
3547 : real(RKC) , value :: lf, uf
3548 : real(RKC) , intent(in) :: abstol
3549 : integer(IK) , intent(out) :: neval
3550 : integer(IK) , intent(in) :: niter
3551 : end subroutine
3552 : #endif
3553 :
3554 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3555 :
3556 : end interface
3557 :
3558 : ! TOMS748
3559 :
3560 : interface setRoot
3561 :
3562 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3563 :
3564 : #if RK5_ENABLED
3565 : recursive module subroutine setRootTOMS748Fixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3566 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3567 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Fixed_RK5
3568 : #endif
3569 : use pm_kind, only: RKC => RK5
3570 : procedure(real(RKC)) :: getFunc
3571 : type(toms748_type) , intent(in) :: method
3572 : real(RKC) , intent(out) :: root
3573 : real(RKC) , value :: lb, ub
3574 : real(RKC) , value :: lf, uf
3575 : real(RKC) , intent(in) :: abstol
3576 : integer(IK) , intent(out) :: neval
3577 : end subroutine
3578 : #endif
3579 :
3580 : #if RK4_ENABLED
3581 : recursive module subroutine setRootTOMS748Fixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3582 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3583 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Fixed_RK4
3584 : #endif
3585 : use pm_kind, only: RKC => RK4
3586 : procedure(real(RKC)) :: getFunc
3587 : type(toms748_type) , intent(in) :: method
3588 : real(RKC) , intent(out) :: root
3589 : real(RKC) , value :: lb, ub
3590 : real(RKC) , value :: lf, uf
3591 : real(RKC) , intent(in) :: abstol
3592 : integer(IK) , intent(out) :: neval
3593 : end subroutine
3594 : #endif
3595 :
3596 : #if RK3_ENABLED
3597 : recursive module subroutine setRootTOMS748Fixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3598 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3599 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Fixed_RK3
3600 : #endif
3601 : use pm_kind, only: RKC => RK3
3602 : procedure(real(RKC)) :: getFunc
3603 : type(toms748_type) , intent(in) :: method
3604 : real(RKC) , intent(out) :: root
3605 : real(RKC) , value :: lb, ub
3606 : real(RKC) , value :: lf, uf
3607 : real(RKC) , intent(in) :: abstol
3608 : integer(IK) , intent(out) :: neval
3609 : end subroutine
3610 : #endif
3611 :
3612 : #if RK2_ENABLED
3613 : recursive module subroutine setRootTOMS748Fixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3614 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3615 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Fixed_RK2
3616 : #endif
3617 : use pm_kind, only: RKC => RK2
3618 : procedure(real(RKC)) :: getFunc
3619 : type(toms748_type) , intent(in) :: method
3620 : real(RKC) , intent(out) :: root
3621 : real(RKC) , value :: lb, ub
3622 : real(RKC) , value :: lf, uf
3623 : real(RKC) , intent(in) :: abstol
3624 : integer(IK) , intent(out) :: neval
3625 : end subroutine
3626 : #endif
3627 :
3628 : #if RK1_ENABLED
3629 : recursive module subroutine setRootTOMS748Fixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3630 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3631 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Fixed_RK1
3632 : #endif
3633 : use pm_kind, only: RKC => RK1
3634 : procedure(real(RKC)) :: getFunc
3635 : type(toms748_type) , intent(in) :: method
3636 : real(RKC) , intent(out) :: root
3637 : real(RKC) , value :: lb, ub
3638 : real(RKC) , value :: lf, uf
3639 : real(RKC) , intent(in) :: abstol
3640 : integer(IK) , intent(out) :: neval
3641 : end subroutine
3642 : #endif
3643 :
3644 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3645 :
3646 : #if RK5_ENABLED
3647 : recursive module subroutine setRootTOMS748Niter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3648 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3649 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Niter_RK5
3650 : #endif
3651 : use pm_kind, only: RKC => RK5
3652 : procedure(real(RKC)) :: getFunc
3653 : type(toms748_type) , intent(in) :: method
3654 : real(RKC) , intent(out) :: root
3655 : real(RKC) , value :: lb, ub
3656 : real(RKC) , value :: lf, uf
3657 : real(RKC) , intent(in) :: abstol
3658 : integer(IK) , intent(out) :: neval
3659 : integer(IK) , intent(in) :: niter
3660 : end subroutine
3661 : #endif
3662 :
3663 : #if RK4_ENABLED
3664 : recursive module subroutine setRootTOMS748Niter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3665 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3666 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Niter_RK4
3667 : #endif
3668 : use pm_kind, only: RKC => RK4
3669 : procedure(real(RKC)) :: getFunc
3670 : type(toms748_type) , intent(in) :: method
3671 : real(RKC) , intent(out) :: root
3672 : real(RKC) , value :: lb, ub
3673 : real(RKC) , value :: lf, uf
3674 : real(RKC) , intent(in) :: abstol
3675 : integer(IK) , intent(out) :: neval
3676 : integer(IK) , intent(in) :: niter
3677 : end subroutine
3678 : #endif
3679 :
3680 : #if RK3_ENABLED
3681 : recursive module subroutine setRootTOMS748Niter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3682 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3683 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Niter_RK3
3684 : #endif
3685 : use pm_kind, only: RKC => RK3
3686 : procedure(real(RKC)) :: getFunc
3687 : type(toms748_type) , intent(in) :: method
3688 : real(RKC) , intent(out) :: root
3689 : real(RKC) , value :: lb, ub
3690 : real(RKC) , value :: lf, uf
3691 : real(RKC) , intent(in) :: abstol
3692 : integer(IK) , intent(out) :: neval
3693 : integer(IK) , intent(in) :: niter
3694 : end subroutine
3695 : #endif
3696 :
3697 : #if RK2_ENABLED
3698 : recursive module subroutine setRootTOMS748Niter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3699 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3700 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Niter_RK2
3701 : #endif
3702 : use pm_kind, only: RKC => RK2
3703 : procedure(real(RKC)) :: getFunc
3704 : type(toms748_type) , intent(in) :: method
3705 : real(RKC) , intent(out) :: root
3706 : real(RKC) , value :: lb, ub
3707 : real(RKC) , value :: lf, uf
3708 : real(RKC) , intent(in) :: abstol
3709 : integer(IK) , intent(out) :: neval
3710 : integer(IK) , intent(in) :: niter
3711 : end subroutine
3712 : #endif
3713 :
3714 : #if RK1_ENABLED
3715 : recursive module subroutine setRootTOMS748Niter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3716 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3717 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootTOMS748Niter_RK1
3718 : #endif
3719 : use pm_kind, only: RKC => RK1
3720 : procedure(real(RKC)) :: getFunc
3721 : type(toms748_type) , intent(in) :: method
3722 : real(RKC) , intent(out) :: root
3723 : real(RKC) , value :: lb, ub
3724 : real(RKC) , value :: lf, uf
3725 : real(RKC) , intent(in) :: abstol
3726 : integer(IK) , intent(out) :: neval
3727 : integer(IK) , intent(in) :: niter
3728 : end subroutine
3729 : #endif
3730 :
3731 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3732 :
3733 : end interface
3734 :
3735 : ! Newton
3736 :
3737 : interface setRoot
3738 :
3739 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3740 :
3741 : #if RK5_ENABLED
3742 : recursive module subroutine setRootNewtonFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3743 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3744 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonFixed_RK5
3745 : #endif
3746 : use pm_kind, only: RKC => RK5
3747 : procedure(real(RKC)) :: getFunc
3748 : type(newton_type) , intent(in) :: method
3749 : real(RKC) , intent(inout) :: root
3750 : real(RKC) , value :: lb, ub
3751 : real(RKC) , value :: lf, uf
3752 : real(RKC) , intent(in) :: abstol
3753 : integer(IK) , intent(out) :: neval
3754 : end subroutine
3755 : #endif
3756 :
3757 : #if RK4_ENABLED
3758 : recursive module subroutine setRootNewtonFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3759 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3760 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonFixed_RK4
3761 : #endif
3762 : use pm_kind, only: RKC => RK4
3763 : procedure(real(RKC)) :: getFunc
3764 : type(newton_type) , intent(in) :: method
3765 : real(RKC) , intent(inout) :: root
3766 : real(RKC) , value :: lb, ub
3767 : real(RKC) , value :: lf, uf
3768 : real(RKC) , intent(in) :: abstol
3769 : integer(IK) , intent(out) :: neval
3770 : end subroutine
3771 : #endif
3772 :
3773 : #if RK3_ENABLED
3774 : recursive module subroutine setRootNewtonFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3775 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3776 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonFixed_RK3
3777 : #endif
3778 : use pm_kind, only: RKC => RK3
3779 : procedure(real(RKC)) :: getFunc
3780 : type(newton_type) , intent(in) :: method
3781 : real(RKC) , intent(inout) :: root
3782 : real(RKC) , value :: lb, ub
3783 : real(RKC) , value :: lf, uf
3784 : real(RKC) , intent(in) :: abstol
3785 : integer(IK) , intent(out) :: neval
3786 : end subroutine
3787 : #endif
3788 :
3789 : #if RK2_ENABLED
3790 : recursive module subroutine setRootNewtonFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3791 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3792 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonFixed_RK2
3793 : #endif
3794 : use pm_kind, only: RKC => RK2
3795 : procedure(real(RKC)) :: getFunc
3796 : type(newton_type) , intent(in) :: method
3797 : real(RKC) , intent(inout) :: root
3798 : real(RKC) , value :: lb, ub
3799 : real(RKC) , value :: lf, uf
3800 : real(RKC) , intent(in) :: abstol
3801 : integer(IK) , intent(out) :: neval
3802 : end subroutine
3803 : #endif
3804 :
3805 : #if RK1_ENABLED
3806 : recursive module subroutine setRootNewtonFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3807 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3808 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonFixed_RK1
3809 : #endif
3810 : use pm_kind, only: RKC => RK1
3811 : procedure(real(RKC)) :: getFunc
3812 : type(newton_type) , intent(in) :: method
3813 : real(RKC) , intent(inout) :: root
3814 : real(RKC) , value :: lb, ub
3815 : real(RKC) , value :: lf, uf
3816 : real(RKC) , intent(in) :: abstol
3817 : integer(IK) , intent(out) :: neval
3818 : end subroutine
3819 : #endif
3820 :
3821 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3822 :
3823 : #if RK5_ENABLED
3824 : recursive module subroutine setRootNewtonNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3825 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3826 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonNiter_RK5
3827 : #endif
3828 : use pm_kind, only: RKC => RK5
3829 : procedure(real(RKC)) :: getFunc
3830 : type(newton_type) , intent(in) :: method
3831 : real(RKC) , intent(inout) :: root
3832 : real(RKC) , value :: lb, ub
3833 : real(RKC) , value :: lf, uf
3834 : real(RKC) , intent(in) :: abstol
3835 : integer(IK) , intent(out) :: neval
3836 : integer(IK) , intent(in) :: niter
3837 : end subroutine
3838 : #endif
3839 :
3840 : #if RK4_ENABLED
3841 : recursive module subroutine setRootNewtonNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3842 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3843 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonNiter_RK4
3844 : #endif
3845 : use pm_kind, only: RKC => RK4
3846 : procedure(real(RKC)) :: getFunc
3847 : type(newton_type) , intent(in) :: method
3848 : real(RKC) , intent(inout) :: root
3849 : real(RKC) , value :: lb, ub
3850 : real(RKC) , value :: lf, uf
3851 : real(RKC) , intent(in) :: abstol
3852 : integer(IK) , intent(out) :: neval
3853 : integer(IK) , intent(in) :: niter
3854 : end subroutine
3855 : #endif
3856 :
3857 : #if RK3_ENABLED
3858 : recursive module subroutine setRootNewtonNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3859 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3860 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonNiter_RK3
3861 : #endif
3862 : use pm_kind, only: RKC => RK3
3863 : procedure(real(RKC)) :: getFunc
3864 : type(newton_type) , intent(in) :: method
3865 : real(RKC) , intent(inout) :: root
3866 : real(RKC) , value :: lb, ub
3867 : real(RKC) , value :: lf, uf
3868 : real(RKC) , intent(in) :: abstol
3869 : integer(IK) , intent(out) :: neval
3870 : integer(IK) , intent(in) :: niter
3871 : end subroutine
3872 : #endif
3873 :
3874 : #if RK2_ENABLED
3875 : recursive module subroutine setRootNewtonNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3876 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3877 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonNiter_RK2
3878 : #endif
3879 : use pm_kind, only: RKC => RK2
3880 : procedure(real(RKC)) :: getFunc
3881 : type(newton_type) , intent(in) :: method
3882 : real(RKC) , intent(inout) :: root
3883 : real(RKC) , value :: lb, ub
3884 : real(RKC) , value :: lf, uf
3885 : real(RKC) , intent(in) :: abstol
3886 : integer(IK) , intent(out) :: neval
3887 : integer(IK) , intent(in) :: niter
3888 : end subroutine
3889 : #endif
3890 :
3891 : #if RK1_ENABLED
3892 : recursive module subroutine setRootNewtonNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
3893 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3894 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootNewtonNiter_RK1
3895 : #endif
3896 : use pm_kind, only: RKC => RK1
3897 : procedure(real(RKC)) :: getFunc
3898 : type(newton_type) , intent(in) :: method
3899 : real(RKC) , intent(inout) :: root
3900 : real(RKC) , value :: lb, ub
3901 : real(RKC) , value :: lf, uf
3902 : real(RKC) , intent(in) :: abstol
3903 : integer(IK) , intent(out) :: neval
3904 : integer(IK) , intent(in) :: niter
3905 : end subroutine
3906 : #endif
3907 :
3908 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3909 :
3910 : end interface
3911 :
3912 : ! Halley
3913 :
3914 : interface setRoot
3915 :
3916 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3917 :
3918 : #if RK5_ENABLED
3919 : recursive module subroutine setRootHalleyFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3920 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3921 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyFixed_RK5
3922 : #endif
3923 : use pm_kind, only: RKC => RK5
3924 : procedure(real(RKC)) :: getFunc
3925 : type(halley_type) , intent(in) :: method
3926 : real(RKC) , intent(inout) :: root
3927 : real(RKC) , value :: lb, ub
3928 : real(RKC) , value :: lf, uf
3929 : real(RKC) , intent(in) :: abstol
3930 : integer(IK) , intent(out) :: neval
3931 : end subroutine
3932 : #endif
3933 :
3934 : #if RK4_ENABLED
3935 : recursive module subroutine setRootHalleyFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3936 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3937 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyFixed_RK4
3938 : #endif
3939 : use pm_kind, only: RKC => RK4
3940 : procedure(real(RKC)) :: getFunc
3941 : type(halley_type) , intent(in) :: method
3942 : real(RKC) , intent(inout) :: root
3943 : real(RKC) , value :: lb, ub
3944 : real(RKC) , value :: lf, uf
3945 : real(RKC) , intent(in) :: abstol
3946 : integer(IK) , intent(out) :: neval
3947 : end subroutine
3948 : #endif
3949 :
3950 : #if RK3_ENABLED
3951 : recursive module subroutine setRootHalleyFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3952 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3953 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyFixed_RK3
3954 : #endif
3955 : use pm_kind, only: RKC => RK3
3956 : procedure(real(RKC)) :: getFunc
3957 : type(halley_type) , intent(in) :: method
3958 : real(RKC) , intent(inout) :: root
3959 : real(RKC) , value :: lb, ub
3960 : real(RKC) , value :: lf, uf
3961 : real(RKC) , intent(in) :: abstol
3962 : integer(IK) , intent(out) :: neval
3963 : end subroutine
3964 : #endif
3965 :
3966 : #if RK2_ENABLED
3967 : recursive module subroutine setRootHalleyFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3968 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3969 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyFixed_RK2
3970 : #endif
3971 : use pm_kind, only: RKC => RK2
3972 : procedure(real(RKC)) :: getFunc
3973 : type(halley_type) , intent(in) :: method
3974 : real(RKC) , intent(inout) :: root
3975 : real(RKC) , value :: lb, ub
3976 : real(RKC) , value :: lf, uf
3977 : real(RKC) , intent(in) :: abstol
3978 : integer(IK) , intent(out) :: neval
3979 : end subroutine
3980 : #endif
3981 :
3982 : #if RK1_ENABLED
3983 : recursive module subroutine setRootHalleyFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
3984 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
3985 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyFixed_RK1
3986 : #endif
3987 : use pm_kind, only: RKC => RK1
3988 : procedure(real(RKC)) :: getFunc
3989 : type(halley_type) , intent(in) :: method
3990 : real(RKC) , intent(inout) :: root
3991 : real(RKC) , value :: lb, ub
3992 : real(RKC) , value :: lf, uf
3993 : real(RKC) , intent(in) :: abstol
3994 : integer(IK) , intent(out) :: neval
3995 : end subroutine
3996 : #endif
3997 :
3998 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3999 :
4000 : #if RK5_ENABLED
4001 : recursive module subroutine setRootHalleyNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4002 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4003 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyNiter_RK5
4004 : #endif
4005 : use pm_kind, only: RKC => RK5
4006 : procedure(real(RKC)) :: getFunc
4007 : type(halley_type) , intent(in) :: method
4008 : real(RKC) , intent(inout) :: root
4009 : real(RKC) , value :: lb, ub
4010 : real(RKC) , value :: lf, uf
4011 : real(RKC) , intent(in) :: abstol
4012 : integer(IK) , intent(out) :: neval
4013 : integer(IK) , intent(in) :: niter
4014 : end subroutine
4015 : #endif
4016 :
4017 : #if RK4_ENABLED
4018 : recursive module subroutine setRootHalleyNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4019 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4020 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyNiter_RK4
4021 : #endif
4022 : use pm_kind, only: RKC => RK4
4023 : procedure(real(RKC)) :: getFunc
4024 : type(halley_type) , intent(in) :: method
4025 : real(RKC) , intent(inout) :: root
4026 : real(RKC) , value :: lb, ub
4027 : real(RKC) , value :: lf, uf
4028 : real(RKC) , intent(in) :: abstol
4029 : integer(IK) , intent(out) :: neval
4030 : integer(IK) , intent(in) :: niter
4031 : end subroutine
4032 : #endif
4033 :
4034 : #if RK3_ENABLED
4035 : recursive module subroutine setRootHalleyNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4036 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4037 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyNiter_RK3
4038 : #endif
4039 : use pm_kind, only: RKC => RK3
4040 : procedure(real(RKC)) :: getFunc
4041 : type(halley_type) , intent(in) :: method
4042 : real(RKC) , intent(inout) :: root
4043 : real(RKC) , value :: lb, ub
4044 : real(RKC) , value :: lf, uf
4045 : real(RKC) , intent(in) :: abstol
4046 : integer(IK) , intent(out) :: neval
4047 : integer(IK) , intent(in) :: niter
4048 : end subroutine
4049 : #endif
4050 :
4051 : #if RK2_ENABLED
4052 : recursive module subroutine setRootHalleyNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4053 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4054 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyNiter_RK2
4055 : #endif
4056 : use pm_kind, only: RKC => RK2
4057 : procedure(real(RKC)) :: getFunc
4058 : type(halley_type) , intent(in) :: method
4059 : real(RKC) , intent(inout) :: root
4060 : real(RKC) , value :: lb, ub
4061 : real(RKC) , value :: lf, uf
4062 : real(RKC) , intent(in) :: abstol
4063 : integer(IK) , intent(out) :: neval
4064 : integer(IK) , intent(in) :: niter
4065 : end subroutine
4066 : #endif
4067 :
4068 : #if RK1_ENABLED
4069 : recursive module subroutine setRootHalleyNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4070 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4071 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootHalleyNiter_RK1
4072 : #endif
4073 : use pm_kind, only: RKC => RK1
4074 : procedure(real(RKC)) :: getFunc
4075 : type(halley_type) , intent(in) :: method
4076 : real(RKC) , intent(inout) :: root
4077 : real(RKC) , value :: lb, ub
4078 : real(RKC) , value :: lf, uf
4079 : real(RKC) , intent(in) :: abstol
4080 : integer(IK) , intent(out) :: neval
4081 : integer(IK) , intent(in) :: niter
4082 : end subroutine
4083 : #endif
4084 :
4085 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4086 :
4087 : end interface
4088 :
4089 : ! Schroder
4090 :
4091 : interface setRoot
4092 :
4093 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4094 :
4095 : #if RK5_ENABLED
4096 : recursive module subroutine setRootSchroderFixed_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
4097 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4098 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderFixed_RK5
4099 : #endif
4100 : use pm_kind, only: RKC => RK5
4101 : procedure(real(RKC)) :: getFunc
4102 : type(schroder_type) , intent(in) :: method
4103 : real(RKC) , intent(inout) :: root
4104 : real(RKC) , value :: lb, ub
4105 : real(RKC) , value :: lf, uf
4106 : real(RKC) , intent(in) :: abstol
4107 : integer(IK) , intent(out) :: neval
4108 : end subroutine
4109 : #endif
4110 :
4111 : #if RK4_ENABLED
4112 : recursive module subroutine setRootSchroderFixed_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
4113 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4114 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderFixed_RK4
4115 : #endif
4116 : use pm_kind, only: RKC => RK4
4117 : procedure(real(RKC)) :: getFunc
4118 : type(schroder_type) , intent(in) :: method
4119 : real(RKC) , intent(inout) :: root
4120 : real(RKC) , value :: lb, ub
4121 : real(RKC) , value :: lf, uf
4122 : real(RKC) , intent(in) :: abstol
4123 : integer(IK) , intent(out) :: neval
4124 : end subroutine
4125 : #endif
4126 :
4127 : #if RK3_ENABLED
4128 : recursive module subroutine setRootSchroderFixed_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
4129 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4130 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderFixed_RK3
4131 : #endif
4132 : use pm_kind, only: RKC => RK3
4133 : procedure(real(RKC)) :: getFunc
4134 : type(schroder_type) , intent(in) :: method
4135 : real(RKC) , intent(inout) :: root
4136 : real(RKC) , value :: lb, ub
4137 : real(RKC) , value :: lf, uf
4138 : real(RKC) , intent(in) :: abstol
4139 : integer(IK) , intent(out) :: neval
4140 : end subroutine
4141 : #endif
4142 :
4143 : #if RK2_ENABLED
4144 : recursive module subroutine setRootSchroderFixed_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
4145 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4146 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderFixed_RK2
4147 : #endif
4148 : use pm_kind, only: RKC => RK2
4149 : procedure(real(RKC)) :: getFunc
4150 : type(schroder_type) , intent(in) :: method
4151 : real(RKC) , intent(inout) :: root
4152 : real(RKC) , value :: lb, ub
4153 : real(RKC) , value :: lf, uf
4154 : real(RKC) , intent(in) :: abstol
4155 : integer(IK) , intent(out) :: neval
4156 : end subroutine
4157 : #endif
4158 :
4159 : #if RK1_ENABLED
4160 : recursive module subroutine setRootSchroderFixed_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval)
4161 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4162 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderFixed_RK1
4163 : #endif
4164 : use pm_kind, only: RKC => RK1
4165 : procedure(real(RKC)) :: getFunc
4166 : type(schroder_type) , intent(in) :: method
4167 : real(RKC) , intent(inout) :: root
4168 : real(RKC) , value :: lb, ub
4169 : real(RKC) , value :: lf, uf
4170 : real(RKC) , intent(in) :: abstol
4171 : integer(IK) , intent(out) :: neval
4172 : end subroutine
4173 : #endif
4174 :
4175 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4176 :
4177 : #if RK5_ENABLED
4178 : recursive module subroutine setRootSchroderNiter_RK5(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4179 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4180 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderNiter_RK5
4181 : #endif
4182 : use pm_kind, only: RKC => RK5
4183 : procedure(real(RKC)) :: getFunc
4184 : type(schroder_type) , intent(in) :: method
4185 : real(RKC) , intent(inout) :: root
4186 : real(RKC) , value :: lb, ub
4187 : real(RKC) , value :: lf, uf
4188 : real(RKC) , intent(in) :: abstol
4189 : integer(IK) , intent(out) :: neval
4190 : integer(IK) , intent(in) :: niter
4191 : end subroutine
4192 : #endif
4193 :
4194 : #if RK4_ENABLED
4195 : recursive module subroutine setRootSchroderNiter_RK4(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4196 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4197 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderNiter_RK4
4198 : #endif
4199 : use pm_kind, only: RKC => RK4
4200 : procedure(real(RKC)) :: getFunc
4201 : type(schroder_type) , intent(in) :: method
4202 : real(RKC) , intent(inout) :: root
4203 : real(RKC) , value :: lb, ub
4204 : real(RKC) , value :: lf, uf
4205 : real(RKC) , intent(in) :: abstol
4206 : integer(IK) , intent(out) :: neval
4207 : integer(IK) , intent(in) :: niter
4208 : end subroutine
4209 : #endif
4210 :
4211 : #if RK3_ENABLED
4212 : recursive module subroutine setRootSchroderNiter_RK3(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4213 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4214 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderNiter_RK3
4215 : #endif
4216 : use pm_kind, only: RKC => RK3
4217 : procedure(real(RKC)) :: getFunc
4218 : type(schroder_type) , intent(in) :: method
4219 : real(RKC) , intent(inout) :: root
4220 : real(RKC) , value :: lb, ub
4221 : real(RKC) , value :: lf, uf
4222 : real(RKC) , intent(in) :: abstol
4223 : integer(IK) , intent(out) :: neval
4224 : integer(IK) , intent(in) :: niter
4225 : end subroutine
4226 : #endif
4227 :
4228 : #if RK2_ENABLED
4229 : recursive module subroutine setRootSchroderNiter_RK2(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4230 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4231 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderNiter_RK2
4232 : #endif
4233 : use pm_kind, only: RKC => RK2
4234 : procedure(real(RKC)) :: getFunc
4235 : type(schroder_type) , intent(in) :: method
4236 : real(RKC) , intent(inout) :: root
4237 : real(RKC) , value :: lb, ub
4238 : real(RKC) , value :: lf, uf
4239 : real(RKC) , intent(in) :: abstol
4240 : integer(IK) , intent(out) :: neval
4241 : integer(IK) , intent(in) :: niter
4242 : end subroutine
4243 : #endif
4244 :
4245 : #if RK1_ENABLED
4246 : recursive module subroutine setRootSchroderNiter_RK1(method, getFunc, root, lb, ub, lf, uf, abstol, neval, niter)
4247 : #if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
4248 : !DEC$ ATTRIBUTES DLLEXPORT :: setRootSchroderNiter_RK1
4249 : #endif
4250 : use pm_kind, only: RKC => RK1
4251 : procedure(real(RKC)) :: getFunc
4252 : type(schroder_type) , intent(in) :: method
4253 : real(RKC) , intent(inout) :: root
4254 : real(RKC) , value :: lb, ub
4255 : real(RKC) , value :: lf, uf
4256 : real(RKC) , intent(in) :: abstol
4257 : integer(IK) , intent(out) :: neval
4258 : integer(IK) , intent(in) :: niter
4259 : end subroutine
4260 : #endif
4261 :
4262 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4263 :
4264 : end interface
4265 :
4266 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4267 :
4268 0 : end module pm_mathRoot
|