string_sort_module Module

String sorting routines.



Functions

public function list_is_sorted(str, case_sensitive, natural) result(sorted)

Returns true if the list is lexically sorted in increasing order.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout), dimension(:) :: str
logical, intent(in) :: case_sensitive

if true, the sort is case sensitive

logical, intent(in) :: natural

if true, the sort is "natural"

Return Value logical


Subroutines

public pure subroutine lexical_sort_nonrecursive(str, case_sensitive)

Sorts a character array str in increasing order.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout), dimension(:) :: str

on entry,the array to be sorted. on exit,str has been sorted into increasing order (str(1) <= ... <= str(n))

logical, intent(in) :: case_sensitive

if true, the sort is case sensitive

public subroutine lexical_sort_recursive(str, case_sensitive)

Sorts a character array str in increasing order. Uses a basic recursive quicksort (with insertion sort for partitions with <= 20 elements).

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout), dimension(:) :: str
logical, intent(in) :: case_sensitive

if true, the sort is case sensitive

public subroutine lexical_sort_natural_recursive(str, case_sensitive)

Sorts a character array str in increasing order, using a "natural" sorting method.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout), dimension(:) :: str
logical, intent(in) :: case_sensitive

if true, the sort is case sensitive