|
3 | 3 |
|
4 | 4 | !! Licensing:
|
5 | 5 | !!
|
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 |
7 | 7 | !! to additional licensing requirements as it contains translations of
|
8 | 8 | !! other software.
|
9 | 9 | !!
|
|
65 | 65 | module stdlib_sorting
|
66 | 66 | !! This module implements overloaded sorting subroutines named `ORD_SORT`,
|
67 | 67 | !! `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 |
70 | 73 | !! increasing value, but there is an option to sort in decreasing order.
|
71 | 74 | !! All the subroutines have worst case run time performance of `O(N Ln(N))`,
|
72 | 75 | !! but on largely sorted data `ORD_SORT` and `SORT_INDEX` can have a run time
|
@@ -341,7 +344,10 @@ module stdlib_sorting
|
341 | 344 | !! `slice.rs`
|
342 | 345 | !! https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs#L2159
|
343 | 346 | !! `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 |
345 | 351 | !! data, having a performance about 25% slower than `SORT` on such
|
346 | 352 | !! data, but has much better performance than `SORT` on partially
|
347 | 353 | !! sorted data, having O(N) performance on uniformly non-increasing or
|
@@ -377,6 +383,7 @@ module stdlib_sorting
|
377 | 383 | !!
|
378 | 384 | !! The generic subroutine interface implementing the `SORT` algorithm, based
|
379 | 385 | !! on the `introsort` of David Musser.
|
| 386 | +!! ([Specification](../page/specs/stdlib_sorting.html#sort-sorts-an-input-array)) |
380 | 387 |
|
381 | 388 | #:for k1, t1 in IRS_KINDS_TYPES
|
382 | 389 | pure module subroutine ${k1}$_sort( array, reverse )
|
@@ -414,7 +421,10 @@ module stdlib_sorting
|
414 | 421 | !! based on the `"Rust" sort` algorithm found in `slice.rs`
|
415 | 422 | !! https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs#L2159
|
416 | 423 | !! 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 |
418 | 428 | !! non-decreasing sort, but if the optional argument `REVERSE` is present
|
419 | 429 | !! with a value of `.TRUE.` the indices correspond to a non-increasing sort.
|
420 | 430 |
|
|
0 commit comments