46
46
* ` ORD_SORT ` is intended to sort simple arrays of intrinsic data
47
47
that have significant sections that were partially ordered before
48
48
the sort;
49
- * ` SORT_ADJ ` is based on ` ORD_SORT ` , but in addition to sorting the
49
+ * ` SORT_ADJOINT ` is based on ` ORD_SORT ` , but in addition to sorting the
50
50
input array, it returns a related array re-ordered in the
51
51
same way;
52
52
* ` SORT_INDEX ` is based on ` ORD_SORT ` , but in addition to sorting the
@@ -63,10 +63,10 @@ data:
63
63
The Fortran Standard Library is distributed under the MIT
64
64
License. However components of the library may be based on code with
65
65
additional licensing restrictions. In particular ` ORD_SORT ` ,
66
- ` SORT_ADJ ` , ` SORT_INDEX ` , and ` SORT ` are translations of codes with their
66
+ ` SORT_ADJOINT ` , ` SORT_INDEX ` , and ` SORT ` are translations of codes with their
67
67
own distribution restrictions.
68
68
69
- The ` ORD_SORT ` , ` SORT_ADJ ` and ` SORT_INDEX ` subroutines are essentially
69
+ The ` ORD_SORT ` , ` SORT_ADJOINT ` and ` SORT_INDEX ` subroutines are essentially
70
70
translations to Fortran 2008 of the ` "Rust" sort ` of the Rust Language
71
71
distributed as part of
72
72
[ ` slice.rs ` ] ( https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs ) .
@@ -143,20 +143,20 @@ argument or allocated internally on the stack.
143
143
Arrays can be also sorted in a decreasing order by providing the argument `reverse
144
144
= .true.`.
145
145
146
- #### The ` SORT_ADJ ` subroutine
146
+ #### The ` SORT_ADJOINT ` subroutine
147
147
148
148
The ` SORT ` and ` ORD_SORT ` subroutines can sort rank 1 isolated
149
149
arrays of intrinsic types, but do nothing for the coordinated sorting
150
150
of related data, e.g., a related rank 1 array. Therefore the module
151
- provides a subroutine, ` SORT_ADJ ` , that re-order such a rank 1 array
151
+ provides a subroutine, ` SORT_ADJOINT ` , that re-order such a rank 1 array
152
152
in the same way as the input array based on the ` ORD_SORT ` algorithm,
153
153
in addition to sorting the input array.
154
154
155
- The logic of ` SORT_ADJ ` parallels that of ` ORD_SORT ` , with
155
+ The logic of ` SORT_ADJOINT ` parallels that of ` ORD_SORT ` , with
156
156
additional housekeeping to keep the associated array consistent with
157
157
the sorted positions of the input array. Because of this additional
158
158
housekeeping it has slower runtime performance than ` ORD_SORT ` .
159
- ` SORT_ADJ ` requires the use of two "scratch" arrays, that may be
159
+ ` SORT_ADJOINT ` requires the use of two "scratch" arrays, that may be
160
160
provided as optional ` work ` and ` iwork ` arguments or allocated
161
161
internally on the stack.
162
162
@@ -218,7 +218,7 @@ factor of six. Still, even when it shows enhanced performance, its
218
218
performance on partially sorted data is typically an order of
219
219
magnitude slower than ` ORD_SORT ` . Its memory requirements are also
220
220
low, being of order O(Ln(N)), while the memory requirements of
221
- ` ORD_SORT ` , ` SORT_ADJ ` and ` SORT_INDEX ` are of order O(N).
221
+ ` ORD_SORT ` , ` SORT_ADJOINT ` and ` SORT_INDEX ` are of order O(N).
222
222
223
223
#### The ` RADIX_SORT ` subroutine
224
224
@@ -405,7 +405,7 @@ element of `array` is a `NaN`.
405
405
{!example/sorting/example_radix_sort.f90!}
406
406
```
407
407
408
- #### ` sort_adj ` - sorts an associated array in the same way as the input array, while also sorting the array.
408
+ #### ` sort_adjoint ` - sorts an associated array in the same way as the input array, while also sorting the array.
409
409
410
410
##### Status
411
411
@@ -419,7 +419,7 @@ sorted in the same way as the input `array`.
419
419
420
420
##### Syntax
421
421
422
- ` call ` [[ stdlib_sorting(module): sort_adj (interface)]] ` ( array, index [, work, iwork, reverse ] ) `
422
+ ` call ` [[ stdlib_sorting(module): sort_adjoint (interface)]] ` ( array, adjoint_array [, work, iwork, reverse ] ) `
423
423
424
424
##### Class
425
425
@@ -435,7 +435,7 @@ It is an `intent(inout)` argument. On input it
435
435
will be an array whose sorting indices are to be determined. On return
436
436
it will be the sorted array.
437
437
438
- ` index ` : shall be a rank one ` integer ` or ` real ` array of
438
+ ` adjoint_array ` : shall be a rank one ` integer ` or ` real ` array of
439
439
the size of ` array ` . It is an ` intent(inout) ` argument. On return it
440
440
shall have values that are the indices needed to sort the original
441
441
array in the desired direction.
@@ -448,7 +448,7 @@ static storage, its use can significantly reduce the stack memory
448
448
requirements for the code. Its contents on return are undefined.
449
449
450
450
` iwork ` (optional): shall be a rank one integer array of the same kind
451
- of the array ` index ` , and shall have at least ` size(array)/2 ` elements. It
451
+ of the array ` adjoint_array ` , and shall have at least ` size(array)/2 ` elements. It
452
452
is an ` intent(out) ` argument. It is intended to be used as "scratch"
453
453
memory for internal record keeping. If associated with an array in
454
454
static storage, its use can significantly reduce the stack memory
@@ -462,13 +462,13 @@ values in stable order.
462
462
463
463
##### Notes
464
464
465
- ` SORT_ADJ ` implements the hybrid sorting algorithm of ` ORD_SORT ` ,
466
- keeping the values of ` index ` consistent with the elements of ` array `
465
+ ` SORT_ADJOINT ` implements the hybrid sorting algorithm of ` ORD_SORT ` ,
466
+ keeping the values of ` adjoint_array ` consistent with the elements of ` array `
467
467
as it is sorted. As a ` merge sort ` based algorithm, it is a stable
468
468
sorting comparison algorithm. The optional ` work ` and ` iwork ` arrays
469
469
replace "scratch" memory that would otherwise be allocated on the
470
470
stack. If ` array ` is of any kind of ` REAL ` the order of the elements in
471
- ` index ` and ` array ` on return are undefined if any element of ` array `
471
+ ` adjoint_array ` and ` array ` on return are undefined if any element of ` array `
472
472
is a ` NaN ` . Sorting of ` CHARACTER(*) ` and ` STRING_TYPE ` arrays are
473
473
based on the operator ` > ` , and not on the function ` LGT ` .
474
474
@@ -477,10 +477,10 @@ different on return
477
477
478
478
##### Examples
479
479
480
- Sorting a rank one array with ` sort_adj ` :
480
+ Sorting a rank one array with ` sort_adjoint ` :
481
481
482
482
``` Fortran
483
- {!example/sorting/example_sort_adj .f90!}
483
+ {!example/sorting/example_sort_adjoint .f90!}
484
484
```
485
485
486
486
#### ` sort_index ` - creates an array of sorting indices for an input array, while also sorting the array.
0 commit comments