FORCES
FORtran lib for Comp. Env. Sys.
|
Find median value of array. More...
Public Member Functions | |
recursive real(kind=dp) function | d_valmed (xdont) |
recursive real(kind=sp) function | r_valmed (xdont) |
recursive integer(kind=i4) function | i_valmed (xdont) |
Find median value of array.
Finds out and returns the median(((Size(XVALT)+1))/2th value) of XVALT This routine uses the recursive procedure described in Knuth, The Art of Computer Programming, vol. 3, 5.3.3 - This procedure is linear in time, and does not require to be able to interpolate in the set as the one used in VALNTH/INDNTH. It also has better worst case behavior than VALNTH/INDNTH, and is about 20% faster in average for random uniformly distributed values.
[in] | integer(i4)/real(sp,dp), dimension(:) :: XVALT | Array to be ranked. |
integer(i4)/real(sp,dp) :: VALMED | Value of median. |
Definition at line 687 of file mo_orderpack.f90.
recursive real(kind = dp) function mo_orderpack::valmed::d_valmed | ( | real(kind = dp), dimension (:), intent(in) | xdont | ) |
Definition at line 14359 of file mo_orderpack.f90.
recursive integer(kind = i4) function mo_orderpack::valmed::i_valmed | ( | integer(kind = i4), dimension (:), intent(in) | xdont | ) |
Definition at line 15031 of file mo_orderpack.f90.
recursive real(kind = sp) function mo_orderpack::valmed::r_valmed | ( | real(kind = sp), dimension (:), intent(in) | xdont | ) |
Definition at line 14695 of file mo_orderpack.f90.