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_arrayCompareLex](@ref pm_arrayCompareLex).
19 : !>
20 : !> \finmain
21 : !>
22 : !> \author
23 : !> \AmirShahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin
24 :
25 : !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 :
27 : ! Define logical comparison.
28 : #if LK_ENABLED
29 : #define EQUIVALENT_TO .eqv.
30 : #elif SK_ENABLED || IK_ENABLED || CK_ENABLED || RK_ENABLED
31 : #define EQUIVALENT_TO ==
32 : #else
33 : #error "Unrecognized interface."
34 : #endif
35 : ! Define array indexing rules.
36 : #if SK_ENABLED && D0_D0_ENABLED
37 : #define GET_INDEX(i) i:i
38 : #define GET_SIZE len
39 : #elif D1_D1_ENABLED
40 : #define GET_INDEX(i) i
41 : #define GET_SIZE size
42 : #else
43 : #error "Unrecognized interface."
44 : #endif
45 : ! Define comparison rules.
46 : #if (isllt_ENABLED || islle_ENABLED) && D1_D1_ENABLED && SK_ENABLED
47 : #define COMPARABLE_TO .llt.
48 : #elif isllt_ENABLED || islle_ENABLED
49 : #define COMPARABLE_TO <
50 : #elif (islgt_ENABLED || islge_ENABLED) && D1_D1_ENABLED && SK_ENABLED
51 : #define COMPARABLE_TO .lgt.
52 : #elif islgt_ENABLED || islge_ENABLED
53 : #define COMPARABLE_TO >
54 : #endif
55 : integer(IK) :: i
56 1572 : do i = 1_IK, min(GET_SIZE(array1, kind = IK), GET_SIZE(array2, kind = IK))
57 1164 : if (array1(GET_INDEX(i)) EQUIVALENT_TO array2(GET_INDEX(i))) cycle
58 356 : compares = logical(array1(GET_INDEX(i)) COMPARABLE_TO array2(GET_INDEX(i)), kind = LK)
59 1216 : return
60 : end do
61 : compares = logical(GET_SIZE(array1, kind = IK) & ! LCOV_EXCL_LINE
62 : #if isllt_ENABLED
63 : < & ! LCOV_EXCL_LINE
64 : #elif islle_ENABLED
65 : <= & ! LCOV_EXCL_LINE
66 : #elif islge_ENABLED
67 : >= & ! LCOV_EXCL_LINE
68 : #elif islgt_ENABLED
69 : > & ! LCOV_EXCL_LINE
70 : #endif
71 408 : GET_SIZE(array2, kind = IK), kind = LK)
72 : #undef COMPARABLE_TO
73 : #undef EQUIVALENT_TO
74 : #undef GET_INDEX
75 : #undef GET_SIZE
|