repl.txt (1790B)
1 2 {{alias}}( shape, strides, offset ) 3 Computes the minimum and maximum linear indices in an underlying data buffer 4 which are accessible to an array view. 5 6 Parameters 7 ---------- 8 shape: ArrayLike 9 Array shape. 10 11 strides: ArrayLike 12 Stride array. 13 14 offset: integer 15 Location of the first indexed value based on the stride array. 16 17 Returns 18 ------- 19 out: Array 20 Minimum and maximum linear indices in an underlying data buffer which 21 are accessible to an array view. 22 23 Examples 24 -------- 25 > var d = [ 2, 3, 10 ]; 26 > var s = [ 30, -10, 1 ]; 27 > var o = 20; 28 > var out = {{alias}}( d, s, o ) 29 [ 0, 59 ] 30 > s = [ 30, 10, 1 ]; 31 > o = 0; 32 > out = {{alias}}( d, s, o ) 33 [ 0, 59 ] 34 > s = [ -30, -10, -1 ]; 35 > o = 59; 36 > out = {{alias}}( d, s, o ) 37 [ 0, 59 ] 38 39 40 {{alias}}.assign( shape, strides, offset, out ) 41 Computes the minimum and maximum linear indices in an underlying data buffer 42 which are accessible to an array view and assigns results to a provided 43 output array. 44 45 Parameters 46 ---------- 47 shape: ArrayLike 48 Array shape. 49 50 strides: ArrayLike 51 Stride array. 52 53 offset: integer 54 Location of the first indexed value based on the stride array. 55 56 out: Array|TypedArray|Object 57 Output array. 58 59 Returns 60 ------- 61 out: Array|TypedArray|Object 62 Minimum and maximum linear indices in an underlying data buffer which 63 are accessible to an array view. 64 65 Examples 66 -------- 67 > var d = [ 2, 3, 10 ]; 68 > var s = [ 30, -10, 1 ]; 69 > var o = 20; 70 > var arr = [ 0, 0 ]; 71 > var out = {{alias}}.assign( d, s, o, arr ) 72 [ 0, 59 ] 73 > var bool = ( out === arr ) 74 true 75 76 See Also 77 -------- 78