Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.
number of indexed elements
sort order
first input array
first stride length
second input array
second stride length
x
var Float64Array = require( '@stdlib/array/float64' );
var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );
var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );
dsort2ins( x.length, 1, x, 1, y, 1 );
console.log( x );
// => <Float64Array>[ -4.0, -2.0, 1.0, 3.0 ]
console.log( y );
// => <Float64Array>[ 3.0, 1.0, 0.0, 2.0 ]
Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort and alternative indexing semantics.
number of indexed elements
sort order
first input array
x
stride length
x
starting index
second input array
y
stride length
y
starting index
x
var Float64Array = require( '@stdlib/array/float64' );
var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );
var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );
dsort2ins.ndarray( x.length, 1, x, 1, 0, y, 1, 0 );
console.log( x );
// => <Float64Array>[ -4.0, -2.0, 1.0, 3.0 ]
console.log( y );
// => <Float64Array>[ 3.0, 1.0, 0.0, 2.0 ]
Interface describing
dsort2ins
.