next up previous contents index
Next: PrimitiveMemoryBlock Up: PrimitiveArrayType Previous: resize!   Contents   Index


sort!


Usage

sort!(a, n, m)
sort!(a, n, m, f)


Signature

sort!: (%,MachineInteger,MachineInteger, (T,T) $\to$ Boolean) $\to$ %


Parameter Type Description
a % a primitive array
n, m MachineInteger indices
f (T, T) $\to$ Boolean a comparison function


Description

Sorts the subarray $[a.n,\dots,a.m]$ using the ordering $x < y \iff f(x,y)$. The comparison function $f$ is optional if $T$ has TotallyOrderedType, in which case the order function of $T$ is taken.



Manuel Bronstein 2004-06-28