|
64 | 64 |
|
65 | 65 | module stdlib_sorting |
66 | 66 | !! This module implements overloaded sorting subroutines named `ORD_SORT`, |
67 | | -!! `SORT_INDEX`, and `SORT`, that each can be used to sort arrays of assumed |
68 | | -!! length characters, of `sdtlib_string_type` module `string_type`, |
69 | | -!! of four kinds of `INTEGER` and of three kinds of `REAL`. |
| 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)`. |
70 | 70 | !! ([Specification](../page/specs/stdlib_sorting.html)) |
71 | 71 | !! |
72 | | -!!By default, sorting |
73 | | -!! is in order of increasing value, though all subroutines have the option of |
74 | | -!! sorting in order of decresasing value. All the subroutines have worst |
75 | | -!! case run time performance of `O(N Ln(N))`, but on largely sorted data |
76 | | -!! `ORD_SORT` and `SORT_INDEX` can have a run time performance of `O(N)`. |
| 72 | +!! By default sorting is in order of |
| 73 | +!! increasing value, but there is an option to sort in decreasing order. |
| 74 | +!! All the subroutines have worst case run time performance of `O(N Ln(N))`, |
| 75 | +!! but on largely sorted data `ORD_SORT` and `SORT_INDEX` can have a run time |
| 76 | +!! performance of `O(N)`. |
77 | 77 | !! |
78 | 78 | !! `ORD_SORT` is a translation of the `"Rust" sort` sorting algorithm in |
79 | 79 | !! `slice.rs`: |
@@ -153,10 +153,10 @@ module stdlib_sorting |
153 | 153 | !! * array: the rank 1 array to be sorted. It is an `intent(inout)` |
154 | 154 | !! argument of any of the types `integer(int8)`, `integer(int16)`, |
155 | 155 | !! `integer(int32)`, `integer(int64)`, `real(real32)`, `real(real64)`, |
156 | | -!! `real(real128)`, or `character(*)`. If both the type of `array` is |
157 | | -!! real and at least one of the elements is a `NaN`, then the ordering |
158 | | -!! of the result is undefined. Otherwise it is defined to be the |
159 | | -!! original elements in non-decreasing order. |
| 156 | +!! `real(real128)`, `character(*)`, `type(string_type)`. If both the |
| 157 | +!! type of `array` is real and at least one of the elements is a |
| 158 | +!! `NaN`, then the ordering of the result is undefined. Otherwise it |
| 159 | +!! is defined to be the original elements in non-decreasing order. |
160 | 160 | !! |
161 | 161 | !! * work (optional): shall be a rank 1 array of the same type as |
162 | 162 | !! `array`, and shall have at least `size(array)/2` elements. It is an |
@@ -203,9 +203,9 @@ module stdlib_sorting |
203 | 203 | !! * array: the rank 1 array to be sorted. It is an `intent(inout)` |
204 | 204 | !! argument of any of the types `integer(int8)`, `integer(int16)`, |
205 | 205 | !! `integer(int32)`, `integer(int64)`, `real(real32)`, `real(real64)`, |
206 | | -!! `real(real128)`, or `character(*)`. If both the type of `array` is |
207 | | -!! real and at least one of the elements is a `NaN`, then the ordering |
208 | | -!! of the result is undefined. Otherwise it is defined to be the |
| 206 | +!! `real(real128)`, `character(*)`, `type(string_type)`. If both the type |
| 207 | +!! of `array` is real and at least one of the elements is a `NaN`, then |
| 208 | +!! the ordering of the result is undefined. Otherwise it is defined to be the |
209 | 209 | !! original elements in non-decreasing order. |
210 | 210 | !! * `reverse` (optional): shall be a scalar of type default logical. It |
211 | 211 | !! is an `intent(in)` argument. If present with a value of `.true.` then |
@@ -242,10 +242,10 @@ module stdlib_sorting |
242 | 242 | !! * array: the rank 1 array to be sorted. It is an `intent(inout)` |
243 | 243 | !! argument of any of the types `integer(int8)`, `integer(int16)`, |
244 | 244 | !! `integer(int32)`, `integer(int64)`, `real(real32)`, `real(real64)`, |
245 | | -!! `real(real128)`, or `character(*)`. If both the type of `array` is |
246 | | -!! real and at least one of the elements is a `NaN`, then the ordering |
247 | | -!! of the `array` and `index` results is undefined. Otherwise it is |
248 | | -!! defined to be as specified by reverse. |
| 245 | +!! `real(real128)`, `character(*)`, `type(string_type)`. If both the |
| 246 | +!! type of `array` is real and at least one of the elements is a `NaN`, |
| 247 | +!! then the ordering of the `array` and `index` results is undefined. |
| 248 | +!! Otherwise it is defined to be as specified by reverse. |
249 | 249 | !! |
250 | 250 | !! * index: a rank 1 array of sorting indices. It is an `intent(out)` |
251 | 251 | !! argument of the type `integer(int_size)`. Its size shall be the |
|
0 commit comments