Skip to content

Commit 3df88d3

Browse files
authored
Merge pull request #2 from jvdp1/check_sort
Mainly added some links
2 parents 8b5156e + bb0dd0b commit 3df88d3

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

Diff for: doc/specs/stdlib_sorting.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ increasing, or decreasing, value.
211211

212212
##### Syntax
213213

214-
`call [[stdlib_sorting(module):ord_sort(subroutine)]]ord_sort ( array[, work, reverse ] )`
214+
`call [[stdlib_sorting(module):ord_sort(interface)]]( array[, work, reverse ] )`
215215

216216
##### Class
217217

@@ -286,7 +286,7 @@ decreasing, value.
286286

287287
##### Syntax
288288

289-
`call [[stdlib_sorting(module):sort(subroutine)]]sort ( array[, reverse] )`
289+
`call [[stdlib_sorting(module):sort(interface)]]( array[, reverse] )`
290290

291291
##### Class
292292

@@ -349,7 +349,7 @@ sort the input `array` to produce the output `array`.
349349

350350
##### Syntax
351351

352-
`call [[stdlib_sorting(module):sort_index(subroutine)]]sort_index ( array, index[, work, iwork, reverse ] )`
352+
`call [[stdlib_sorting(module):sort_index(interface)]]( array, index[, work, iwork, reverse ] )`
353353

354354
##### Class
355355

Diff for: src/stdlib_sorting.fypp

+15-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
!! Licensing:
55
!!
6-
!! This file is subjec† both to the Fortran Standard Library license, and
6+
!! This file is subject both to the Fortran Standard Library license, and
77
!! to additional licensing requirements as it contains translations of
88
!! other software.
99
!!
@@ -65,8 +65,11 @@
6565
module stdlib_sorting
6666
!! This module implements overloaded sorting subroutines named `ORD_SORT`,
6767
!! `SORT_INDEX`, and `SORT`, that each can be used to sort four kinds
68-
!! of `INTEGER` arrays, three kinds of `REAL` arrays, character(len=*) arrays,
69-
!! and arrays of type(string_type). By default sorting is in order of
68+
!! of `INTEGER` arrays, three kinds of `REAL` arrays, `character(len=*)` arrays,
69+
!! and arrays of `type(string_type)`.
70+
!! ([Specification](../page/specs/stdlib_sorting.html))
71+
!!
72+
!! By default sorting is in order of
7073
!! increasing value, but there is an option to sort in decreasing order.
7174
!! All the subroutines have worst case run time performance of `O(N Ln(N))`,
7275
!! but on largely sorted data `ORD_SORT` and `SORT_INDEX` can have a run time
@@ -341,7 +344,10 @@ module stdlib_sorting
341344
!! `slice.rs`
342345
!! https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs#L2159
343346
!! `ORD_SORT` is a hybrid stable comparison algorithm combining `merge sort`,
344-
!! and `insertion sort`. It is always at worst O(N Ln(N)) in sorting random
347+
!! and `insertion sort`.
348+
!! ([Specification](../page/specs/stdlib_sorting.html#ord_sort-sorts-an-input-array))
349+
!!
350+
!! It is always at worst O(N Ln(N)) in sorting random
345351
!! data, having a performance about 25% slower than `SORT` on such
346352
!! data, but has much better performance than `SORT` on partially
347353
!! sorted data, having O(N) performance on uniformly non-increasing or
@@ -377,6 +383,7 @@ module stdlib_sorting
377383
!!
378384
!! The generic subroutine interface implementing the `SORT` algorithm, based
379385
!! on the `introsort` of David Musser.
386+
!! ([Specification](../page/specs/stdlib_sorting.html#sort-sorts-an-input-array))
380387

381388
#:for k1, t1 in IRS_KINDS_TYPES
382389
pure module subroutine ${k1}$_sort( array, reverse )
@@ -414,7 +421,10 @@ module stdlib_sorting
414421
!! based on the `"Rust" sort` algorithm found in `slice.rs`
415422
!! https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs#L2159
416423
!! but modified to return an array of indices that would provide a stable
417-
!! sort of the rank one `ARRAY` input. The indices by default correspond to a
424+
!! sort of the rank one `ARRAY` input.
425+
!! ([Specification](../page/specs/stdlib_sorting.html#sort_index-creates-an-array-of-sorting-indices-for-an-input-array-while-also-sorting-the-array))
426+
!!
427+
!! The indices by default correspond to a
418428
!! non-decreasing sort, but if the optional argument `REVERSE` is present
419429
!! with a value of `.TRUE.` the indices correspond to a non-increasing sort.
420430

0 commit comments

Comments
 (0)