repl.txt (1209B)
1 2 {{alias}}( shape, order ) 3 Generates a stride array from an array shape. 4 5 Parameters 6 ---------- 7 shape: ArrayLike 8 Array shape. 9 10 order: string 11 Specifies whether an array is row-major (C-style) or column-major 12 (Fortran-style). 13 14 Returns 15 ------- 16 out: Array 17 Stride array. 18 19 Examples 20 -------- 21 > var d = [ 3, 2 ]; 22 > var s = {{alias}}( d, 'row-major' ) 23 [ 2, 1 ] 24 > d = [ 2, 1, 10 ]; 25 > s = {{alias}}( d, 'column-major' ) 26 [ 1, 2, 2 ] 27 28 29 {{alias}}.assign( shape, order, out ) 30 Generates a stride array from an array shape and assigns results to a 31 provided output array. 32 33 Parameters 34 ---------- 35 shape: ArrayLike 36 Array shape. 37 38 order: string 39 Specifies whether an array is row-major (C-style) or column-major 40 (Fortran-style). 41 42 out: Array|TypedArray|Object 43 Output array. 44 45 Returns 46 ------- 47 out: Array|TypedArray|Object 48 Stride array. 49 50 Examples 51 -------- 52 > var d = [ 2, 1, 10 ]; 53 > var out = [ 0, 0, 0 ]; 54 > var s = {{alias}}.assign( d, 'row-major', out ) 55 [ 10, 10, 1 ] 56 > var bool = ( s === out ) 57 true 58 59 See Also 60 -------- 61