@@ -295,17 +295,17 @@ module stdlib_sorting
295
295
!! ...
296
296
!!```
297
297
298
- public sort_adj
298
+ public sort_adjoint
299
299
!! Version: experimental
300
300
!!
301
301
!! The generic subroutine implementing the `SORT_ADJ` algorithm to
302
- !! return an index array whose elements are sorted in the same order
302
+ !! return an adjoint array whose elements are sorted in the same order
303
303
!! as the input array in the
304
304
!! desired direction. It is primarily intended to be used to sort a
305
305
!! rank 1 `integer` or `real` array based on the values of a component of the array.
306
306
!! Its use has the syntax:
307
307
!!
308
- !! call sort_adj ( array, index [, work, iwork, reverse ] )
308
+ !! call sort_adjoint ( array, adjoint_array [, work, iwork, reverse ] )
309
309
!!
310
310
!! with the arguments:
311
311
!!
@@ -315,11 +315,11 @@ module stdlib_sorting
315
315
!! `real(real128)`, `character(*)`, `type(string_type)`,
316
316
!! `type(bitset_64)`, `type(bitset_large)`. If both the
317
317
!! type of `array` is real and at least one of the elements is a `NaN`,
318
- !! then the ordering of the `array` and `index ` results is undefined.
318
+ !! then the ordering of the `array` and `adjoint_array ` results is undefined.
319
319
!! Otherwise it is defined to be as specified by reverse.
320
320
!!
321
- !! * index : a rank 1 `integer` or `real` array. It is an `intent(inout)`
322
- !! argument of the type `integer(int_index)` . Its size shall be the
321
+ !! * adjoint_array : a rank 1 `integer` or `real` array. It is an `intent(inout)`
322
+ !! argument. Its size shall be the
323
323
!! same as `array`. On return, its elements are sorted in the same order
324
324
!! as the input `array` in the direction specified by `reverse`.
325
325
!!
@@ -330,7 +330,7 @@ module stdlib_sorting
330
330
!! storage, its use can significantly reduce the stack memory requirements
331
331
!! for the code. Its value on return is undefined.
332
332
!!
333
- !! * iwork (optional): shall be a rank 1 integer array of the same type as `index `,
333
+ !! * iwork (optional): shall be a rank 1 integer array of the same type as `adjoint_array `,
334
334
!! and shall have at least `size(array)/2` elements. It is an
335
335
!! `intent(out)` argument to be used as "scratch" memory
336
336
!! for internal record keeping. If associated with an array in static
@@ -348,21 +348,21 @@ module stdlib_sorting
348
348
!! Sorting a related rank one array:
349
349
!!
350
350
!!```Fortran
351
- !!program example_sort_adj
352
- !! use stdlib_sorting, only: sort_adj
351
+ !!program example_sort_adjoint
352
+ !! use stdlib_sorting, only: sort_adjoint
353
353
!! implicit none
354
354
!! integer, allocatable :: array(:)
355
355
!! real, allocatable :: adj(:)
356
356
!!
357
357
!! array = [5, 4, 3, 1, 10, 4, 9]
358
358
!! allocate(adj, source=real(array))
359
359
!!
360
- !! call sort_adj (array, adj)
360
+ !! call sort_adjoint (array, adj)
361
361
!!
362
362
!! print *, array !print [1, 3, 4, 4, 5, 9, 10]
363
363
!! print *, adj !print [1., 3., 4., 4., 5., 9., 10.]
364
364
!!
365
- !!end program example_sort_adj
365
+ !!end program example_sort_adjoint
366
366
!!```
367
367
368
368
public sort_index
@@ -576,42 +576,42 @@ module stdlib_sorting
576
576
577
577
end interface sort
578
578
579
- interface sort_adj
579
+ interface sort_adjoint
580
580
!! Version: experimental
581
581
!!
582
582
!! The generic subroutine interface implementing the `SORT_ADJ` algorithm,
583
583
!! based on the `"Rust" sort` algorithm found in `slice.rs`
584
584
!! https://github.com/rust-lang/rust/blob/90eb44a5897c39e3dff9c7e48e3973671dcd9496/src/liballoc/slice.rs#L2159
585
585
!! but modified to return an array of indices that would provide a stable
586
586
!! sort of the rank one `ARRAY` input.
587
- !! ([Specification](../page/specs/stdlib_sorting.html#sort_adj -creates-an-array-of-sorting-indices-for-an-input-array-while-also-sorting-the-array))
587
+ !! ([Specification](../page/specs/stdlib_sorting.html#sort_adjoint -creates-an-array-of-sorting-indices-for-an-input-array-while-also-sorting-the-array))
588
588
!!
589
589
!! The indices by default correspond to a
590
590
!! non-decreasing sort, but if the optional argument `REVERSE` is present
591
591
!! with a value of `.TRUE.` the indices correspond to a non-increasing sort.
592
592
593
593
#:for ti, tii, namei in IR_INDEX_TYPES_ALT_NAME
594
594
#:for t1, t2, name1 in IRSCB_TYPES_ALT_NAME
595
- module subroutine ${name1}$_${namei}$_sort_adj ( array, index , work, iwork, &
595
+ module subroutine ${name1}$_${namei}$_sort_adjoint ( array, adjoint_array , work, iwork, &
596
596
reverse )
597
597
!! Version: experimental
598
598
!!
599
- !! `${name1}$_${namei}$_sort_adj ( array, index [, work, iwork, reverse] )` sorts
599
+ !! `${name1}$_${namei}$_sort_adjoint ( array, adjoint_array [, work, iwork, reverse] )` sorts
600
600
!! an input `ARRAY` of type `${t1}$`
601
601
!! using a hybrid sort based on the `"Rust" sort` algorithm found in `slice.rs`
602
602
!! and returns the sorted `ARRAY` and an array `INDEX` of indices in the
603
603
!! order that would sort the input `ARRAY` in the desired direction.
604
604
${t1}$, intent(inout) :: array(0:)
605
- ${ti}$, intent(inout) :: index (0:)
605
+ ${ti}$, intent(inout) :: adjoint_array (0:)
606
606
${t2}$, intent(out), optional :: work(0:)
607
607
${ti}$, intent(out), optional :: iwork(0:)
608
608
logical, intent(in), optional :: reverse
609
- end subroutine ${name1}$_${namei}$_sort_adj
609
+ end subroutine ${name1}$_${namei}$_sort_adjoint
610
610
611
611
#:endfor
612
612
#:endfor
613
613
614
- end interface sort_adj
614
+ end interface sort_adjoint
615
615
616
616
interface sort_index
617
617
!! Version: experimental
@@ -677,7 +677,7 @@ contains
677
677
index(i) = int(i+1, kind=${ki}$)
678
678
end do
679
679
680
- call sort_adj (array, index, work, iwork, reverse)
680
+ call sort_adjoint (array, index, work, iwork, reverse)
681
681
682
682
end subroutine ${name1}$_sort_index_${namei}$
683
683
0 commit comments