m01caf

m01caf © Numerical Algorithms Group, 2002.

Purpose

M01CAF Sort a vector, real numbers

Synopsis

[rv,ifail] = m01caf(rv<,order,ifail>)

Description

 
 M01CAF is based on Singleton's implementation of the 'median-of-
 three' Quicksort algorithm, but with two additional 
 modifications. First, small subfiles are sorted by an insertion 
 sort on a separate final pass. Second, if a subfile is 
 partitioned into two very unbalanced subfiles, the larger of 
 them is flagged for special treatment: before it is partitioned, 
 its end-points are swapped with two random points within it; 
 this makes the worst case behaviour extremely unlikely.
 

Parameters

m01caf

Required Input Arguments:

rv (:)                                real

Optional Input Arguments:                       <Default>

order (1)                             string   'a'
ifail                                 integer  -1

Output Arguments:

rv (:)                                real
ifail                                 integer