@@ -25,15 +25,15 @@ module's `string_type` type.
25
25
## Overview of the module
26
26
27
27
The module ` stdlib_sorting ` defines several public entities, one
28
- default integer parameter, ` int_size ` , and four overloaded
28
+ default integer parameter, ` int_index ` , and four overloaded
29
29
subroutines: ` ORD_SORT ` , ` SORT ` , ` RADIX_SORT ` and ` SORT_INDEX ` . The
30
30
overloaded subroutines also each have several specific names for
31
31
versions corresponding to different types of array arguments.
32
32
33
- ### The ` int_size ` parameter
33
+ ### The ` int_index ` parameter
34
34
35
- The ` int_size ` parameter is used to specify the kind of integer used
36
- in indexing the various arrays. Currently the module sets ` int_size `
35
+ The ` int_index ` parameter is used to specify the kind of integer used
36
+ in indexing the various arrays. Currently the module sets ` int_index `
37
37
to the value of ` int64 ` from the ` stdlib_kinds ` module.
38
38
39
39
### The module subroutines
@@ -414,7 +414,7 @@ It is an `intent(inout)` argument. On input it
414
414
will be an array whose sorting indices are to be determined. On return
415
415
it will be the sorted array.
416
416
417
- ` index ` : shall be a rank one integer array of kind ` int_size ` and of
417
+ ` index ` : shall be a rank one integer array of kind ` int_index ` and of
418
418
the size of ` array ` . It is an ` intent(out) ` argument. On return it
419
419
shall have values that are the indices needed to sort the original
420
420
array in the desired direction.
@@ -427,7 +427,7 @@ static storage, its use can significantly reduce the stack memory
427
427
requirements for the code. Its contents on return are undefined.
428
428
429
429
` iwork ` (optional): shall be a rank one integer array of kind
430
- ` int_size ` , and shall have at least ` size(array)/2 ` elements. It
430
+ ` int_index ` , and shall have at least ` size(array)/2 ` elements. It
431
431
is an ` intent(out) ` argument. It is intended to be used as "scratch"
432
432
memory for internal record keeping. If associated with an array in
433
433
static storage, its use can significantly reduce the stack memory
@@ -465,8 +465,8 @@ Sorting a related rank one array:
465
465
integer, intent(inout) :: a(:)
466
466
integer(int32), intent(inout) :: b(:) ! The same size as a
467
467
integer(int32), intent(out) :: work(:)
468
- integer(int_size ), intent(out) :: index(:)
469
- integer(int_size ), intent(out) :: iwork(:)
468
+ integer(int_index ), intent(out) :: index(:)
469
+ integer(int_index ), intent(out) :: iwork(:)
470
470
! Find the indices to sort a
471
471
call sort_index(a, index(1:size(a)),&
472
472
work(1:size(a)/2), iwork(1:size(a)/2))
@@ -483,8 +483,8 @@ Sorting a rank 2 array based on the data in a column
483
483
integer, intent(inout) :: array(:,:)
484
484
integer(int32), intent(in) :: column
485
485
integer(int32), intent(out) :: work(:)
486
- integer(int_size ), intent(out) :: index(:)
487
- integer(int_size ), intent(out) :: iwork(:)
486
+ integer(int_index ), intent(out) :: index(:)
487
+ integer(int_index ), intent(out) :: iwork(:)
488
488
integer, allocatable :: dummy(:)
489
489
integer :: i
490
490
allocate(dummy(size(array, dim=1)))
@@ -508,8 +508,8 @@ Sorting an array of a derived type based on the data in one component
508
508
type(a_type), intent(inout) :: a_data(:)
509
509
integer(int32), intent(inout) :: a(:)
510
510
integer(int32), intent(out) :: work(:)
511
- integer(int_size ), intent(out) :: index(:)
512
- integer(int_size ), intent(out) :: iwork(:)
511
+ integer(int_index ), intent(out) :: index(:)
512
+ integer(int_index ), intent(out) :: iwork(:)
513
513
! Extract a component of `a_data`
514
514
a(1:size(a_data)) = a_data(:) % a
515
515
! Find the indices to sort the component
0 commit comments