https://www.cdslab.org/paramonte/fortran/2
Current view: top level - test - test_pm_arrayMerge@routines.inc.F90 (source / functions) Hit Total Coverage
Test: ParaMonte 2.0.0 :: Serial Fortran - Code Coverage Report Lines: 111 111 100.0 %
Date: 2024-04-08 03:18:57 Functions: 160 160 100.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 module contains implementations of the tests of the procedures of [pm_arrayMerge](@ref pm_arrayMerge).
      19             : !>
      20             : !>  \author
      21             : !>  \AmirShahmoradi
      22             : 
      23             : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      24             : 
      25             : #if     getMerged_D0_SK_ENABLED || setMerged_D0_SK_ENABLED
      26             : #define GET_SIZE(array) len(array, kind = IK)
      27             : #define GET_INDEX(i) i:i
      28             : #else
      29             : #define GET_SIZE(array) size(array, kind = IK)
      30             : #define GET_INDEX(i) i
      31             : #endif
      32             : 
      33             : #if     getMerged_D1_LK_ENABLED || setMerged_D1_LK_ENABLED
      34             : #define IS_EQUAL .eqv.
      35             : #else
      36             : #define IS_EQUAL ==
      37             : #endif
      38             : 
      39             : #if     getMerged_D1_PSSK_ENABLED || setMerged_D1_PSSK_ENABLED
      40             :         use pm_container, only: strc => css_pdt, operator(==)
      41             : #endif
      42             :         integer(IK) :: i
      43             : 
      44             : #if     getMerged_D0_SK_ENABLED || setMerged_D0_SK_ENABLED
      45           2 :         character(:,SKC), allocatable   :: SortedArray1, SortedArray2, SortedMergedArray, SortedMergedArray_ref
      46             : #elif   getMerged_D1_SK_ENABLED || setMerged_D1_SK_ENABLED
      47             :         character(2,SKC), allocatable   :: SortedArray1(:), SortedArray2(:), SortedMergedArray(:), SortedMergedArray_ref(:)
      48             : #elif   getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
      49             :         integer(IKC)    , allocatable   :: SortedArray1(:), SortedArray2(:), SortedMergedArray(:), SortedMergedArray_ref(:)
      50             : #elif   getMerged_D1_LK_ENABLED || setMerged_D1_LK_ENABLED
      51             :         logical(LKC)    , allocatable   :: SortedArray1(:), SortedArray2(:), SortedMergedArray(:), SortedMergedArray_ref(:)
      52             : #elif   getMerged_D1_CK_ENABLED || setMerged_D1_CK_ENABLED
      53             :         complex(CKC)    , allocatable   :: SortedArray1(:), SortedArray2(:), SortedMergedArray(:), SortedMergedArray_ref(:)
      54             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
      55             :         real(RKC)       , allocatable   :: SortedArray1(:), SortedArray2(:), SortedMergedArray(:), SortedMergedArray_ref(:)
      56             : #elif   getMerged_D1_PSSK_ENABLED || setMerged_D1_PSSK_ENABLED
      57             :         type(strc(SKC)) , allocatable   :: SortedArray1(:), SortedArray2(:), SortedMergedArray(:), SortedMergedArray_ref(:)
      58             : #else
      59             : #error  "Unrecognized Interface."
      60             : #endif
      61             : 
      62          40 :         assertion = .true._LK
      63             : 
      64             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      65             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED || \
      66             :         getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
      67             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      68             : 
      69             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      70             : 
      71          18 :         call reset()
      72             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
      73          40 :         SortedArray1 = int([1, 2], kind = IKC)
      74          30 :         SortedArray2 = int([-1], kind = IKC)
      75          50 :         SortedMergedArray_ref = int([-1, 1, 2], IKC)
      76             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
      77          32 :         SortedArray1 = [1._RKC, 2._RKC]
      78          24 :         SortedArray2 = [-1._RKC]
      79          40 :         SortedMergedArray_ref = [-1._RKC, 1._RKC, 2._RKC]
      80             : #endif
      81          18 :         call report(int(__LINE__, IK))
      82          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort two input contiguous sorted arrays of rank 1 where all elements of array2 are smaller than elements of array1.", int(__LINE__, IK))
      83          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort two input contiguous sorted arrays of rank 1 where all elements of array2 are smaller than elements of array1.", int(__LINE__, IK))
      84             : 
      85             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
      86             : 
      87          18 :         call reset()
      88             : 
      89             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
      90          40 :         SortedArray1 = [1_IKC, 4_IKC]
      91          40 :         SortedArray2 = [2_IKC, 3_IKC]
      92          60 :         SortedMergedArray_ref = [1_IKC, 2_IKC, 3_IKC, 4_IKC]
      93             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
      94          32 :         SortedArray1 = [1._RKC, 4._RKC]
      95          32 :         SortedArray2 = [2._RKC, 3._RKC]
      96          48 :         SortedMergedArray_ref = [1._RKC, 2._RKC, 3._RKC, 4._RKC]
      97             : #endif
      98          18 :         call report(int(__LINE__, IK))
      99          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort two input contiguous sorted arrays of rank 1 where all elements of array2 are between elements of array1.", int(__LINE__, IK))
     100             : 
     101             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     102             : 
     103          18 :         call reset()
     104             : 
     105             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
     106          50 :         SortedArray1 = [1_IKC, 4_IKC, 10_IKC]
     107          60 :         SortedArray2 = [-2_IKC, 3_IKC, 7_IKC, 11_IKC]
     108          90 :         SortedMergedArray_ref = [-2_IKC, 1_IKC, 3_IKC, 4_IKC, 7_IKC, 10_IKC, 11_IKC]
     109             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
     110          40 :         SortedArray1 = [1._RKC, 4._RKC, 10._RKC]
     111          48 :         SortedArray2 = [-2._RKC, 3._RKC, 7._RKC, 11._RKC]
     112          72 :         SortedMergedArray_ref = [-2._RKC, 1._RKC, 3._RKC, 4._RKC, 7._RKC, 10._RKC, 11._RKC]
     113             : #endif
     114          18 :         call report(int(__LINE__, IK))
     115          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort two input arbitrarily-sized and valued contiguous sorted arrays of rank 1.", int(__LINE__, IK))
     116             : 
     117             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     118             : 
     119          18 :         call reset()
     120             : 
     121             :         if (allocated(SortedArray1)) deallocate(SortedArray1) ! LCOV_EXCL_LINE
     122          18 :         allocate(SortedArray1(0))
     123             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
     124          60 :         SortedArray2 = [-2_IKC, 3_IKC, 7_IKC, 11_IKC]
     125          70 :         SortedMergedArray_ref = SortedArray2
     126             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
     127          48 :         SortedArray2 = [-2._RKC, 3._RKC, 7._RKC, 11._RKC]
     128          56 :         SortedMergedArray_ref = SortedArray2
     129             : #endif
     130          18 :         call report(int(__LINE__, IK))
     131          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort an empty array with a non-empty array.", int(__LINE__, IK))
     132             : 
     133             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     134             : 
     135          18 :         call reset()
     136             : 
     137             :         if (allocated(SortedArray2)) deallocate(SortedArray2) ! LCOV_EXCL_LINE
     138          18 :         allocate(SortedArray2(0))
     139             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
     140          60 :         SortedArray1 = [-2_IKC, 3_IKC, 7_IKC, 11_IKC]
     141          70 :         SortedMergedArray_ref = SortedArray1
     142             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
     143          48 :         SortedArray1 = [-2._RKC, 3._RKC, 7._RKC, 11._RKC]
     144          56 :         SortedMergedArray_ref = SortedArray1
     145             : #endif
     146          18 :         call report(int(__LINE__, IK))
     147          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort a non-empty array with an empty array.", int(__LINE__, IK))
     148             : 
     149             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     150             : 
     151          18 :         call reset()
     152             : 
     153             :         if (allocated(SortedArray2)) deallocate(SortedArray2) ! LCOV_EXCL_LINE
     154          18 :         allocate(SortedArray2(0))
     155             : #if     getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
     156          60 :         SortedArray1 = [-2_IKC, 3_IKC, 7_IKC, 11_IKC]
     157          70 :         SortedMergedArray_ref = SortedArray1
     158             : #elif   getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
     159          48 :         SortedArray1 = [-2._RKC, 3._RKC, 7._RKC, 11._RKC]
     160          56 :         SortedMergedArray_ref = SortedArray1
     161             : #endif
     162          18 :         call report(int(__LINE__, IK))
     163          18 :         call test%assert(assertion, SK_"The procedure must be able to merge-sort a non-empty array with an empty array.", int(__LINE__, IK))
     164             : 
     165             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     166             : 
     167             : #endif
     168             : 
     169             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     170             : 
     171          40 :         call testGeneric()
     172          40 :         call testGeneric(isSorted)
     173             : 
     174             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     175             : 
     176             :     contains
     177             : 
     178             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     179             : 
     180          80 :         subroutine testGeneric(isSorted)
     181             :             procedure(logical(LK))  , optional  :: isSorted
     182       16080 :             do i = 1, 200
     183       16000 :                 call reset()
     184             : #if             getMerged_D0_SK_ENABLED || setMerged_D0_SK_ENABLED
     185         800 :                 allocate(character(getUnifRand(0, 10),SKC) :: SortedArray1)
     186         800 :                 allocate(character(getUnifRand(0, 10),SKC) :: SortedArray2)
     187         800 :                 call setUnifRand(SortedArray1)
     188         800 :                 call setUnifRand(SortedArray2)
     189         800 :                 SortedMergedArray_ref = SortedArray1//SortedArray2
     190             : #elif           getMerged_D1_SK_ENABLED || setMerged_D1_SK_ENABLED
     191         800 :                 allocate(SortedArray1(getUnifRand(0, 10)))
     192         800 :                 allocate(SortedArray2(getUnifRand(0, 10)))
     193         800 :                 allocate(SortedMergedArray_ref(size(SortedArray1) + size(SortedArray2)))
     194        4781 :                 call setUnifRand(SortedArray1)
     195        4775 :                 call setUnifRand(SortedArray2)
     196        4781 :                 SortedMergedArray_ref(1:size(SortedArray1)) = SortedArray1
     197        4775 :                 SortedMergedArray_ref(size(SortedArray1) + 1 : size(SortedArray1) + size(SortedArray2)) = SortedArray2
     198             : #elif           getMerged_D1_PSSK_ENABLED || setMerged_D1_PSSK_ENABLED
     199             :                 allocate(SortedArray1(getUnifRand(0, 10)))
     200             :                 allocate(SortedArray2(getUnifRand(0, 10)))
     201             :                 allocate(SortedMergedArray_ref(size(SortedArray1) + size(SortedArray2)))
     202             :                 block
     203             :                     integer :: j
     204             :                     do j = 1, size(SortedArray1, kind = IK)
     205             :                         call setUnifRand(SortedArray1(j)%val)
     206             :                     end do
     207             :                     do j = 1, size(SortedArray1, kind = IK)
     208             :                         call setUnifRand(SortedArray2(j)%val)
     209             :                     end do
     210             :                     SortedMergedArray_ref(1:size(SortedArray1)) = SortedArray1
     211             :                     SortedMergedArray_ref(size(SortedArray1) + 1 : size(SortedArray1) + size(SortedArray2)) = SortedArray2
     212             :                 end block
     213             : #else
     214       15848 :                 allocate(SortedArray1(getUnifRand(0, 10)))
     215       15867 :                 allocate(SortedArray2(getUnifRand(0, 10)))
     216       85853 :                 call setUnifRand(SortedArray1)
     217       86898 :                 call setUnifRand(SortedArray2)
     218      345502 :                 SortedMergedArray_ref = [SortedArray1, SortedArray2]
     219             : #endif
     220       16000 :                 if (present(isSorted)) then
     221        8000 :                     call setSorted(SortedMergedArray_ref, isSorted)
     222        8000 :                     call setSorted(SortedArray1, isSorted)
     223        8000 :                     call setSorted(SortedArray2, isSorted)
     224             :                 else
     225        8000 :                     call setSorted(SortedMergedArray_ref)
     226        8000 :                     call setSorted(SortedArray1)
     227        8000 :                     call setSorted(SortedArray2)
     228             :                 end if
     229       16000 :                 call report(int(__LINE__, IK), isSorted)
     230       16080 :                 call test%assert(assertion, SK_"The procedure must be able to merge-sort two arrays to return a merged array with present(isSorted) = "//getStr(present(isSorted))//SK_".", int(__LINE__, IK))
     231             :             end do
     232          80 :         end subroutine
     233             : 
     234             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     235             : 
     236      800679 :         function isSorted(lhs, rhs) result(sorted)
     237             : #if         getMerged_D0_SK_ENABLED || setMerged_D0_SK_ENABLED
     238             :             character(1,SKC)        , intent(in) :: lhs, rhs
     239             : #elif       getMerged_D1_SK_ENABLED || setMerged_D1_SK_ENABLED
     240             :             character(*,SKC)        , intent(in) :: lhs, rhs
     241             : #elif       getMerged_D1_IK_ENABLED || setMerged_D1_IK_ENABLED
     242             :             integer(IKC)            , intent(in) :: lhs, rhs
     243             : #elif       getMerged_D1_LK_ENABLED || setMerged_D1_LK_ENABLED
     244             :             use pm_logicalCompare, only: operator(>)
     245             :             logical(LKC)            , intent(in) :: lhs, rhs
     246             : #elif       getMerged_D1_CK_ENABLED || setMerged_D1_CK_ENABLED
     247             :             use pm_complexCompareLex, only: operator(>)
     248             :             complex(CKC)            , intent(in) :: lhs, rhs
     249             : #elif       getMerged_D1_RK_ENABLED || setMerged_D1_RK_ENABLED
     250             :             real(RKC)               , intent(in) :: lhs, rhs
     251             : #elif       getMerged_D1_PSSK_ENABLED || setMerged_D1_PSSK_ENABLED
     252             :             use pm_container, only: css_pdt, operator(>)
     253             :             type(css_pdt(SKC)) , intent(in) :: lhs, rhs
     254             : #else
     255             : #error      "Unrecognized interface."
     256             : #endif
     257             :             logical(LK) :: sorted
     258      800679 :             sorted = lhs > rhs
     259      800679 :         end function
     260             : 
     261             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     262             : 
     263       16108 :         subroutine reset()
     264       16108 :             if (allocated(SortedArray1)) deallocate(SortedArray1)
     265       16108 :             if (allocated(SortedArray2)) deallocate(SortedArray2)
     266       16108 :             if (allocated(SortedMergedArray)) deallocate(SortedMergedArray)
     267       16108 :             if (allocated(SortedMergedArray_ref)) deallocate(SortedMergedArray_ref)
     268       16108 :         end subroutine
     269             : 
     270             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     271             : 
     272       16108 :         subroutine report(line, isSorted)
     273             :             integer(IK), intent(in) :: line
     274             :             procedure(logical(LK))  , optional  :: isSorted
     275             :             integer(IK) :: i
     276             : #if         getMerged_ENABLED
     277        8054 :             if (present(isSorted)) then
     278       45726 :                 SortedMergedArray = getMerged(SortedArray1, SortedArray2, isSorted)
     279             :             else
     280       46044 :                 SortedMergedArray = getMerged(SortedArray1, SortedArray2)
     281             :             end if
     282             : #elif       setMerged_ENABLED
     283        8054 :             if (allocated(SortedMergedArray)) deallocate(SortedMergedArray)
     284             : #if         getMerged_D0_SK_ENABLED || setMerged_D0_SK_ENABLED
     285         400 :             allocate(character(len(SortedMergedArray_ref),SKC) :: SortedMergedArray)
     286             : #else
     287       14097 :             allocate(SortedMergedArray, mold = SortedMergedArray_ref)
     288             : #endif
     289        8054 :             if (present(isSorted)) then
     290        4000 :                 call setMerged(SortedMergedArray, SortedArray1, SortedArray2, isSorted)
     291             :             else
     292        4054 :                 call setMerged(SortedMergedArray, SortedArray1, SortedArray2)
     293             :             end if
     294             : #else
     295             : #error      "Unrecognized interface."
     296             : #endif
     297       16108 :             assertion = assertion .and. GET_SIZE(SortedMergedArray) == GET_SIZE(SortedMergedArray_ref)
     298       48324 :             call test%assert(assertion, SK_"The sizes of `SortedMergedArray` and `SortedMergedArray_ref` must equal with present(isSorted) = "//getStr(present(isSorted))//SK_": "//getStr([GET_SIZE(SortedMergedArray), GET_SIZE(SortedMergedArray_ref)]), line)
     299             : 
     300      176518 :             do i = 1, GET_SIZE(SortedMergedArray)
     301             : #if             getMerged_D1_LK_ENABLED || setMerged_D1_LK_ENABLED
     302       40066 :                 assertion = assertion .and. (logical(SortedMergedArray(GET_INDEX(i))) IS_EQUAL logical(SortedMergedArray_ref(GET_INDEX(i))))
     303             : #else
     304      120344 :                 assertion = assertion .and. (SortedMergedArray(GET_INDEX(i)) IS_EQUAL SortedMergedArray_ref(GET_INDEX(i)))
     305             : #endif
     306      176518 :                 if (test%traceable .and. .not. assertion) then
     307             :                     ! LCOV_EXCL_START
     308             :                     write(test%disp%unit,"(*(g0,:,', '))")
     309             :                     write(test%disp%unit,"(*(g0,:,', '))") "i", i
     310             :                     write(test%disp%unit,"(*(g0,:,', '))") "SortedMergedArray(i)", SortedMergedArray(GET_INDEX(i))
     311             :                     write(test%disp%unit,"(*(g0,:,', '))") "SortedMergedArray_ref(i)", SortedMergedArray_ref(GET_INDEX(i))
     312             :                     write(test%disp%unit,"(*(g0,:,', '))") "SortedMergedArray(GET_INDEX(i)) IS_EQUAL SortedMergedArray_ref(GET_INDEX(i))", SortedMergedArray(GET_INDEX(i)) IS_EQUAL SortedMergedArray_ref(GET_INDEX(i))
     313             : #if                 getMerged_D1_LK_ENABLED || setMerged_D1_LK_ENABLED
     314             :                     write(test%disp%unit,"(*(g0,:,', '))") SortedMergedArray
     315             :                     write(test%disp%unit,"(*(g0,:,', '))") SortedMergedArray_ref
     316             :                     write(test%disp%unit,"(*(g0,:,', '))") SortedMergedArray(GET_INDEX(i)) .eqv. SortedMergedArray_ref(GET_INDEX(i))
     317             : #endif
     318             :                     write(test%disp%unit,"(*(g0,:,', '))")
     319             :                     return
     320             :                     ! LCOV_EXCL_STOP
     321             :                 end if
     322             :             end do
     323             :         end subroutine
     324             : 
     325             :         !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     326             : 
     327             : #undef  GET_INDEX
     328             : #undef  IS_EQUAL
     329             : #undef  GET_SIZE

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