@@ -23,6 +23,7 @@ which implements selection algorithms.
23
23
## Overview of the module
24
24
25
25
The module ` stdlib_selection ` defines two generic subroutines:
26
+
26
27
* ` select ` is used to find the k-th smallest entry of an array. The input
27
28
array is also modified in-place, and on return will be partially sorted
28
29
such that ` all(array(1:k) <= array(k))) ` and ` all(array(k) <= array((k+1):size(array))) ` is true.
@@ -159,7 +160,7 @@ Generic subroutine.
159
160
160
161
` array ` : shall be a rank one array of any of the types:
161
162
` integer(int8) ` , ` integer(int16) ` , ` integer(int32) ` , ` integer(int64) ` ,
162
- ` real(sp) ` , ` real(dp) ` , ` real(xdp), ` real(qp)` . It is an ` intent(in)` argument. On input it is
163
+ ` real(sp) ` , ` real(dp) ` , ` real(xdp) ` , ` real(qp) ` . It is an ` intent(in) ` argument. On input it is
163
164
the array in which we search for the k-th smallest entry.
164
165
165
166
` indx ` : shall be a rank one array with the same size as ` array ` , containing all integers
@@ -198,7 +199,7 @@ The code does not support `NaN` elements in `array`; it will run, but there is
198
199
no consistent interpretation given to the order of ` NaN ` entries of ` array `
199
200
compared to other entries.
200
201
201
- While it is essential that that ` indx ` contains a permutation of the integers ` 1:size(array) ` ,
202
+ While it is essential that ` indx ` contains a permutation of the integers ` 1:size(array) ` ,
202
203
the code does not check for this. For example if ` size(array) == 4 ` , then we could have
203
204
` indx = [4, 2, 1, 3] ` or ` indx = [1, 2, 3, 4] ` , but not ` indx = [2, 1, 2, 4] ` . It is the user's
204
205
responsibility to avoid such errors.
0 commit comments