sort_counting_candidate Interface

interface
public module function sort_counting_candidate(keys, n, lo, hi) result(ok)

Arguments

Type IntentOptional Attributes Name
type(sort_key_buf), intent(in) :: keys(:)

the keys; only a lone integer key qualifies.

integer(kind=int64), intent(in) :: n

rows.

integer(kind=int64), intent(out) :: lo

smallest valid key value, or 0.

integer(kind=int64), intent(out) :: hi

largest valid key value, or 0.

Return Value logical

.true. when the counting path applies.

Description

Whether the single-key integer counting sort applies, and over what value range.

lo/hi are the key's range over its VALID rows only — a null row's value slot holds whatever the buffer contained, so including it could widen the range past the bucket limit and decline the fast path for no reason. An all-null key answers .true. with lo == hi == 0, which yields the identity permutation.