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_mathLogAddExp](@ref pm_mathLogAddExp).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \AmirShahmoradi, Thursday 1:45 AM, August 22, 2019, Dallas, TX
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : submodule (pm_mathLogAddExp) 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 : implicit none
40 :
41 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 :
43 : contains
44 :
45 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46 :
47 : #define getLogAddExp_ENABLED 1
48 :
49 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 :
53 : #define SL_ENABLED 1
54 :
55 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 :
59 : #define Seq_ENABLED 1
60 :
61 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62 :
63 : #define CK_ENABLED 1
64 :
65 : #if CK5_ENABLED
66 : module procedure getLogAddExpSeqSL_CK5
67 : use pm_kind, only: CKC => CK5
68 : #include "pm_mathLogAddExp@routines.inc.F90"
69 : end procedure
70 : #endif
71 :
72 : #if CK4_ENABLED
73 1 : module procedure getLogAddExpSeqSL_CK4
74 : use pm_kind, only: CKC => CK4
75 : #include "pm_mathLogAddExp@routines.inc.F90"
76 1 : end procedure
77 : #endif
78 :
79 : #if CK3_ENABLED
80 0 : module procedure getLogAddExpSeqSL_CK3
81 : use pm_kind, only: CKC => CK3
82 : #include "pm_mathLogAddExp@routines.inc.F90"
83 0 : end procedure
84 : #endif
85 :
86 : #if CK2_ENABLED
87 1 : module procedure getLogAddExpSeqSL_CK2
88 : use pm_kind, only: CKC => CK2
89 : #include "pm_mathLogAddExp@routines.inc.F90"
90 1 : end procedure
91 : #endif
92 :
93 : #if CK1_ENABLED
94 1 : module procedure getLogAddExpSeqSL_CK1
95 : use pm_kind, only: CKC => CK1
96 : #include "pm_mathLogAddExp@routines.inc.F90"
97 1 : end procedure
98 : #endif
99 :
100 : #undef CK_ENABLED
101 :
102 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
103 :
104 : #define RK_ENABLED 1
105 :
106 : #if RK5_ENABLED
107 : module procedure getLogAddExpSeqSL_RK5
108 : use pm_kind, only: RKC => RK5
109 : #include "pm_mathLogAddExp@routines.inc.F90"
110 : end procedure
111 : #endif
112 :
113 : #if RK4_ENABLED
114 1 : module procedure getLogAddExpSeqSL_RK4
115 : use pm_kind, only: RKC => RK4
116 : #include "pm_mathLogAddExp@routines.inc.F90"
117 1 : end procedure
118 : #endif
119 :
120 : #if RK3_ENABLED
121 0 : module procedure getLogAddExpSeqSL_RK3
122 : use pm_kind, only: RKC => RK3
123 : #include "pm_mathLogAddExp@routines.inc.F90"
124 0 : end procedure
125 : #endif
126 :
127 : #if RK2_ENABLED
128 1 : module procedure getLogAddExpSeqSL_RK2
129 : use pm_kind, only: RKC => RK2
130 : #include "pm_mathLogAddExp@routines.inc.F90"
131 1 : end procedure
132 : #endif
133 :
134 : #if RK1_ENABLED
135 1 : module procedure getLogAddExpSeqSL_RK1
136 : use pm_kind, only: RKC => RK1
137 : #include "pm_mathLogAddExp@routines.inc.F90"
138 1 : end procedure
139 : #endif
140 :
141 : #undef RK_ENABLED
142 :
143 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 :
145 : #undef Seq_ENABLED
146 :
147 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 :
151 : #define Sel_ENABLED 1
152 :
153 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 :
155 : #define CK_ENABLED 1
156 :
157 : #if CK5_ENABLED
158 : module procedure getLogAddExpSelSL_CK5
159 : use pm_kind, only: CKC => CK5
160 : #include "pm_mathLogAddExp@routines.inc.F90"
161 : end procedure
162 : #endif
163 :
164 : #if CK4_ENABLED
165 0 : module procedure getLogAddExpSelSL_CK4
166 : use pm_kind, only: CKC => CK4
167 : #include "pm_mathLogAddExp@routines.inc.F90"
168 0 : end procedure
169 : #endif
170 :
171 : #if CK3_ENABLED
172 0 : module procedure getLogAddExpSelSL_CK3
173 : use pm_kind, only: CKC => CK3
174 : #include "pm_mathLogAddExp@routines.inc.F90"
175 0 : end procedure
176 : #endif
177 :
178 : #if CK2_ENABLED
179 0 : module procedure getLogAddExpSelSL_CK2
180 : use pm_kind, only: CKC => CK2
181 : #include "pm_mathLogAddExp@routines.inc.F90"
182 0 : end procedure
183 : #endif
184 :
185 : #if CK1_ENABLED
186 0 : module procedure getLogAddExpSelSL_CK1
187 : use pm_kind, only: CKC => CK1
188 : #include "pm_mathLogAddExp@routines.inc.F90"
189 0 : end procedure
190 : #endif
191 :
192 : #undef CK_ENABLED
193 :
194 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
195 :
196 : #define RK_ENABLED 1
197 :
198 : #if RK5_ENABLED
199 : module procedure getLogAddExpSelSL_RK5
200 : use pm_kind, only: RKC => RK5
201 : #include "pm_mathLogAddExp@routines.inc.F90"
202 : end procedure
203 : #endif
204 :
205 : #if RK4_ENABLED
206 0 : module procedure getLogAddExpSelSL_RK4
207 : use pm_kind, only: RKC => RK4
208 : #include "pm_mathLogAddExp@routines.inc.F90"
209 0 : end procedure
210 : #endif
211 :
212 : #if RK3_ENABLED
213 0 : module procedure getLogAddExpSelSL_RK3
214 : use pm_kind, only: RKC => RK3
215 : #include "pm_mathLogAddExp@routines.inc.F90"
216 0 : end procedure
217 : #endif
218 :
219 : #if RK2_ENABLED
220 0 : module procedure getLogAddExpSelSL_RK2
221 : use pm_kind, only: RKC => RK2
222 : #include "pm_mathLogAddExp@routines.inc.F90"
223 0 : end procedure
224 : #endif
225 :
226 : #if RK1_ENABLED
227 0 : module procedure getLogAddExpSelSL_RK1
228 : use pm_kind, only: RKC => RK1
229 : #include "pm_mathLogAddExp@routines.inc.F90"
230 0 : end procedure
231 : #endif
232 :
233 : #undef RK_ENABLED
234 :
235 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
236 :
237 : #undef Sel_ENABLED
238 :
239 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
240 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
241 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
242 :
243 : #undef SL_ENABLED
244 :
245 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
246 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
247 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
248 :
249 : #define MM_ENABLED 1
250 :
251 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
252 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254 :
255 : #define Seq_ENABLED 1
256 :
257 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
258 :
259 : #define CK_ENABLED 1
260 :
261 : #if CK5_ENABLED
262 : module procedure getLogAddExpSeqMM_CK5
263 : use pm_kind, only: CKC => CK5
264 : #include "pm_mathLogAddExp@routines.inc.F90"
265 : end procedure
266 : #endif
267 :
268 : #if CK4_ENABLED
269 0 : module procedure getLogAddExpSeqMM_CK4
270 : use pm_kind, only: CKC => CK4
271 : #include "pm_mathLogAddExp@routines.inc.F90"
272 0 : end procedure
273 : #endif
274 :
275 : #if CK3_ENABLED
276 0 : module procedure getLogAddExpSeqMM_CK3
277 : use pm_kind, only: CKC => CK3
278 : #include "pm_mathLogAddExp@routines.inc.F90"
279 0 : end procedure
280 : #endif
281 :
282 : #if CK2_ENABLED
283 0 : module procedure getLogAddExpSeqMM_CK2
284 : use pm_kind, only: CKC => CK2
285 : #include "pm_mathLogAddExp@routines.inc.F90"
286 0 : end procedure
287 : #endif
288 :
289 : #if CK1_ENABLED
290 0 : module procedure getLogAddExpSeqMM_CK1
291 : use pm_kind, only: CKC => CK1
292 : #include "pm_mathLogAddExp@routines.inc.F90"
293 0 : end procedure
294 : #endif
295 :
296 : #undef CK_ENABLED
297 :
298 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
299 :
300 : #define RK_ENABLED 1
301 :
302 : #if RK5_ENABLED
303 : module procedure getLogAddExpSeqMM_RK5
304 : use pm_kind, only: RKC => RK5
305 : #include "pm_mathLogAddExp@routines.inc.F90"
306 : end procedure
307 : #endif
308 :
309 : #if RK4_ENABLED
310 5000 : module procedure getLogAddExpSeqMM_RK4
311 : use pm_kind, only: RKC => RK4
312 : #include "pm_mathLogAddExp@routines.inc.F90"
313 5000 : end procedure
314 : #endif
315 :
316 : #if RK3_ENABLED
317 5000 : module procedure getLogAddExpSeqMM_RK3
318 : use pm_kind, only: RKC => RK3
319 : #include "pm_mathLogAddExp@routines.inc.F90"
320 5000 : end procedure
321 : #endif
322 :
323 : #if RK2_ENABLED
324 5000 : module procedure getLogAddExpSeqMM_RK2
325 : use pm_kind, only: RKC => RK2
326 : #include "pm_mathLogAddExp@routines.inc.F90"
327 5000 : end procedure
328 : #endif
329 :
330 : #if RK1_ENABLED
331 33025 : module procedure getLogAddExpSeqMM_RK1
332 : use pm_kind, only: RKC => RK1
333 : #include "pm_mathLogAddExp@routines.inc.F90"
334 33025 : end procedure
335 : #endif
336 :
337 : #undef RK_ENABLED
338 :
339 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340 :
341 : #undef Seq_ENABLED
342 :
343 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346 :
347 : #define Sel_ENABLED 1
348 :
349 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 :
351 : #define CK_ENABLED 1
352 :
353 : #if CK5_ENABLED
354 : module procedure getLogAddExpSelMM_CK5
355 : use pm_kind, only: CKC => CK5
356 : #include "pm_mathLogAddExp@routines.inc.F90"
357 : end procedure
358 : #endif
359 :
360 : #if CK4_ENABLED
361 0 : module procedure getLogAddExpSelMM_CK4
362 : use pm_kind, only: CKC => CK4
363 : #include "pm_mathLogAddExp@routines.inc.F90"
364 0 : end procedure
365 : #endif
366 :
367 : #if CK3_ENABLED
368 0 : module procedure getLogAddExpSelMM_CK3
369 : use pm_kind, only: CKC => CK3
370 : #include "pm_mathLogAddExp@routines.inc.F90"
371 0 : end procedure
372 : #endif
373 :
374 : #if CK2_ENABLED
375 0 : module procedure getLogAddExpSelMM_CK2
376 : use pm_kind, only: CKC => CK2
377 : #include "pm_mathLogAddExp@routines.inc.F90"
378 0 : end procedure
379 : #endif
380 :
381 : #if CK1_ENABLED
382 0 : module procedure getLogAddExpSelMM_CK1
383 : use pm_kind, only: CKC => CK1
384 : #include "pm_mathLogAddExp@routines.inc.F90"
385 0 : end procedure
386 : #endif
387 :
388 : #undef CK_ENABLED
389 :
390 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
391 :
392 : #define RK_ENABLED 1
393 :
394 : #if RK5_ENABLED
395 : module procedure getLogAddExpSelMM_RK5
396 : use pm_kind, only: RKC => RK5
397 : #include "pm_mathLogAddExp@routines.inc.F90"
398 : end procedure
399 : #endif
400 :
401 : #if RK4_ENABLED
402 0 : module procedure getLogAddExpSelMM_RK4
403 : use pm_kind, only: RKC => RK4
404 : #include "pm_mathLogAddExp@routines.inc.F90"
405 0 : end procedure
406 : #endif
407 :
408 : #if RK3_ENABLED
409 0 : module procedure getLogAddExpSelMM_RK3
410 : use pm_kind, only: RKC => RK3
411 : #include "pm_mathLogAddExp@routines.inc.F90"
412 0 : end procedure
413 : #endif
414 :
415 : #if RK2_ENABLED
416 0 : module procedure getLogAddExpSelMM_RK2
417 : use pm_kind, only: RKC => RK2
418 : #include "pm_mathLogAddExp@routines.inc.F90"
419 0 : end procedure
420 : #endif
421 :
422 : #if RK1_ENABLED
423 0 : module procedure getLogAddExpSelMM_RK1
424 : use pm_kind, only: RKC => RK1
425 : #include "pm_mathLogAddExp@routines.inc.F90"
426 0 : end procedure
427 : #endif
428 :
429 : #undef RK_ENABLED
430 :
431 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432 :
433 : #undef Sel_ENABLED
434 :
435 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
436 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
437 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438 :
439 : #undef MM_ENABLED
440 :
441 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
442 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
443 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
444 :
445 : #undef getLogAddExp_ENABLED
446 :
447 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
448 :
449 : end submodule routines
|