sort_merge_permutation Interface

interface
public module subroutine sort_merge_permutation(keys, n, na, perm)

Arguments

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

the keys, in precedence order.

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

total rows across both ranges.

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

rows in the first range.

integer(kind=int64), intent(inout) :: perm(:)

receives n 1-based row indices.

Description

Merges the already-ordered ranges 1..na and na+1..n into one permutation.

Ties take from the FIRST range, which is std::merge's stability guarantee and what makes pf_merge agree with pf_sort of the concatenation element for element.