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 file contains procedure implementations of [pm_mathBeta](@ref pm_mathBeta).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \AmirShahmoradi, Oct 16, 2009, 11:14 AM, Michigan
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : submodule (pm_mathBeta) routines ! LCOV_EXCL_LINE
28 :
29 : #if CHECK_ENABLED
30 : use pm_err, only: getFine
31 : use pm_val2str, only: getStr
32 : use pm_err, only: setAsserted
33 : #define CHECK_ASSERTION(LINE,ASSERTION,MSG) \
34 : call setAsserted(ASSERTION,getFine(__FILE__,LINE)//MODULE_NAME//MSG);
35 : #else
36 : #define CHECK_ASSERTION(LINE,ASSERTION,MSG) continue;
37 : #endif
38 :
39 : use pm_mathRoot, only: newton
40 : use pm_mathRoot, only: setRoot
41 : use pm_mathRoot, only: bisection
42 : use pm_mathLog1p, only: getLog1p
43 : use pm_math1mexp, only: get1mexp
44 : use pm_distNorm, only: setNormQuan
45 : use pm_distBeta, only: setBetaLogPDF
46 : use pm_quadPack, only: getQuadErr, weps
47 : use pm_distBeta, only: getBetaPDF
48 : use pm_quadPack, only: qrule => GK21
49 : implicit none
50 :
51 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 :
53 : contains
54 :
55 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 :
57 : #define getLogBeta_ENABLED 1
58 :
59 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 :
61 : #define RK_ENABLED 1
62 :
63 : #if RK5_ENABLED
64 : module procedure getLogBeta_RK5
65 : use pm_kind, only: RKC => RK5
66 : #include "pm_mathBeta@routines.inc.F90"
67 : end procedure
68 : #endif
69 :
70 : #if RK4_ENABLED
71 65206 : module procedure getLogBeta_RK4
72 : use pm_kind, only: RKC => RK4
73 : #include "pm_mathBeta@routines.inc.F90"
74 65206 : end procedure
75 : #endif
76 :
77 : #if RK3_ENABLED
78 0 : module procedure getLogBeta_RK3
79 : use pm_kind, only: RKC => RK3
80 : #include "pm_mathBeta@routines.inc.F90"
81 0 : end procedure
82 : #endif
83 :
84 : #if RK2_ENABLED
85 76389 : module procedure getLogBeta_RK2
86 : use pm_kind, only: RKC => RK2
87 : #include "pm_mathBeta@routines.inc.F90"
88 76389 : end procedure
89 : #endif
90 :
91 : #if RK1_ENABLED
92 22192 : module procedure getLogBeta_RK1
93 : use pm_kind, only: RKC => RK1
94 : #include "pm_mathBeta@routines.inc.F90"
95 22192 : end procedure
96 : #endif
97 :
98 : #undef RK_ENABLED
99 :
100 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
101 :
102 : #undef getLogBeta_ENABLED
103 :
104 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105 :
106 : #define getBetaInc_ENABLED 1
107 :
108 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
109 :
110 : #define RK_ENABLED 1
111 :
112 : #if RK5_ENABLED
113 : module procedure getBetaInc_RK5
114 : use pm_kind, only: RKC => RK5
115 : #include "pm_mathBeta@routines.inc.F90"
116 : end procedure
117 : #endif
118 :
119 : #if RK4_ENABLED
120 5004 : module procedure getBetaInc_RK4
121 : use pm_kind, only: RKC => RK4
122 : #include "pm_mathBeta@routines.inc.F90"
123 5004 : end procedure
124 : #endif
125 :
126 : #if RK3_ENABLED
127 0 : module procedure getBetaInc_RK3
128 : use pm_kind, only: RKC => RK3
129 : #include "pm_mathBeta@routines.inc.F90"
130 0 : end procedure
131 : #endif
132 :
133 : #if RK2_ENABLED
134 4044 : module procedure getBetaInc_RK2
135 : use pm_kind, only: RKC => RK2
136 : #include "pm_mathBeta@routines.inc.F90"
137 4044 : end procedure
138 : #endif
139 :
140 : #if RK1_ENABLED
141 8 : module procedure getBetaInc_RK1
142 : use pm_kind, only: RKC => RK1
143 : #include "pm_mathBeta@routines.inc.F90"
144 8 : end procedure
145 : #endif
146 :
147 : #undef RK_ENABLED
148 :
149 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 :
151 : #undef getBetaInc_ENABLED
152 :
153 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 :
155 : #define setBetaInc_ENABLED 1
156 :
157 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160 :
161 : #define Def_ENABLED 1
162 :
163 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 :
165 : #define RK_ENABLED 1
166 :
167 : #if RK5_ENABLED
168 : module procedure setBetaIncDef_RK5
169 : use pm_kind, only: RKC => RK5
170 : #include "pm_mathBeta@routines.inc.F90"
171 : end procedure
172 : #endif
173 :
174 : #if RK4_ENABLED
175 534446 : module procedure setBetaIncDef_RK4
176 : use pm_kind, only: RKC => RK4
177 : #include "pm_mathBeta@routines.inc.F90"
178 : end procedure
179 : #endif
180 :
181 : #if RK3_ENABLED
182 0 : module procedure setBetaIncDef_RK3
183 : use pm_kind, only: RKC => RK3
184 : #include "pm_mathBeta@routines.inc.F90"
185 : end procedure
186 : #endif
187 :
188 : #if RK2_ENABLED
189 103115 : module procedure setBetaIncDef_RK2
190 : use pm_kind, only: RKC => RK2
191 : #include "pm_mathBeta@routines.inc.F90"
192 : end procedure
193 : #endif
194 :
195 : #if RK1_ENABLED
196 91106 : module procedure setBetaIncDef_RK1
197 : use pm_kind, only: RKC => RK1
198 : #include "pm_mathBeta@routines.inc.F90"
199 : end procedure
200 : #endif
201 :
202 : #undef RK_ENABLED
203 :
204 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
205 :
206 : #undef Def_ENABLED
207 :
208 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
209 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
210 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
211 :
212 : #define GK21_ENABLED 1
213 :
214 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
215 :
216 : #define RK_ENABLED 1
217 :
218 : #if RK5_ENABLED
219 : module procedure setBetaIncGK21_RK5
220 : use pm_kind, only: RKC => RK5
221 : #include "pm_mathBeta@routines.inc.F90"
222 : end procedure
223 : #endif
224 :
225 : #if RK4_ENABLED
226 2 : module procedure setBetaIncGK21_RK4
227 : use pm_kind, only: RKC => RK4
228 : #include "pm_mathBeta@routines.inc.F90"
229 : end procedure
230 : #endif
231 :
232 : #if RK3_ENABLED
233 0 : module procedure setBetaIncGK21_RK3
234 : use pm_kind, only: RKC => RK3
235 : #include "pm_mathBeta@routines.inc.F90"
236 : end procedure
237 : #endif
238 :
239 : #if RK2_ENABLED
240 0 : module procedure setBetaIncGK21_RK2
241 : use pm_kind, only: RKC => RK2
242 : #include "pm_mathBeta@routines.inc.F90"
243 : end procedure
244 : #endif
245 :
246 : #if RK1_ENABLED
247 0 : module procedure setBetaIncGK21_RK1
248 : use pm_kind, only: RKC => RK1
249 : #include "pm_mathBeta@routines.inc.F90"
250 : end procedure
251 : #endif
252 :
253 : #undef RK_ENABLED
254 :
255 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
256 :
257 : #undef GK21_ENABLED
258 :
259 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
260 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
261 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
262 :
263 : #undef setBetaInc_ENABLED
264 :
265 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
266 :
267 : #define getBetaInv_ENABLED 1
268 :
269 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 :
271 : #define RK_ENABLED 1
272 :
273 : #if RK5_ENABLED
274 : module procedure getBetaInv_RK5
275 : use pm_kind, only: RKC => RK5
276 : #include "pm_mathBeta@routines.inc.F90"
277 : end procedure
278 : #endif
279 :
280 : #if RK4_ENABLED
281 40000 : module procedure getBetaInv_RK4
282 : use pm_kind, only: RKC => RK4
283 : #include "pm_mathBeta@routines.inc.F90"
284 40000 : end procedure
285 : #endif
286 :
287 : #if RK3_ENABLED
288 0 : module procedure getBetaInv_RK3
289 : use pm_kind, only: RKC => RK3
290 : #include "pm_mathBeta@routines.inc.F90"
291 0 : end procedure
292 : #endif
293 :
294 : #if RK2_ENABLED
295 5009 : module procedure getBetaInv_RK2
296 : use pm_kind, only: RKC => RK2
297 : #include "pm_mathBeta@routines.inc.F90"
298 5009 : end procedure
299 : #endif
300 :
301 : #if RK1_ENABLED
302 5000 : module procedure getBetaInv_RK1
303 : use pm_kind, only: RKC => RK1
304 : #include "pm_mathBeta@routines.inc.F90"
305 5000 : end procedure
306 : #endif
307 :
308 : #undef RK_ENABLED
309 :
310 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
311 :
312 : #undef getBetaInv_ENABLED
313 :
314 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
315 :
316 : #define setBetaInv_ENABLED 1
317 :
318 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
319 :
320 : #define RK_ENABLED 1
321 :
322 : #if RK5_ENABLED
323 : module procedure setBetaInv_RK5
324 : use pm_kind, only: RKC => RK5
325 : #include "pm_mathBeta@routines.inc.F90"
326 : end procedure
327 : #endif
328 :
329 : #if RK4_ENABLED
330 50000 : module procedure setBetaInv_RK4
331 : use pm_kind, only: RKC => RK4
332 : #include "pm_mathBeta@routines.inc.F90"
333 : end procedure
334 : #endif
335 :
336 : #if RK3_ENABLED
337 0 : module procedure setBetaInv_RK3
338 : use pm_kind, only: RKC => RK3
339 : #include "pm_mathBeta@routines.inc.F90"
340 : end procedure
341 : #endif
342 :
343 : #if RK2_ENABLED
344 10018 : module procedure setBetaInv_RK2
345 : use pm_kind, only: RKC => RK2
346 : #include "pm_mathBeta@routines.inc.F90"
347 : end procedure
348 : #endif
349 :
350 : #if RK1_ENABLED
351 10000 : module procedure setBetaInv_RK1
352 : use pm_kind, only: RKC => RK1
353 : #include "pm_mathBeta@routines.inc.F90"
354 : end procedure
355 : #endif
356 :
357 : #undef RK_ENABLED
358 :
359 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
360 :
361 : #undef setBetaInv_ENABLED
362 :
363 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
364 :
365 : #undef CHECK_ASSERTION
366 :
367 : end submodule routines
|