https://www.cdslab.org/paramonte/fortran/2
Current view: top level - main - pm_distPoweto@routines.inc.F90 (source / functions) Hit Total Coverage
Test: ParaMonte 2.0.0 :: Serial Fortran - Code Coverage Report Lines: 55 55 100.0 %
Date: 2024-04-08 03:18:57 Functions: 0 0 -
Legend: Lines: hit not hit

          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 include file contains the implementation of procedures in [pm_distPoweto](@ref pm_distPoweto).
      19             : !>
      20             : !>  \finmain
      21             : !>
      22             : !>  \author
      23             : !>  \AmirShahmoradi, Oct 16, 2009, 11:14 AM, Michigan
      24             : 
      25             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      26             : 
      27             :         !%%%%%%%%%%%%%%%%%%%%%%%%
      28             : #if     getPowetoLogPDFNF_ENABLED
      29             :         !%%%%%%%%%%%%%%%%%%%%%%%%
      30             : 
      31       13664 :         CHECK_ASSERTION(__LINE__, 0 < alpha .or. present(logMinX), SK_"@getPowetoLogPDFNF(): The condition `0 < alpha .or. present(logMinX)` must hold. alpha = "//getStr(alpha))
      32       13664 :         CHECK_ASSERTION(__LINE__, alpha < 0 .or. present(logMaxX), SK_"@getPowetoLogPDFNF(): The condition `alpha < 0 .or. present(logMaxX)` must hold. alpha = "//getStr(alpha))
      33             : 
      34       13664 :         if (alpha < 0._RKC) then
      35        1980 :             if (present(logMaxX)) then
      36        1965 :                 logPDFNF = getParetoLogPDFNF(alpha, logMinX, logMaxX)
      37             :             else
      38          15 :                 logPDFNF = getParetoLogPDFNF(alpha, logMinX)
      39             :             end if
      40       11684 :         elseif (0._RKC < alpha) then
      41        1980 :             if (present(logMinX)) then
      42        1965 :                 logPDFNF = getPowerLogPDFNF(alpha, logMinX, logMaxX)
      43             :             else
      44          15 :                 logPDFNF = getPowerLogPDFNF(alpha, logMaxX)
      45             :             end if
      46             :         else
      47        9704 :             logPDFNF = -log(logMaxX - logMinX)
      48             :         end if
      49             : 
      50             :         !%%%%%%%%%%%%%%%%%%%%%%
      51             : #elif   getPowetoLogPDF_ENABLED
      52             :         !%%%%%%%%%%%%%%%%%%%%%%
      53             : 
      54        2146 :         call setPowetoLogPDF(logPDF, logx, alpha, getPowetoLogPDFNF(alpha, logMinX, logMaxX))
      55             : 
      56             :         !%%%%%%%%%%%%%%%%%%%%%%
      57             : #elif   setPowetoLogPDF_ENABLED
      58             :         !%%%%%%%%%%%%%%%%%%%%%%
      59             : 
      60        4292 :         if (0._RKC < alpha) then
      61        1720 :             call setPowerLogPDF(logPDF, logx, alpha, logPDFNF)
      62        2572 :         elseif (alpha < 0._RKC) then
      63        1720 :             call setParetoLogPDF(logPDF, logx, alpha, logPDFNF)
      64             :         else
      65         852 :             logPDF = logPDFNF - logx
      66             :         end if
      67             : 
      68             :         !%%%%%%%%%%%%%%%%%%%%%%%%
      69             : #elif   getPowetoLogCDFNF_ENABLED
      70             :         !%%%%%%%%%%%%%%%%%%%%%%%%
      71             : 
      72       44841 :         CHECK_ASSERTION(__LINE__, 0 < alpha .or. present(logMinX), SK_"@getPowetoLogCDFNF(): The condition `0 < alpha .or. present(logMinX)` must hold. alpha = "//getStr(alpha))
      73       44841 :         CHECK_ASSERTION(__LINE__, alpha < 0 .or. present(logMaxX), SK_"@getPowetoLogCDFNF(): The condition `alpha < 0 .or. present(logMaxX)` must hold. alpha = "//getStr(alpha))
      74             : 
      75       44841 :         if (alpha < 0._RKC) then
      76       17993 :             if (present(logMaxX)) then
      77       17981 :                 logCDFNF = getParetoLogCDFNF(alpha, logMinX, logMaxX)
      78             :             else
      79          12 :                 logCDFNF = getParetoLogCDFNF(alpha, logMinX)
      80             :             end if
      81       26848 :         elseif (0._RKC < alpha) then
      82       17996 :             if (present(logMinX)) then
      83       17973 :                 logCDFNF = getPowerLogCDFNF(alpha, logMinX, logMaxX)
      84             :             else
      85          23 :                 logCDFNF = getPowerLogCDFNF(alpha, logMaxX)
      86             :             end if
      87             :         else
      88        8852 :             logCDFNF = getPowetoLogPDFNF(alpha, logMinX, logMaxX)
      89             :         end if
      90             : 
      91             :         !%%%%%%%%%%%%%%%%%%%%%%
      92             : #elif   getPowetoLogCDF_ENABLED
      93             :         !%%%%%%%%%%%%%%%%%%%%%%
      94             : 
      95        2146 :         call setPowetoLogCDF(logCDF, logx, alpha, logMinX, getPowetoLogCDFNF(alpha, logMinX, logMaxX))
      96             : 
      97             :         !%%%%%%%%%%%%%%%%%%%%%%
      98             : #elif   setPowetoLogCDF_ENABLED
      99             :         !%%%%%%%%%%%%%%%%%%%%%%
     100             : 
     101        4292 :         CHECK_ASSERTION(__LINE__, 0 < alpha .or. present(logMinX), SK_"@getPowetoLogCDFNF(): The condition `0 < alpha .or. present(logMinX)` must hold. alpha = "//getStr(alpha))
     102        4292 :         CHECK_ASSERTION(__LINE__, alpha < 0 .or. present(logCDFNF), SK_"@getPowetoLogCDFNF(): The condition `alpha < 0 .or. present(logCDFNF)` must hold. alpha = "//getStr(alpha))
     103             : 
     104        4292 :         if (alpha < 0._RKC) then
     105        1720 :             if (present(logCDFNF)) then
     106        1716 :                 call setParetoLogCDF(logCDF, logx, alpha, logMinX, logCDFNF)
     107             :             else
     108           4 :                 call setParetoLogCDF(logCDF, logx, alpha, logMinX)
     109             :             end if
     110        2572 :         elseif (0._RKC < alpha) then
     111        1720 :             if (present(logMinX)) then
     112        1712 :                 call setPowerLogCDF(logCDF, logx, alpha, logMinX, logCDFNF)
     113             :             else
     114           8 :                 call setPowerLogCDF(logCDF, logx, alpha, logCDFNF)
     115             :             end if
     116             :         else
     117         852 :             logCDF = log(logx - logMinX) + logCDFNF
     118             :         end if
     119             : 
     120             :         !%%%%%%%%%%%%%%%%%%%%%%%
     121             : #elif   getPowetoLogQuan_ENABLED
     122             :         !%%%%%%%%%%%%%%%%%%%%%%%
     123             : 
     124       10008 :         call setPowetoLogQuan(logx, logCDF, alpha, logMinX, getPowetoLogCDFNF(alpha, logMinX, logMaxX))
     125             : 
     126             :         !%%%%%%%%%%%%%%%%%%%%%%%
     127             : #elif   setPowetoLogQuan_ENABLED
     128             :         !%%%%%%%%%%%%%%%%%%%%%%%
     129             : 
     130       40048 :         CHECK_ASSERTION(__LINE__, 0 < alpha .or. present(logMinX), SK_"@getPowetoLogCDFNF(): The condition `0 < alpha .or. present(logMinX)` must hold. alpha = "//getStr(alpha))
     131       40048 :         CHECK_ASSERTION(__LINE__, alpha < 0 .or. present(logCDFNF), SK_"@getPowetoLogCDFNF(): The condition `alpha < 0 .or. present(logCDFNF)` must hold. alpha = "//getStr(alpha))
     132             : 
     133       40048 :         if (alpha < 0._RKC) then
     134       16032 :             if (present(logCDFNF)) then
     135       16024 :                 call setParetoLogQuan(logx, logCDF, alpha, logMinX, logCDFNF)
     136             :             else
     137           8 :                 call setParetoLogQuan(logx, logCDF, alpha, logMinX)
     138             :             end if
     139       24016 :         elseif (0._RKC < alpha) then
     140       16016 :             if (present(logMinX)) then
     141       16008 :                 call setPowerLogQuan(logx, logCDF, alpha, logMinX, logCDFNF)
     142             :             else
     143           8 :                 call setPowerLogQuan(logx, logCDF, alpha, logCDFNF)
     144             :             end if
     145             :         else
     146        8000 :             logx = exp(logCDF - logCDFNF) + logMinX
     147             :         end if
     148             : 
     149             :         !%%%%%%%%%%%%%%%%%%%%%%%
     150             : #elif   getPowetoLogRand_ENABLED
     151             :         !%%%%%%%%%%%%%%%%%%%%%%%
     152             : 
     153       10016 :         call setPowetoLogRand(logRand, getNegExpRand(1._RKC), alpha, logMinX, getPowetoLogCDFNF(alpha, logMinX, logMaxX))
     154             : 
     155             :         !%%%%%%%%%%%%%%%%%%%%%%%
     156             : #elif   setPowetoLogRand_ENABLED
     157             :         !%%%%%%%%%%%%%%%%%%%%%%%
     158             : 
     159       20032 :         CHECK_ASSERTION(__LINE__, negExpRand <= 0._RKC, SK_"@setPowetoLogRand(): The condition `negExpRand <= 0._RKC` must hold. alpha = "//getStr(negExpRand))
     160       20032 :         call setPowetoLogQuan(logRand, negExpRand, alpha, logMinX, logCDFNF)
     161             : 
     162             : #else
     163             :         !%%%%%%%%%%%%%%%%%%%%%%%%
     164             : #error  "Unrecognized interface."
     165             :         !%%%%%%%%%%%%%%%%%%%%%%%%
     166             : #endif

ParaMonte: Parallel Monte Carlo and Machine Learning Library 
The Computational Data Science Lab
© Copyright 2012 - 2024