Sorts a strided array using heapsort.
number of indexed elements
sort order
input array
stride length
x
var x = [ 1.0, -2.0, 3.0, -4.0 ];
gsorthp( x.length, 1, x, 1 );
// x => [ -4.0, -2.0, 1.0, 3.0 ]
Sorts a strided array using heapsort and alternative indexing semantics.
number of indexed elements
sort order
input array
stride length
starting index
x
var x = [ 1.0, -2.0, 3.0, -4.0 ];
gsorthp.ndarray( x.length, 1, x, 1, 0 );
// x => [ -4.0, -2.0, 1.0, 3.0 ]
Interface describing
gsorthp
.