Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface describing dsort2ins.

Hierarchy

  • Routine

Callable

  • Simultaneously sorts two double-precision floating-point strided arrays based on the sort order of the first array using insertion sort.

    Parameters

    • N: number

      number of indexed elements

    • order: number

      sort order

    • x: Float64Array

      first input array

    • strideX: number

      x stride length

    • y: Float64Array

      second input array

    • strideY: number

      y stride length

    Returns Float64Array

    x

    Example

    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 ]

Index

Methods

Methods

ndarray

  • 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.

    Parameters

    • N: number

      number of indexed elements

    • order: number

      sort order

    • x: Float64Array

      first input array

    • strideX: number

      x stride length

    • offsetX: number

      x starting index

    • y: Float64Array

      second input array

    • strideY: number

      y stride length

    • offsetY: number

      y starting index

    Returns Float64Array

    x

    Example

    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 ]