@@ -47,11 +47,11 @@ The Fortran Standard Library is distributed under the MIT
4747License. It is worth noting that ` select ` and ` arg_select `
4848were derived using some code from quickSelect in the Coretran library, by Leon Foks,
4949https://github.com/leonfoks/coretran . Leon Foks has given permission for the code here
50- to be released under stdlib's MIT licence .
50+ to be released under stdlib's MIT license .
5151
5252### Specifications of the ` stdlib_selection ` procedures
5353
54- #### ` select ` - find the kth smallest value in an input array
54+ #### ` select ` - find the k-th smallest value in an input array
5555
5656##### Status
5757
@@ -85,20 +85,20 @@ the k-th smallest entry of `array(:)`.
8585
8686` left ` (optional): shall be a scalar with the same type as ` k ` . It is an ` intent(in) `
8787argument. If specified then we assume the k-th smallest value is definitely contained
88- in ` array(left:size(array)) ` . If not present it is 1. This is typically useful if multiple calls
88+ in ` array(left:size(array)) ` . If ` left ` is not present, the default is 1. This is typically useful if multiple calls
8989to ` select ` are made, because the partial sorting of ` array ` implies constraints on where
9090we need to search.
9191
9292` right ` (optional): shall be a scalar with the same type as ` k ` . It is an ` intent(in) `
9393argument. If specified then we assume the k-th smallest value is definitely contained
94- in ` array(1:right) ` . If not present it is ` size(array) ` . This is typically useful if multiple calls
94+ in ` array(1:right) ` . If ` right ` is not present, the default is ` size(array) ` . This is typically useful if multiple calls
9595to ` select ` are made, because the partial sorting of ` array ` implies constraints on where
9696we need to search.
9797
9898##### Notes
9999
100100Selection of a single value should have runtime of O(` size(array) ` ), so it is
101- asymptotically faster than sorting ` array ` entirely. The test program at the the
101+ asymptotically faster than sorting ` array ` entirely. The test program at the
102102end of this document shows that is the case.
103103
104104On return the elements of ` array ` will be partially sorted such that:
@@ -177,13 +177,13 @@ and on return it contains the index of the k-th smallest entry of `array(:)`.
177177
178178` left ` (optional): shall be a scalar with the same type as ` k ` . It is an ` intent(in) `
179179argument. If specified then we assume the k-th smallest value is definitely contained
180- in ` array(indx(left:size(array))) ` . If not present it is 1. This is typically useful if multiple calls
180+ in ` array(indx(left:size(array))) ` . If ` left ` is not present, the default is 1. This is typically useful if multiple calls
181181to ` arg_select ` are made, because the partial sorting of ` indx ` implies constraints on where
182182we need to search.
183183
184184` right ` (optional): shall be a scalar with the same type as ` k ` . It is an ` intent(in) `
185185argument. If specified then we assume the k-th smallest value is definitely contained
186- in ` array(indx(1:right)) ` . If not present it is ` size(array) ` . This is typically useful if multiple calls
186+ in ` array(indx(1:right)) ` . If ` right ` is not present, the default is ` size(array) ` . This is typically useful if multiple calls
187187to ` arg_select ` are made, because the reordering of ` indx ` implies constraints on
188188where we need to search.
189189
@@ -237,7 +237,7 @@ these documents confirms that is the case.
237237## Comparison with using ` sort `
238238
239239The following program compares the timings of ` select ` and ` arg_select ` for
240- computing the median of an array, vs using ` sort ` from stdlib. In theory we
240+ computing the median of an array, vs using ` sort ` from ` stdlib ` . In theory we
241241should see a speed improvement with the selection routines which grows like
242242LOG(size(` array ` )).
243243
0 commit comments