ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_mathExp.F90
Go to the documentation of this file.
1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
3!!!! !!!!
4!!!! ParaMonte: Parallel Monte Carlo and Machine Learning Library. !!!!
5!!!! !!!!
6!!!! Copyright (C) 2012-present, The Computational Data Science Lab !!!!
7!!!! !!!!
8!!!! This file is part of the ParaMonte library. !!!!
9!!!! !!!!
10!!!! LICENSE !!!!
11!!!! !!!!
12!!!! https://github.com/cdslaborg/paramonte/blob/main/LICENSE.md !!!!
13!!!! !!!!
14!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
41
42!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
45
46 use pm_kind, only: SK, IK, LK
47
48 implicit none
49
50 character(*, SK), parameter :: MODULE_NAME = "@pm_mathExp"
51
52!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53
113 interface isIntPow
114
115 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116
117#if IK5_ENABLED
118 PURE elemental module function isIntPowArb_IK5(absx, base) result(powisint)
119#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
120 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowArb_IK5
121#endif
122 use pm_kind, only: IKG => IK5
123 integer(IKG), intent(in) :: absx
124 integer(IKG), intent(in) :: base
125 logical(LK) :: powisint
126 end function
127#endif
128
129#if IK4_ENABLED
130 PURE elemental module function isIntPowArb_IK4(absx, base) result(powisint)
131#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
132 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowArb_IK4
133#endif
134 use pm_kind, only: IKG => IK4
135 integer(IKG), intent(in) :: absx
136 integer(IKG), intent(in) :: base
137 logical(LK) :: powisint
138 end function
139#endif
140
141#if IK3_ENABLED
142 PURE elemental module function isIntPowArb_IK3(absx, base) result(powisint)
143#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
144 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowArb_IK3
145#endif
146 use pm_kind, only: IKG => IK3
147 integer(IKG), intent(in) :: absx
148 integer(IKG), intent(in) :: base
149 logical(LK) :: powisint
150 end function
151#endif
152
153#if IK2_ENABLED
154 PURE elemental module function isIntPowArb_IK2(absx, base) result(powisint)
155#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
156 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowArb_IK2
157#endif
158 use pm_kind, only: IKG => IK2
159 integer(IKG), intent(in) :: absx
160 integer(IKG), intent(in) :: base
161 logical(LK) :: powisint
162 end function
163#endif
164
165#if IK1_ENABLED
166 PURE elemental module function isIntPowArb_IK1(absx, base) result(powisint)
167#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
168 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowArb_IK1
169#endif
170 use pm_kind, only: IKG => IK1
171 integer(IKG), intent(in) :: absx
172 integer(IKG), intent(in) :: base
173 logical(LK) :: powisint
174 end function
175#endif
176
177 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178
179#if IK5_ENABLED
180 PURE elemental module function isIntPowDef_IK5(absx) result(powisint)
181#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
182 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowDef_IK5
183#endif
184 use pm_kind, only: IKG => IK5
185 integer(IKG), intent(in) :: absx
186 logical(LK) :: powisint
187 end function
188#endif
189
190#if IK4_ENABLED
191 PURE elemental module function isIntPowDef_IK4(absx) result(powisint)
192#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
193 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowDef_IK4
194#endif
195 use pm_kind, only: IKG => IK4
196 integer(IKG), intent(in) :: absx
197 logical(LK) :: powisint
198 end function
199#endif
200
201#if IK3_ENABLED
202 PURE elemental module function isIntPowDef_IK3(absx) result(powisint)
203#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
204 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowDef_IK3
205#endif
206 use pm_kind, only: IKG => IK3
207 integer(IKG), intent(in) :: absx
208 logical(LK) :: powisint
209 end function
210#endif
211
212#if IK2_ENABLED
213 PURE elemental module function isIntPowDef_IK2(absx) result(powisint)
214#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
215 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowDef_IK2
216#endif
217 use pm_kind, only: IKG => IK2
218 integer(IKG), intent(in) :: absx
219 logical(LK) :: powisint
220 end function
221#endif
222
223#if IK1_ENABLED
224 PURE elemental module function isIntPowDef_IK1(absx) result(powisint)
225#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
226 !DEC$ ATTRIBUTES DLLEXPORT :: isIntPowDef_IK1
227#endif
228 use pm_kind, only: IKG => IK1
229 integer(IKG), intent(in) :: absx
230 logical(LK) :: powisint
231 end function
232#endif
233
234 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
235
236 end interface
237
238!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
239
309 interface getExpNext
310
311 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
312
313#if IK5_ENABLED
314 PURE elemental module function getExpNext_IK5(absx, base) result(expNext)
315#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
316 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_IK5
317#endif
318 use pm_kind, only: IKG => IK5
319 integer(IKG), intent(in) :: absx
320 integer(IKG), intent(in), optional :: base
321 integer(IKG) :: expNext
322 end function
323#endif
324
325#if IK4_ENABLED
326 PURE elemental module function getExpNext_IK4(absx, base) result(expNext)
327#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
328 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_IK4
329#endif
330 use pm_kind, only: IKG => IK4
331 integer(IKG), intent(in) :: absx
332 integer(IKG), intent(in), optional :: base
333 integer(IKG) :: expNext
334 end function
335#endif
336
337#if IK3_ENABLED
338 PURE elemental module function getExpNext_IK3(absx, base) result(expNext)
339#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
340 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_IK3
341#endif
342 use pm_kind, only: IKG => IK3
343 integer(IKG), intent(in) :: absx
344 integer(IKG), intent(in), optional :: base
345 integer(IKG) :: expNext
346 end function
347#endif
348
349#if IK2_ENABLED
350 PURE elemental module function getExpNext_IK2(absx, base) result(expNext)
351#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
352 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_IK2
353#endif
354 use pm_kind, only: IKG => IK2
355 integer(IKG), intent(in) :: absx
356 integer(IKG), intent(in), optional :: base
357 integer(IKG) :: expNext
358 end function
359#endif
360
361#if IK1_ENABLED
362 PURE elemental module function getExpNext_IK1(absx, base) result(expNext)
363#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
364 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_IK1
365#endif
366 use pm_kind, only: IKG => IK1
367 integer(IKG), intent(in) :: absx
368 integer(IKG), intent(in), optional :: base
369 integer(IKG) :: expNext
370 end function
371#endif
372
373 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
374
375#if RK5_ENABLED
376 PURE elemental module function getExpNext_RK5(absx, base) result(expNext)
377#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
378 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_RK5
379#endif
380 use pm_kind, only: RKG => RK5
381 real(RKG) , intent(in) :: absx
382 real(RKG) , intent(in), optional :: base
383 integer(IK) :: expNext
384 end function
385#endif
386
387#if RK4_ENABLED
388 PURE elemental module function getExpNext_RK4(absx, base) result(expNext)
389#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
390 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_RK4
391#endif
392 use pm_kind, only: RKG => RK4
393 real(RKG) , intent(in) :: absx
394 real(RKG) , intent(in), optional :: base
395 integer(IK) :: expNext
396 end function
397#endif
398
399#if RK3_ENABLED
400 PURE elemental module function getExpNext_RK3(absx, base) result(expNext)
401#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
402 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_RK3
403#endif
404 use pm_kind, only: RKG => RK3
405 real(RKG) , intent(in) :: absx
406 real(RKG) , intent(in), optional :: base
407 integer(IK) :: expNext
408 end function
409#endif
410
411#if RK2_ENABLED
412 PURE elemental module function getExpNext_RK2(absx, base) result(expNext)
413#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
414 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_RK2
415#endif
416 use pm_kind, only: RKG => RK2
417 real(RKG) , intent(in) :: absx
418 real(RKG) , intent(in), optional :: base
419 integer(IK) :: expNext
420 end function
421#endif
422
423#if RK1_ENABLED
424 PURE elemental module function getExpNext_RK1(absx, base) result(expNext)
425#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
426 !DEC$ ATTRIBUTES DLLEXPORT :: getExpNext_RK1
427#endif
428 use pm_kind, only: RKG => RK1
429 real(RKG) , intent(in) :: absx
430 real(RKG) , intent(in), optional :: base
431 integer(IK) :: expNext
432 end function
433#endif
434
435 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
436
437 end interface
438
439!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
440
510 interface getExpPrev
511
512 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
513
514#if IK5_ENABLED
515 PURE elemental module function getExpPrev_IK5(absx, base) result(expPrev)
516#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
517 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_IK5
518#endif
519 use pm_kind, only: IKG => IK5
520 integer(IKG), intent(in) :: absx
521 integer(IKG), intent(in), optional :: base
522 integer(IKG) :: expPrev
523 end function
524#endif
525
526#if IK4_ENABLED
527 PURE elemental module function getExpPrev_IK4(absx, base) result(expPrev)
528#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
529 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_IK4
530#endif
531 use pm_kind, only: IKG => IK4
532 integer(IKG), intent(in) :: absx
533 integer(IKG), intent(in), optional :: base
534 integer(IKG) :: expPrev
535 end function
536#endif
537
538#if IK3_ENABLED
539 PURE elemental module function getExpPrev_IK3(absx, base) result(expPrev)
540#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
541 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_IK3
542#endif
543 use pm_kind, only: IKG => IK3
544 integer(IKG), intent(in) :: absx
545 integer(IKG), intent(in), optional :: base
546 integer(IKG) :: expPrev
547 end function
548#endif
549
550#if IK2_ENABLED
551 PURE elemental module function getExpPrev_IK2(absx, base) result(expPrev)
552#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
553 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_IK2
554#endif
555 use pm_kind, only: IKG => IK2
556 integer(IKG), intent(in) :: absx
557 integer(IKG), intent(in), optional :: base
558 integer(IKG) :: expPrev
559 end function
560#endif
561
562#if IK1_ENABLED
563 PURE elemental module function getExpPrev_IK1(absx, base) result(expPrev)
564#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
565 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_IK1
566#endif
567 use pm_kind, only: IKG => IK1
568 integer(IKG), intent(in) :: absx
569 integer(IKG), intent(in), optional :: base
570 integer(IKG) :: expPrev
571 end function
572#endif
573
574 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
575
576#if RK5_ENABLED
577 PURE elemental module function getExpPrev_RK5(absx, base) result(expPrev)
578#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
579 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_RK5
580#endif
581 use pm_kind, only: RKG => RK5
582 real(RKG) , intent(in) :: absx
583 real(RKG) , intent(in), optional :: base
584 integer(IK) :: expPrev
585 end function
586#endif
587
588#if RK4_ENABLED
589 PURE elemental module function getExpPrev_RK4(absx, base) result(expPrev)
590#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
591 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_RK4
592#endif
593 use pm_kind, only: RKG => RK4
594 real(RKG) , intent(in) :: absx
595 real(RKG) , intent(in), optional :: base
596 integer(IK) :: expPrev
597 end function
598#endif
599
600#if RK3_ENABLED
601 PURE elemental module function getExpPrev_RK3(absx, base) result(expPrev)
602#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
603 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_RK3
604#endif
605 use pm_kind, only: RKG => RK3
606 real(RKG) , intent(in) :: absx
607 real(RKG) , intent(in), optional :: base
608 integer(IK) :: expPrev
609 end function
610#endif
611
612#if RK2_ENABLED
613 PURE elemental module function getExpPrev_RK2(absx, base) result(expPrev)
614#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
615 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_RK2
616#endif
617 use pm_kind, only: RKG => RK2
618 real(RKG) , intent(in) :: absx
619 real(RKG) , intent(in), optional :: base
620 integer(IK) :: expPrev
621 end function
622#endif
623
624#if RK1_ENABLED
625 PURE elemental module function getExpPrev_RK1(absx, base) result(expPrev)
626#if __INTEL_COMPILER && DLL_ENABLED && (_WIN32 || _WIN64)
627 !DEC$ ATTRIBUTES DLLEXPORT :: getExpPrev_RK1
628#endif
629 use pm_kind, only: RKG => RK1
630 real(RKG) , intent(in) :: absx
631 real(RKG) , intent(in), optional :: base
632 integer(IK) :: expPrev
633 end function
634#endif
635
636 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
637
638 end interface
639
640!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
641
642end module pm_mathExp ! LCOV_EXCL_LINE
Generate the next integer exponent expNext for the specified input base and absolute value absx = abs...
Definition: pm_mathExp.F90:309
Generate the previous integer exponent expPrev for the specified input base and absolute value absx =...
Definition: pm_mathExp.F90:510
Generate and return .true. if and only if the input positive integer is a whole-number (integer) powe...
Definition: pm_mathExp.F90:113
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter IK3
Definition: pm_kind.F90:368
integer, parameter RK5
Definition: pm_kind.F90:478
integer, parameter RK4
Definition: pm_kind.F90:489
integer, parameter IK1
Definition: pm_kind.F90:382
integer, parameter RK2
Definition: pm_kind.F90:511
integer, parameter RK3
Definition: pm_kind.F90:500
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter IK2
Definition: pm_kind.F90:375
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
integer, parameter IK4
Definition: pm_kind.F90:361
integer, parameter IK5
Definition: pm_kind.F90:354
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
integer, parameter RK1
Definition: pm_kind.F90:522
This module contains procedures and generic interfaces for computing the previous/next integer expone...
Definition: pm_mathExp.F90:44
character(*, SK), parameter MODULE_NAME
Definition: pm_mathExp.F90:50