Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "ndarray/base/assert/is-buffer-length-compatible/docs/types/index.d"

Index

Functions

Export assignment isBufferLengthCompatible

  • isBufferLengthCompatible(len: number, shape: ArrayLike<number>, strides: ArrayLike<number>, offset: number): boolean
  • Returns a boolean indicating if a buffer length is compatible with provided ndarray meta data.

    Parameters

    • len: number

      buffer length

    • shape: ArrayLike<number>

      array shape

    • strides: ArrayLike<number>

      stride array

    • offset: number

      index offset

    Returns boolean

    boolean indicating if a buffer length is compatible

    Example

    var shape = [ 2, 2 ];
    var strides = [ 2, 1 ];
    var offset = 0;
    
    var bool = isBufferLengthCompatible( 4, shape, strides, offset );
    // returns true

    Example

    var shape = [ 2, 2 ];
    var strides = [ 2, 1 ];
    var offset = 2;
    
    var bool = isBufferLengthCompatible( 4, shape, strides, offset );
    // returns false