FORCES
FORtran lib for Comp. Env. Sys.
|
Nth index of skewed-pivot with quicksort ranking. More...
Public Member Functions | |
integer(kind=i4) function | d_indnth (xdont, nord) |
integer(kind=i4) function | r_indnth (xdont, nord) |
integer(kind=i4) function | i_indnth (xdont, nord) |
Nth index of skewed-pivot with quicksort ranking.
Returns the index of the NORDth value of XVALT (in increasing order). 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 fast 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 takes out the original index of the maximum value in this set.
[in] | integer(i4)/real(sp,dp), dimension(:) :: XVALT | Array to be ranked. |
[in] | integer(i4) :: NORD | Number of ranked elements. |
integer(i4) :: INDNTH | Index of NORDth rank. |
Definition at line 412 of file mo_orderpack.f90.
integer(kind = i4) function mo_orderpack::indnth::d_indnth | ( | real(kind = dp), dimension (:), intent(in) | xdont, |
integer(kind = i4), intent(in) | nord | ||
) |
Definition at line 2223 of file mo_orderpack.f90.
integer(kind = i4) function mo_orderpack::indnth::i_indnth | ( | integer(kind = i4), dimension (:), intent(in) | xdont, |
integer(kind = i4), intent(in) | nord | ||
) |
Definition at line 3235 of file mo_orderpack.f90.
integer(kind = i4) function mo_orderpack::indnth::r_indnth | ( | real(kind = sp), dimension (:), intent(in) | xdont, |
integer(kind = i4), intent(in) | nord | ||
) |
Definition at line 2729 of file mo_orderpack.f90.