FORCES
FORtran lib for Comp. Env. Sys.
|
Partial quicksort/insertion sort ranking, with removal of duplicate entries. More...
Public Member Functions | |
subroutine | d_unipar (xdont, irngt, nord) |
subroutine | r_unipar (xdont, irngt, nord) |
subroutine | i_unipar (xdont, irngt, nord) |
Partial quicksort/insertion sort ranking, with removal of duplicate entries.
Ranks partially XVALT by IRNGT, up to order NORD at most, removing duplicate entries. This routine uses a pivoting strategy such as the one of finding the median based on the quicksort algorithm, but we skew the pivot choice to try to bring it to NORD as quickly as possible. It uses 2 temporary arrays, one where it stores the indices of the values smaller than the pivot, and the other for the indices of values larger than the pivot that we might still need later on. It iterates until it can bring the number of values in ILOWT to exactly NORD, and then uses an insertion sort to rank this set, since it is supposedly small. At all times, the NORD first values in ILOWT correspond to distinct values of the input array.
[in] | integer(i4)/real(sp,dp), dimension(:) :: XVALT | Array to be ranked. |
[in] | integer(i4) :: NORD | Rank of quicksort ranking. |
[out] | integer(i4), dimension(:) :: IRNGT | Index of rank. |
Definition at line 638 of file mo_orderpack.f90.
subroutine mo_orderpack::unipar::d_unipar | ( | real(kind = dp), dimension (:), intent(in) | xdont, |
integer(kind = i4), dimension (:), intent(out) | irngt, | ||
integer(kind = i4), intent(inout) | nord | ||
) |
Definition at line 11724 of file mo_orderpack.f90.
subroutine mo_orderpack::unipar::i_unipar | ( | integer(kind = i4), dimension (:), intent(in) | xdont, |
integer(kind = i4), dimension (:), intent(out) | irngt, | ||
integer(kind = i4), intent(inout) | nord | ||
) |
Definition at line 12926 of file mo_orderpack.f90.
subroutine mo_orderpack::unipar::r_unipar | ( | real(kind = sp), dimension (:), intent(in) | xdont, |
integer(kind = i4), dimension (:), intent(out) | irngt, | ||
integer(kind = i4), intent(inout) | nord | ||
) |
Definition at line 12325 of file mo_orderpack.f90.