4646* ` ORD_SORT ` is intended to sort simple arrays of intrinsic data
4747 that have significant sections that were partially ordered before
4848 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
5050 input array, it returns a related array re-ordered in the
5151 same way;
5252* ` SORT_INDEX ` is based on ` ORD_SORT ` , but in addition to sorting the
@@ -63,10 +63,10 @@ data:
6363The Fortran Standard Library is distributed under the MIT
6464License. However components of the library may be based on code with
6565additional 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
6767own distribution restrictions.
6868
69- The ` ORD_SORT ` , ` SORT_ADJ ` and ` SORT_INDEX ` subroutines are essentially
69+ The ` ORD_SORT ` , ` SORT_ADJOINT ` and ` SORT_INDEX ` subroutines are essentially
7070translations to Fortran 2008 of the ` "Rust" sort ` of the Rust Language
7171distributed as part of
7272[ ` 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.
143143Arrays can be also sorted in a decreasing order by providing the argument `reverse
144144= .true.`.
145145
146- #### The ` SORT_ADJ ` subroutine
146+ #### The ` SORT_ADJOINT ` subroutine
147147
148148The ` SORT ` and ` ORD_SORT ` subroutines can sort rank 1 isolated
149149arrays of intrinsic types, but do nothing for the coordinated sorting
150150of 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
152152in the same way as the input array based on the ` ORD_SORT ` algorithm,
153153in addition to sorting the input array.
154154
155- The logic of ` SORT_ADJ ` parallels that of ` ORD_SORT ` , with
155+ The logic of ` SORT_ADJOINT ` parallels that of ` ORD_SORT ` , with
156156additional housekeeping to keep the associated array consistent with
157157the sorted positions of the input array. Because of this additional
158158housekeeping 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
160160provided as optional ` work ` and ` iwork ` arguments or allocated
161161internally on the stack.
162162
@@ -218,7 +218,7 @@ factor of six. Still, even when it shows enhanced performance, its
218218performance on partially sorted data is typically an order of
219219magnitude slower than ` ORD_SORT ` . Its memory requirements are also
220220low, 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).
222222
223223#### The ` RADIX_SORT ` subroutine
224224
@@ -405,7 +405,7 @@ element of `array` is a `NaN`.
405405{!example/sorting/example_radix_sort.f90!}
406406```
407407
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.
409409
410410##### Status
411411
@@ -419,7 +419,7 @@ sorted in the same way as the input `array`.
419419
420420##### Syntax
421421
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 ] ) `
423423
424424##### Class
425425
@@ -435,7 +435,7 @@ It is an `intent(inout)` argument. On input it
435435will be an array whose sorting indices are to be determined. On return
436436it will be the sorted array.
437437
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
439439the size of ` array ` . It is an ` intent(inout) ` argument. On return it
440440shall have values that are the indices needed to sort the original
441441array in the desired direction.
@@ -448,7 +448,7 @@ static storage, its use can significantly reduce the stack memory
448448requirements for the code. Its contents on return are undefined.
449449
450450` 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
452452is an ` intent(out) ` argument. It is intended to be used as "scratch"
453453memory for internal record keeping. If associated with an array in
454454static storage, its use can significantly reduce the stack memory
@@ -462,13 +462,13 @@ values in stable order.
462462
463463##### Notes
464464
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 `
467467as it is sorted. As a ` merge sort ` based algorithm, it is a stable
468468sorting comparison algorithm. The optional ` work ` and ` iwork ` arrays
469469replace "scratch" memory that would otherwise be allocated on the
470470stack. 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 `
472472is a ` NaN ` . Sorting of ` CHARACTER(*) ` and ` STRING_TYPE ` arrays are
473473based on the operator ` > ` , and not on the function ` LGT ` .
474474
@@ -477,10 +477,10 @@ different on return
477477
478478##### Examples
479479
480- Sorting a rank one array with ` sort_adj ` :
480+ Sorting a rank one array with ` sort_adjoint ` :
481481
482482``` Fortran
483- {!example/sorting/example_sort_adj .f90!}
483+ {!example/sorting/example_sort_adjoint .f90!}
484484```
485485
486486#### ` sort_index ` - creates an array of sorting indices for an input array, while also sorting the array.
0 commit comments