Use an in-place introspection sort on an array of numbers
Example usage
program sortTest use variableKind, only: i32, r64 use m_strings, only: str use m_allocate, only: allocate use m_random, only: rngInteger, rngNormal use m_arrays, only: arange, isSorted use m_sort, only: sort real(r64),allocatable :: d1D(:) integer(i32),allocatable :: i1D(:) integer(i32) :: N N = 10000 write(*,'(a)') 'In-place sort a 10000 length array of random double precision numbers' call allocate(d1D,N) call rngNormal(d1D) call sort(d1D) write(*,'(a)') 'Double array is sorted? '//str(isSorted(d1D)) write(*,'(a)') 'In-place sort a 10000 length array of random integers'' call allocate(i1D,N) call rngInteger(i1D) call sort(i1D) write(*,'(a)') 'Integer array is sorted? '//str(isSorted(i1D)) end program
Interfaced with sort
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i32) | :: | this(:) | ||||
logical, | optional | :: | stable |
Interfaced with sort
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=i64) | :: | this(:) | ||||
logical, | optional | :: | stable |
Interfaced with sort
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r32) | :: | this(:) | ||||
logical, | optional | :: | stable |
Interfaced with sort
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64) | :: | this(:) | ||||
logical, | optional | :: | stable |