ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_arrayRank::getRankModified Interface Reference

Generate and return the Modified rank of the input scalar string or contiguous array of rank 1 in ascending order or in the order specified by the input procedure isSorted() using the Quicksort algorithm such that array(rank) will be in ascending order (or in the requested order as specified by isSorted(). More...

Detailed Description

Generate and return the Modified rank of the input scalar string or contiguous array of rank 1 in ascending order or in the order specified by the input procedure isSorted() using the Quicksort algorithm such that array(rank) will be in ascending order (or in the requested order as specified by isSorted().

This kind of ranking of values is widely known as Modified Competition (1334) ranking.
Sometimes, competition ranking is done by leaving the gaps in the ranking numbers before the sets of equal-ranking items (rather than after them as in Standard Competition ranking).
The number of ranking numbers that are left out in this gap remains one less than the number of items that compared equal.
Equivalently, the ranking number of each item is equal to the number of items ranked equal to it or above it.
This ranking ensures that a competitor only comes second if they score higher than all but one of their opponents, third if they score higher than all but two of their opponents, etc.
Thus if A ranks ahead of B and C (which compare equal) which are both ranked head of D, then A gets ranking number 1 (first), B gets ranking number 3 (joint third), C also gets ranking number 3 (joint third) and D gets ranking number 4 (fourth).
In this case, nobody would get ranking number 2 (second) (left as a gap).
That is, if A < B == C < D, then the sequence ABCD has the Modified Competition ranking 1334.

Parameters
[in]array: The input contiguous array of rank 1 of either
  1. type css_pdt (parameterized container of string of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU)) or,
  2. type css_type (container of string of default kind SK) or,
  3. type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter or,
  4. type integer of kind any supported by the processor (e.g., IK, IK8, IK16, IK32, or IK64) or,
  5. type logical of kind any supported by the processor (e.g., LK) or,
  6. type complex of kind any supported by the processor (e.g., CK, CK32, CK64, or CK128) or,
  7. type real of kind any supported by the processor (e.g., RK, RK32, RK64, or RK128),
or,
  1. a scalar of type character of kind any supported by the processor (e.g., SK, SKA, SKD , or SKU) of arbitrary length type parameter,
whose elements rankings will be computed and returned.
[out]rank: The output contiguous array of rank 1 of type integer of default kind IK containing the ranks of the corresponding elements of array.
The size of rank must match that of array (or its length type parameter if array is a scalar string).
Read rank(i) as the Modified rank of the ith element of array.
isSorted: The external user-specified function that takes two input scalar arguments of the same type and kind as the input array.
It returns a scalar logical of default kind LK that is .true. if the first input scalar argument is sorted with respect to the second input argument according to the user-defined sorting condition within isSorted(), otherwise, it is .false..
If array is a Fortran string (i.e., a scalar character), then both input arguments to isSorted() are single character(1,SKG) where SKG is the kind of array.
The following illustrates the generic interface of isSorted() when the rank of the input array is 1,
function isSorted(a,b) result (sorted)
use pm_kind, only: SK, IK, LK, CK, RK
TYPE(KIND) , intent(in) :: a, b
logical(LK) :: sorted
end function
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
Definition: pm_kind.F90:543
integer, parameter LK
The default logical kind in the ParaMonte library: kind(.true.) in Fortran, kind(....
Definition: pm_kind.F90:541
integer, parameter CK
The default complex kind in the ParaMonte library: real64 in Fortran, c_double_complex in C-Fortran I...
Definition: pm_kind.F90:542
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 SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Definition: pm_kind.F90:539
where TYPE(KIND) represents the type and kind of the input argument array, which can be one of the following,
use pm_kind, only: SK, IK, LK, CK, RK
character(*, SK) , intent(in) :: a, b
integer(IK) , intent(in) :: a, b
logical(LK) , intent(in) :: a, b
complex(CK) , intent(in) :: a, b
real(RK) , intent(in) :: a, b
type(css_type) , intent(in) :: a, b
type(css_pdt(SK)) , intent(in) :: a, b
This module contains the derived types for generating allocatable containers of scalar,...
This is the css_pdt parameterized type for generating instances of container of scalar of string obje...
This is the css_type type for generating instances of container of scalar of string objects.
where the kinds SK, IK, LK, CK, RK, can refer to any kind type parameter that is supported by the processor.
The following illustrates the generic interface of isSorted() when the input array is a scalar string,
function isSorted(a,b) result (sorted)
character(1,SKG), intent(in) :: a, b
logical(LK) :: sorted
end function
where SKG represents the kind of the input string argument array.
This user-defined equivalence check is extremely useful where a user-defined sorting criterion other than simple ascending order is needed, for example, when the case-sensitivity of an input string or array of strings is irrelevant or when sorting of the absolute values matters excluding the signs of the numbers, or when descending order is desired.
In such cases, user can define a custom sorting condition within the user-defined external function isSorted to achieve the goal.
(optional, the default sorting condition is ascending order, that is a < b.)
Returns
rank(1:size(array) : The output contiguous array of rank 1 of type integer of default kind IK containing the ranks of the corresponding elements of array.
The size of rank matches that of array (or its length type parameter if array is a scalar string).
Read rank(i) as the Modified rank of the ith element of array.


Possible calling interfaces

rank(1:size(array)) = getRankModified(array)
rank(1:size(array)) = getRankModified(array, isSorted)
Generate and return the Modified rank of the input scalar string or contiguous array of rank 1 in asc...
This module contains procedures and generic interfaces for obtaining various rankings of elements of ...
Warning
Note that the definition of isSorted(), if present, must be such that isSorted() .and. .not. isSorted() is equivalent to an equality check for two elements of the input array. This equality check is used to identify ties within the Modified ranking of the input array.
The pure procedure(s) documented herein become impure when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1.
By default, these procedures are pure in release build and impure in debug and testing builds.
The procedures under this generic interface are always impure when the input argument isSorted is present.
See also
setSelected
getRankDense
setRankDense
getRankOrdinal
setRankOrdinal
getRankFractional
setRankFractional
getRankStandard
setRankStandard
getRankModified
setRankModified
setSorted
setSorted


Example usage

1program example
2
3 use pm_io, only: display_type
4 use pm_kind, only: SK, IK, LK, CK, RK ! all other processor kinds are also supported.
5 use pm_distUnif, only: setUnifRand
7
8 implicit none
9
10 integer(IK) , parameter :: NP = 5_IK
11
12 ! Vector of indices of the sorted array.
13
14 integer(IK) :: i
15 integer(IK) , allocatable :: rank(:)
16
17 character(:, SK) , allocatable :: string_SK
18 character(9, SK) , allocatable :: vector_SK(:)
19 real(RK) :: vector_RK(NP)
20 integer(IK) :: vector_IK(NP)
21 logical(LK) :: vector_LK(NP)
22
23 type(display_type) :: disp
24 disp = display_type(file = "main.out.F90")
25
26 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 ! Define the unsorted arrays.
28 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29
30 !call setUnifRand(vector_SK, SK_"aaaaaaaaa", SK_"zzzzzzzzz")
31 call setUnifRand(vector_RK, -0.5_RK, +0.5_RK)
32 call setUnifRand(vector_IK, 1_IK, 2_IK**NP)
33 call setUnifRand(vector_LK)
34
35 call disp%skip()
36 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
37 call disp%show("!rank the characters of a string in ascending order.")
38 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
39 call disp%skip()
40
41 string_SK = SK_"ParaMonte"
42 call allocateRank(len(string_SK))
43
44 call disp%skip()
45 call disp%show("string_SK")
46 call disp%show( string_SK, deliml = SK_"""" )
47 call disp%show("rank = getRankModified(string_SK)")
48 rank = getRankModified(string_SK)
49 call disp%show("rank")
50 call disp%show( rank )
51 call disp%skip()
52
53 call disp%skip()
54 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
55 call disp%show("!rank array of strings of the same length in ascending order.")
56 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
57 call disp%skip()
58
59 vector_SK = [ "ParaMonte" &
60 , "V.2 " &
61 , "is " &
62 , "a " &
63 , "Parallel " &
64 , "Monte " &
65 , "Carlo " &
66 , "and " &
67 , "a " &
68 , "Machine " &
69 , "Learning " &
70 , "Library. " &
71 ]
72
73 call allocateRank(size(vector_SK))
74 call disp%skip()
75 call disp%show("vector_SK")
76 call disp%show( vector_SK, deliml = SK_"""" )
77 call disp%show("rank = getRankModified(vector_SK)")
78 rank = getRankModified(vector_SK)
79 call disp%show("rank")
80 call disp%show( rank )
81 call disp%skip()
82
83 call disp%skip()
84 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
85 call disp%show("!rank vector of integers of arbitrary kinds in ascending order.")
86 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
87 call disp%skip()
88
89 call allocateRank(size(vector_IK))
90 call disp%skip()
91 call disp%show("vector_IK")
92 call disp%show( vector_IK )
93 call disp%show("rank = getRankModified(vector_IK)")
94 rank = getRankModified(vector_IK)
95 call disp%show("rank")
96 call disp%show( rank )
97 call disp%skip()
98
99 call allocateRank(size(vector_IK))
100 call disp%skip()
101 call disp%show("vector_IK = [1_IK, 2_IK, 3_IK, 2_IK, 1_IK]")
102 vector_IK = [1_IK, 2_IK, 3_IK, 2_IK, 1_IK]
103 call disp%show("rank = getRankModified(vector_IK)")
104 rank = getRankModified(vector_IK)
105 call disp%show("rank")
106 call disp%show( rank )
107 call disp%skip()
108
109 call disp%skip()
110 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
111 call disp%show("!rank vector of logicals of arbitrary kinds in ascending order.")
112 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
113 call disp%skip()
114
115 call allocateRank(size(vector_LK))
116 call disp%skip()
117 call disp%show("vector_LK")
118 call disp%show( vector_LK )
119 call disp%show("rank = getRankModified(vector_LK)")
120 rank = getRankModified(vector_LK)
121 call disp%show("rank")
122 call disp%show( rank )
123 call disp%skip()
124
125 call disp%skip()
126 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
127 call disp%show("!rank arrays of reals of arbitrary kinds in ascending order.")
128 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
129 call disp%skip()
130
131 call allocateRank(size(vector_RK))
132 call disp%skip()
133 call disp%show("vector_RK")
134 call disp%show( vector_RK )
135 call disp%show("rank = getRankModified(vector_RK)")
136 rank = getRankModified(vector_RK)
137 call disp%show("rank")
138 call disp%show( rank )
139 call disp%skip()
140
141 block
142 real, allocatable :: vector_RK(:)
143 vector_RK = [1.0, 1.0, 2.0, 3.0, 3.0, 4.0, 5.0, 5.0, 5.0]
144 call allocateRank(size(vector_RK))
145 call disp%skip()
146 call disp%show("vector_RK")
147 call disp%show( vector_RK )
148 call disp%show("rank = getRankModified(vector_RK)")
149 rank = getRankModified(vector_RK)
150 call disp%show("rank")
151 call disp%show( rank )
152 call disp%skip()
153 end block
154
155 call disp%skip()
156 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
157 call disp%show("!rank according to an input user-defined comparison function.")
158 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
159 call disp%skip()
160
161 vector_IK = int([(i, i = 1_IK, NP)], kind = IK)
162 call allocateRank(size(vector_IK))
163 call disp%skip()
164 call disp%show("!rank in DESCENDING (decreasing) order via an input custom-designed `isSorted()` function.")
165 call disp%skip()
166 call disp%show("vector_IK")
167 call disp%show( vector_IK )
168 call disp%show("rank = getRankModified(vector_IK, isSorted_IK)")
169 rank = getRankModified(vector_IK, isSorted_IK)
170 call disp%show("rank")
171 call disp%show( rank )
172 call disp%skip()
173
174 call random_number(vector_RK); vector_RK = vector_RK - 0.5_RK
175 call allocateRank(size(vector_RK))
176 call disp%skip()
177 call disp%show("!rank in ascending order solely based on the magnitude of numbers using a custom comparison function.")
178 call disp%skip()
179 call disp%show("vector_RK")
180 call disp%show( vector_RK )
181 call disp%show("rank = getRankModified(vector_RK, isSorted_RK)")
182 rank = getRankModified(vector_RK, isSorted_RK)
183 call disp%show("rank")
184 call disp%show( rank )
185 call disp%skip()
186
187 string_SK = "ParaMonte"
188 call allocateRank(len(string_SK))
189 call disp%skip()
190 call disp%show("!rank string in ascending order without case-sensitivity via a custom-designed input comparison function.")
191 call disp%skip()
192 call disp%show("string_SK")
193 call disp%show( string_SK, deliml = SK_"""" )
194 call disp%show("rank = getRankModified(string_SK, isSortedChar1)")
195 rank = getRankModified(string_SK, isSortedChar1)
196 call disp%show("rank")
197 call disp%show( rank )
198 call disp%skip()
199
200 string_SK = "2211"
201 call allocateRank(len(string_SK))
202 call disp%skip()
203 call disp%show("!rank string in ascending order without case-sensitivity via a custom-designed input comparison function.")
204 call disp%skip()
205 call disp%show("string_SK")
206 call disp%show( string_SK, deliml = SK_"""" )
207 call disp%show("rank = getRankModified(string_SK, isSortedChar2)")
208 rank = getRankModified(string_SK, isSortedChar2)
209 call disp%show("rank")
210 call disp%show( rank )
211 call disp%skip()
212
213 ! gfortran 12 / ifort still cannot digest PDTs.
214#if PDT_ENABLED
215 call disp%skip()
216 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
217 call disp%show("!rank array of strings of varying length in ascending order.")
218 call disp%show("!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%")
219 call disp%skip()
220
221 block
222 use pm_container, only: css_pdt
223 type(css_pdt) , allocatable :: cssvec(:)
224 cssvec =[ css_pdt("ParaMonte") &
225 , css_pdt("V.2") &
226 , css_pdt("is") &
227 , css_pdt("a") &
228 , css_pdt("Parallel") &
229 , css_pdt("Monte") &
230 , css_pdt("Carlo") &
231 , css_pdt("and") &
232 , css_pdt("a") &
233 , css_pdt("Machine") &
234 , css_pdt("Learning") &
235 , css_pdt("Library.") &
236 ]
237 call allocateRank(size(cssvec))
238 call disp%skip()
239 call disp%show("cssvec")
240 call disp%show( cssvec, deliml = SK_"""" )
241 call disp%show("rank = getRankModified(cssvec)")
242 rank = getRankModified(cssvec)
243 call disp%show("rank")
244 call disp%show( rank )
245 call disp%skip()
246 end block
247#endif
248
249contains
250
251 function isSorted_IK(a,b) result(isSorted)
252 use pm_kind, only: LK, IK
253 integer(IK) , intent(in) :: a, b
254 logical(LK) :: isSorted
255 isSorted = a > b
256 end function
257
258 function isSorted_RK(a,b) result(isSorted)
259 use pm_kind, only: LK, IK
260 integer(IK) , intent(in) :: a, b
261 logical(LK) :: isSorted
262 isSorted = abs(a) < abs(b)
263 end function
264
265 function isSortedChar1(a,b) result(isSorted)
266 use pm_strASCII, only: getStrLower
267 use pm_kind, only: LK, SK
268 character(1, SK), intent(in) :: a, b
269 logical(LK) :: isSorted
270 isSorted = getStrLower(a) < getStrLower(b)
271 end function
272
273 function isSortedChar2(a,b) result(isSorted)
274 use pm_kind, only: LK, SK
275 character(1, SK), intent(in) :: a, b
276 logical(LK) :: isSorted
277 isSorted = a < b
278 end function
279
280 subroutine allocateRank(size)
281 integer, intent(in) :: size
282 if (allocated(rank)) deallocate(rank)
283 allocate(rank(size))
284 end subroutine
285
286end program example
Return a uniform random scalar or contiguous array of arbitrary rank of randomly uniformly distribute...
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11726
This is a generic method of the derived type display_type with pass attribute.
Definition: pm_io.F90:11508
Generate and return the input string where the uppercase English alphabets are all converted to lower...
This module contains classes and procedures for computing various statistical quantities related to t...
This module contains classes and procedures for input/output (IO) or generic display operations on st...
Definition: pm_io.F90:252
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
Definition: pm_io.F90:11393
This module contains the uncommon and hardly representable ASCII characters as well as procedures for...
Definition: pm_strASCII.F90:61
Generate and return an object of type display_type.
Definition: pm_io.F90:10282

Example Unix compile command via Intel ifort compiler
1#!/usr/bin/env sh
2rm main.exe
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example Windows Batch compile command via Intel ifort compiler
1del main.exe
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
4main.exe

Example Unix / MinGW compile command via GNU gfortran compiler
1#!/usr/bin/env sh
2rm main.exe
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
4./main.exe

Example output
1
2!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3!rank the characters of a string in ascending order.
4!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
6
7string_SK
8"ParaMonte"
9rank = getRankModified(string_SK)
10rank
11+2, +4, +8, +4, +1, +7, +6, +9, +5
12
13
14!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15!rank array of strings of the same length in ascending order.
16!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
17
18
19vector_SK
20"ParaMonte", "V.2 ", "is ", "a ", "Parallel ", "Monte ", "Carlo ", "and ", "a ", "Machine ", "Learning ", "Library. "
21rank = getRankModified(vector_SK)
22rank
23+6, +8, +12, +10, +7, +5, +1, +11, +10, +4, +2, +3
24
25
26!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27!rank vector of integers of arbitrary kinds in ascending order.
28!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29
30
31vector_IK
32+30, +15, +7, +20, +12
33rank = getRankModified(vector_IK)
34rank
35+5, +3, +1, +4, +2
36
37
38vector_IK = [1_IK, 2_IK, 3_IK, 2_IK, 1_IK]
39rank = getRankModified(vector_IK)
40rank
41+2, +4, +5, +4, +2
42
43
44!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45!rank vector of logicals of arbitrary kinds in ascending order.
46!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47
48
49vector_LK
50F, T, F, T, F
51rank = getRankModified(vector_LK)
52rank
53+3, +5, +3, +5, +3
54
55
56!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57!rank arrays of reals of arbitrary kinds in ascending order.
58!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59
60
61vector_RK
62+0.34626523010169052, -0.11391639806589271, +0.44547533338618117, +0.16363191996832449, +0.13375795283594749
63rank = getRankModified(vector_RK)
64rank
65+4, +1, +5, +3, +2
66
67
68vector_RK
69+1.00000000, +1.00000000, +2.00000000, +3.00000000, +3.00000000, +4.00000000, +5.00000000, +5.00000000, +5.00000000
70rank = getRankModified(vector_RK)
71rank
72+2, +2, +3, +5, +5, +6, +9, +9, +9
73
74
75!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
76!rank according to an input user-defined comparison function.
77!%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
78
79
80!rank in DESCENDING (decreasing) order via an input custom-designed `isSorted()` function.
81
82vector_IK
83+1, +2, +3, +4, +5
84rank = getRankModified(vector_IK, isSorted_IK)
85rank
86+5, +4, +3, +2, +1
87
88
89!rank in ascending order solely based on the magnitude of numbers using a custom comparison function.
90
91vector_RK
92+0.27850187722132180, -0.45247187463510863E-1, +0.17023549315366870E-1, +0.11078041526133275, +0.42217852081281337
93rank = getRankModified(vector_RK, isSorted_RK)
94rank
95+5, +4, +2, +1, +3
96
97
98!rank string in ascending order without case-sensitivity via a custom-designed input comparison function.
99
100string_SK
101"ParaMonte"
102rank = getRankModified(string_SK, isSortedChar1)
103rank
104+7, +2, +8, +2, +4, +6, +5, +9, +3
105
106
107!rank string in ascending order without case-sensitivity via a custom-designed input comparison function.
108
109string_SK
110"2211"
111rank = getRankModified(string_SK, isSortedChar2)
112rank
113+4, +4, +2, +2
114
115
Test:
test_pm_arrayRank
Bug:

Status: Unresolved
Source: Intel Classic Fortran Compiler ifort version 2021.5
Description: See pm_arraySplit for the description of a relevant bug in PDT name aliasing when compiled with Intel ifort 2021.5 that also applies to this module.
Remedy (as of ParaMonte Library version 2.0.0): See pm_arraySplit for the remedy.
Todo:
Low Priority: The current bypass for the PDT name aliasing bug can be reverted back to PDT name aliasing once the ifort bug is resolved.
Todo:
Low Priority: A test should be implemented for arrays of size that can be represented only by an IKD integer.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, April 21, 2017, 1:54 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas Austin

Definition at line 4796 of file pm_arrayRank.F90.


The documentation for this interface was generated from the following file: