qsort Subroutine

public subroutine qsort(limit, last, maxerr, ermax, elist, iord, nrmax)

QSORT maintains the order of a list of local error estimates.

Discussion:

This routine maintains the descending ordering in the list of the local error estimates resulting from the interval subdivision process. At each call two error estimates are inserted using the sequential search top-down for the largest error estimate and bottom-up for the smallest error estimate.

Author:

Robert Piessens, Elise de Doncker-Kapenger, Christian Ueberhuber, David Kahaner

Reference:

Robert Piessens, Elise de Doncker-Kapenger, Christian Ueberhuber, David Kahaner, QUADPACK, a Subroutine Package for Automatic Integration, Springer Verlag, 1983

Parameters:

Input, integer LIMIT, the maximum number of error estimates the list can contain.

Input, integer LAST, the current number of error estimates.

Input/output, integer MAXERR, the index in the list of the NRMAX-th largest error.

Output, real ERMAX, the NRMAX-th largest error = ELIST(MAXERR).

Input, real ELIST(LIMIT), contains the error estimates.

Input/output, integer IORD(LAST). The first K elements contain pointers to the error estimates such that ELIST(IORD(1)) through ELIST(IORD(K)) form a decreasing sequence, with K = LAST if LAST <= (LIMIT/2+2), and otherwise K = LIMIT+1-LAST.

Input/output, integer NRMAX.

Arguments

Type IntentOptional Attributes Name
integer :: limit
integer :: last
integer :: maxerr
real :: ermax
real :: elist(last)
integer :: iord(last)
integer :: nrmax

Contents