Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ndarray/base/bind2vind/docs/types/index.d"

Index

Functions

Functions

Export assignment bind2vind

  • Converts a linear index in an underlying data buffer to a linear index in an array view.

    throws

    linear index must not exceed array dimensions

    Parameters

    • shape: ArrayLike<number>

      array shape

    • strides: ArrayLike<number>

      stride array

    • offset: number

      location of the first indexed value based on the stride array

    • order: Order

      specifies whether an array is row-major (C-style) or column-major (Fortran-style)

    • idx: number

      linear index in an underlying data buffer

    • mode: Mode

      specifies how to handle a linear index which exceeds array dimensions

    Returns number

    linear index in an array view

    Example

    var shape = [ 3, 3 ];
    var strides = [ -3, 1 ];
    var offset = 6;
    var order = 'row-major';
    var mode = 'throw';
    
    var ind = bind2vind( shape, strides, offset, order, 7, mode );
    // returns 1