Skip to content

Commit 57500c1

Browse files
gareth-nxivan-pi
andauthored
Apply the more straightforward suggestions from code review
Co-authored-by: Ivan Pribec <[email protected]>
1 parent 069a111 commit 57500c1

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

doc/specs/stdlib_selection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ which implements selection algorithms.
2525
The module `stdlib_selection` defines two generic subroutines:
2626
* `select` is used to find the k-th smallest entry of an array. The input
2727
array is also modified in-place, and on return will be partially sorted
28-
such that `all(array(1:k) <= array(k)))` and `all(array(k) <= array((k+1):size(array)))`.
28+
such that `all(array(1:k) <= array(k)))` and `all(array(k) <= array((k+1):size(array)))` is true.
2929
The user can optionally specify `left` and `right` indices to constrain the search
3030
for the k-th smallest value. This can be useful if you have previously called `select`
3131
to find a smaller or larger rank (that will have led to partial sorting of

src/stdlib_selection.fypp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module stdlib_selection
88
! This code was modified from the "Coretran" implementation "quickSelect" by
99
! Leon Foks, https://github.com/leonfoks/coretran/tree/master/src/sorting
1010
!
11-
! Leon Foks gave permission to be release this code under stdlib's MIT license.
11+
! Leon Foks gave permission to release this code under stdlib's MIT license.
1212
! (https://github.com/fortran-lang/stdlib/pull/500#commitcomment-57418593)
1313
!
1414

@@ -18,7 +18,7 @@ implicit none
1818

1919
private
2020

21-
public select, arg_select
21+
public :: select, arg_select
2222

2323
interface select
2424
!! version: experimental
@@ -57,7 +57,8 @@ contains
5757
${arraytype}$, intent(inout) :: a(:)
5858
!! Array in which we seek the k-th smallest entry.
5959
!! On output it will be partially sorted such that
60-
!! `all(a(1:(k-1)) <= a(k)) .and. all(a(k) <= a((k+1):size(a)))`.
60+
!! `all(a(1:(k-1)) <= a(k)) .and. all(a(k) <= a((k+1):size(a)))`
61+
!! is true.
6162
${inttype}$, intent(in) :: k
6263
!! We want the k-th smallest entry. E.G. `k=1` leads to
6364
!! `kth_smallest=min(a)`, and `k=size(a)` leads to

src/tests/selection/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
### Pre-process: .fpp -> .f90 via Fypp
22

33
# Create a list of the files to be preprocessed
4-
set(fppFiles
4+
set(
5+
fppFiles
56
test_selection.fypp
67
)
78

0 commit comments

Comments
 (0)