Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "strided/dispatch/docs/types/index.d"

Index

Type aliases

StridedArrayFcn

StridedArrayFcn: (arrays: Array<ArrayLike<any>>, shape: Array<number>, strides: Array<number>, data?: any) => void

Strided array function.

param

array containing strided input and output arrays

param

array containing a single element, the number of indexed elements

param

array containing the stride lengths for the strided input and output arrays

param

strided array function data (e.g., a callback)

Type declaration

    • (arrays: Array<ArrayLike<any>>, shape: Array<number>, strides: Array<number>, data?: any): void
    • Parameters

      • arrays: Array<ArrayLike<any>>
      • shape: Array<number>
      • strides: Array<number>
      • Optional data: any

      Returns void

StridedArrayFcnWithOffsets

StridedArrayFcnWithOffsets: (arrays: Array<ArrayLike<any>>, shape: Array<number>, strides: Array<number>, offsets: Array<number>, data?: any) => void

Strided array function using alternative indexing semantics.

param

array containing strided input and output arrays

param

array containing a single element, the number of indexed elements

param

array containing the stride lengths for the strided input and output arrays

param

array containing the starting indices (i.e., index offsets) for the strided input and output arrays

param

strided array function data (e.g., a callback)

Type declaration

    • (arrays: Array<ArrayLike<any>>, shape: Array<number>, strides: Array<number>, offsets: Array<number>, data?: any): void
    • Parameters

      • arrays: Array<ArrayLike<any>>
      • shape: Array<number>
      • strides: Array<number>
      • offsets: Array<number>
      • Optional data: any

      Returns void

Functions

dispatch

  • Returns a strided array function interface which performs multiple dispatch.

    throws

    first argument must be either a function or an array of functions

    throws

    second argument must be an an array-like object

    throws

    third argument must be an array-like object or null

    throws

    third and first arguments must have the same number of elements

    throws

    fourth argument must be a positive integer

    throws

    fifth argument must be a nonnegative integer

    throws

    sixth argument must be a nonnegative integer

    throws

    fourth argument must be compatible with the specified number of input and output arrays

    throws

    number of types must match the number of functions times the total number of array arguments for each function

    throws

    interface must accept at least one strided input and/or output array

    Parameters

    • fcns: StridedArrayFcn | ArrayLike<StridedArrayFcn>

      list of strided array functions

    • types: ArrayLike<any>

      one-dimensional list of strided array argument data types

    • data: ArrayLike<any> | null

      strided array function data (e.g., callbacks)

    • nargs: number

      total number of strided array function interface arguments (including data types, strides, and offsets)

    • nin: number

      number of input strided arrays

    • nout: number

      number of output strided arrays

    Returns Dispatcher

    strided array function interface

    Example

    var unary = require( `@stdlib/strided/base/unary` );
    var abs = require( `@stdlib/math/base/special/abs` );
    var Float64Array = require( `@stdlib/array/float64` );
    
    var types = [
        'float64', 'float64'
    ];
    
    var data = [
        abs
    ];
    
    var strided = dispatch( unary, types, data, 7, 1, 1 );
    
    // ...
    
    var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] );
    var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
    
    strided( x.length, 'float64', x, 1, 'float64', y, 1 );
    // y => <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]
  • Returns a strided array function interface which performs multiple dispatch and supports alternative indexing semantics.

    throws

    first argument must be either a function or an array of functions

    throws

    second argument must be an array-like object

    throws

    third argument must be an array-like object or null

    throws

    third and first arguments must have the same number of elements

    throws

    fourth argument must be a positive integer

    throws

    fifth argument must be a nonnegative integer

    throws

    sixth argument must be a nonnegative integer

    throws

    fourth argument must be compatible with the specified number of input and output arrays

    throws

    number of types must match the number of functions times the total number of array arguments for each function

    throws

    interface must accept at least one strided input and/or output array

    Parameters

    • fcns: StridedArrayFcnWithOffsets | ArrayLike<StridedArrayFcnWithOffsets>

      list of strided array functions

    • types: ArrayLike<any>

      one-dimensional list of strided array argument data types

    • data: ArrayLike<any> | null

      strided array function data (e.g., callbacks)

    • nargs: number

      total number of strided array function interface arguments (including data types, strides, and offsets)

    • nin: number

      number of input strided arrays

    • nout: number

      number of output strided arrays

    Returns Dispatcher

    strided array function interface

    Example

    var unary = require( `@stdlib/strided/base/unary` ).ndarray;
    var abs = require( `@stdlib/math/base/special/abs` );
    var Float64Array = require( `@stdlib/array/float64` );
    
    var types = [
        'float64', 'float64'
    ];
    
    var data = [
        abs
    ];
    
    var strided = dispatch( unary, types, data, 9, 1, 1 );
    
    // ...
    
    var x = new Float64Array( [ -1.0, -2.0, -3.0, -4.0, -5.0 ] );
    var y = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0 ] );
    
    strided( x.length, 'float64', x, 1, 0, 'float64', y, 1, 0 );
    // y => <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0 ]