sort Interface

public interface sort

The generic subroutine interface implementing the SORT algorithm, based on the introsort of David Musser. (Specification)


Contents


Subroutines

private pure module subroutine char_sort(array, reverse)

char_sort( array[, reverse] ) sorts the input ARRAY of type character(len=*) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
character(len=*), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine dp_sort(array, reverse)

dp_sort( array[, reverse] ) sorts the input ARRAY of type real(dp) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
real(kind=dp), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine int16_sort(array, reverse)

int16_sort( array[, reverse] ) sorts the input ARRAY of type integer(int16) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
integer(kind=int16), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine int32_sort(array, reverse)

int32_sort( array[, reverse] ) sorts the input ARRAY of type integer(int32) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
integer(kind=int32), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine int64_sort(array, reverse)

int64_sort( array[, reverse] ) sorts the input ARRAY of type integer(int64) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
integer(kind=int64), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine int8_sort(array, reverse)

int8_sort( array[, reverse] ) sorts the input ARRAY of type integer(int8) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
integer(kind=int8), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine sp_sort(array, reverse)

sp_sort( array[, reverse] ) sorts the input ARRAY of type real(sp) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
real(kind=sp), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse

private pure module subroutine string_type_sort(array, reverse)

string_type_sort( array[, reverse] ) sorts the input ARRAY of type type(string_type) using a hybrid sort based on the introsort of David Musser. The algorithm is of order O(N Ln(N)) for all inputs. Because it relies on quicksort, the coefficient of the O(N Ln(N)) behavior is small for random data compared to other sorting algorithms.

Arguments

TypeIntentOptionalAttributesName
type(string_type), intent(inout) :: array(0:)
logical, intent(in), optional :: reverse