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_mathLogSumExp](@ref pm_mathLogSumExp).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \FatemehBagheri, Wednesday 12:20 PM, September 22, 2021, Dallas, TX
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : submodule (pm_mathLogSumExp) 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 getLogSumExp_ENABLED 1
48 :
49 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 :
53 : #define Def_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 getLogSumExpDefSeq_CK5
67 : use pm_kind, only: TKC => CK5
68 : #include "pm_mathLogSumExp@routines.inc.F90"
69 : end procedure
70 : #endif
71 :
72 : #if CK4_ENABLED
73 0 : module procedure getLogSumExpDefSeq_CK4
74 : use pm_kind, only: TKC => CK4
75 : #include "pm_mathLogSumExp@routines.inc.F90"
76 0 : end procedure
77 : #endif
78 :
79 : #if CK3_ENABLED
80 0 : module procedure getLogSumExpDefSeq_CK3
81 : use pm_kind, only: TKC => CK3
82 : #include "pm_mathLogSumExp@routines.inc.F90"
83 0 : end procedure
84 : #endif
85 :
86 : #if CK2_ENABLED
87 0 : module procedure getLogSumExpDefSeq_CK2
88 : use pm_kind, only: TKC => CK2
89 : #include "pm_mathLogSumExp@routines.inc.F90"
90 0 : end procedure
91 : #endif
92 :
93 : #if CK1_ENABLED
94 0 : module procedure getLogSumExpDefSeq_CK1
95 : use pm_kind, only: TKC => CK1
96 : #include "pm_mathLogSumExp@routines.inc.F90"
97 0 : 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 getLogSumExpDefSeq_RK5
108 : use pm_kind, only: TKC => RK5
109 : #include "pm_mathLogSumExp@routines.inc.F90"
110 : end procedure
111 : #endif
112 :
113 : #if RK4_ENABLED
114 0 : module procedure getLogSumExpDefSeq_RK4
115 : use pm_kind, only: TKC => RK4
116 : #include "pm_mathLogSumExp@routines.inc.F90"
117 0 : end procedure
118 : #endif
119 :
120 : #if RK3_ENABLED
121 0 : module procedure getLogSumExpDefSeq_RK3
122 : use pm_kind, only: TKC => RK3
123 : #include "pm_mathLogSumExp@routines.inc.F90"
124 0 : end procedure
125 : #endif
126 :
127 : #if RK2_ENABLED
128 490000 : module procedure getLogSumExpDefSeq_RK2
129 : use pm_kind, only: TKC => RK2
130 : #include "pm_mathLogSumExp@routines.inc.F90"
131 490000 : end procedure
132 : #endif
133 :
134 : #if RK1_ENABLED
135 0 : module procedure getLogSumExpDefSeq_RK1
136 : use pm_kind, only: TKC => RK1
137 : #include "pm_mathLogSumExp@routines.inc.F90"
138 0 : end procedure
139 : #endif
140 :
141 : #undef RK_ENABLED
142 :
143 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 :
145 : #undef Seq_ENABLED
146 :
147 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
148 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
149 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
150 :
151 : #undef Def_ENABLED
152 :
153 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156 :
157 : #define Max_ENABLED 1
158 :
159 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
160 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
162 :
163 : #define Seq_ENABLED 1
164 :
165 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
166 :
167 : #define CK_ENABLED 1
168 :
169 : #if CK5_ENABLED
170 : module procedure getLogSumExpMaxSeq_CK5
171 : use pm_kind, only: TKC => CK5
172 : #include "pm_mathLogSumExp@routines.inc.F90"
173 : end procedure
174 : #endif
175 :
176 : #if CK4_ENABLED
177 1 : module procedure getLogSumExpMaxSeq_CK4
178 : use pm_kind, only: TKC => CK4
179 : #include "pm_mathLogSumExp@routines.inc.F90"
180 1 : end procedure
181 : #endif
182 :
183 : #if CK3_ENABLED
184 0 : module procedure getLogSumExpMaxSeq_CK3
185 : use pm_kind, only: TKC => CK3
186 : #include "pm_mathLogSumExp@routines.inc.F90"
187 0 : end procedure
188 : #endif
189 :
190 : #if CK2_ENABLED
191 1 : module procedure getLogSumExpMaxSeq_CK2
192 : use pm_kind, only: TKC => CK2
193 : #include "pm_mathLogSumExp@routines.inc.F90"
194 1 : end procedure
195 : #endif
196 :
197 : #if CK1_ENABLED
198 1 : module procedure getLogSumExpMaxSeq_CK1
199 : use pm_kind, only: TKC => CK1
200 : #include "pm_mathLogSumExp@routines.inc.F90"
201 1 : end procedure
202 : #endif
203 :
204 : #undef CK_ENABLED
205 :
206 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
207 :
208 : #define RK_ENABLED 1
209 :
210 : #if RK5_ENABLED
211 : module procedure getLogSumExpMaxSeq_RK5
212 : use pm_kind, only: TKC => RK5
213 : #include "pm_mathLogSumExp@routines.inc.F90"
214 : end procedure
215 : #endif
216 :
217 : #if RK4_ENABLED
218 2151 : module procedure getLogSumExpMaxSeq_RK4
219 : use pm_kind, only: TKC => RK4
220 : #include "pm_mathLogSumExp@routines.inc.F90"
221 2151 : end procedure
222 : #endif
223 :
224 : #if RK3_ENABLED
225 2144 : module procedure getLogSumExpMaxSeq_RK3
226 : use pm_kind, only: TKC => RK3
227 : #include "pm_mathLogSumExp@routines.inc.F90"
228 2144 : end procedure
229 : #endif
230 :
231 : #if RK2_ENABLED
232 2141 : module procedure getLogSumExpMaxSeq_RK2
233 : use pm_kind, only: TKC => RK2
234 : #include "pm_mathLogSumExp@routines.inc.F90"
235 2141 : end procedure
236 : #endif
237 :
238 : #if RK1_ENABLED
239 18990 : module procedure getLogSumExpMaxSeq_RK1
240 : use pm_kind, only: TKC => RK1
241 : #include "pm_mathLogSumExp@routines.inc.F90"
242 18990 : end procedure
243 : #endif
244 :
245 : #undef RK_ENABLED
246 :
247 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
248 :
249 : #undef Seq_ENABLED
250 :
251 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
252 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
253 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
254 :
255 : #define Sel_ENABLED 1
256 :
257 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
258 :
259 : #define CK_ENABLED 1
260 :
261 : #if CK5_ENABLED
262 : module procedure getLogSumExpMaxSel_CK5
263 : use pm_kind, only: TKC => CK5
264 : #include "pm_mathLogSumExp@routines.inc.F90"
265 : end procedure
266 : #endif
267 :
268 : #if CK4_ENABLED
269 0 : module procedure getLogSumExpMaxSel_CK4
270 : use pm_kind, only: TKC => CK4
271 : #include "pm_mathLogSumExp@routines.inc.F90"
272 0 : end procedure
273 : #endif
274 :
275 : #if CK3_ENABLED
276 0 : module procedure getLogSumExpMaxSel_CK3
277 : use pm_kind, only: TKC => CK3
278 : #include "pm_mathLogSumExp@routines.inc.F90"
279 0 : end procedure
280 : #endif
281 :
282 : #if CK2_ENABLED
283 0 : module procedure getLogSumExpMaxSel_CK2
284 : use pm_kind, only: TKC => CK2
285 : #include "pm_mathLogSumExp@routines.inc.F90"
286 0 : end procedure
287 : #endif
288 :
289 : #if CK1_ENABLED
290 0 : module procedure getLogSumExpMaxSel_CK1
291 : use pm_kind, only: TKC => CK1
292 : #include "pm_mathLogSumExp@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 getLogSumExpMaxSel_RK5
304 : use pm_kind, only: TKC => RK5
305 : #include "pm_mathLogSumExp@routines.inc.F90"
306 : end procedure
307 : #endif
308 :
309 : #if RK4_ENABLED
310 0 : module procedure getLogSumExpMaxSel_RK4
311 : use pm_kind, only: TKC => RK4
312 : #include "pm_mathLogSumExp@routines.inc.F90"
313 0 : end procedure
314 : #endif
315 :
316 : #if RK3_ENABLED
317 0 : module procedure getLogSumExpMaxSel_RK3
318 : use pm_kind, only: TKC => RK3
319 : #include "pm_mathLogSumExp@routines.inc.F90"
320 0 : end procedure
321 : #endif
322 :
323 : #if RK2_ENABLED
324 0 : module procedure getLogSumExpMaxSel_RK2
325 : use pm_kind, only: TKC => RK2
326 : #include "pm_mathLogSumExp@routines.inc.F90"
327 0 : end procedure
328 : #endif
329 :
330 : #if RK1_ENABLED
331 0 : module procedure getLogSumExpMaxSel_RK1
332 : use pm_kind, only: TKC => RK1
333 : #include "pm_mathLogSumExp@routines.inc.F90"
334 0 : end procedure
335 : #endif
336 :
337 : #undef RK_ENABLED
338 :
339 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
340 :
341 : #undef Sel_ENABLED
342 :
343 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
344 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
345 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
346 :
347 : #undef Max_ENABLED
348 :
349 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
350 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
351 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
352 :
353 : #undef getLogSumExp_ENABLED
354 :
355 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356 :
357 : end submodule routines
|