repl.txt (2501B)
1 2 {{alias}}( arrays, shape, strides, fcn ) 3 Applies a nullary callback and assigns results to elements in a strided 4 output array. 5 6 The `shape` and `strides` parameters determine which elements in the strided 7 output array are accessed at runtime. 8 9 Indexing is relative to the first index. To introduce an offset, use typed 10 array views. 11 12 Parameters 13 ---------- 14 arrays: ArrayLikeObject<ArrayLikeObject> 15 Array-like object containing one strided output array. 16 17 shape: ArrayLikeObject<integer> 18 Array-like object containing a single element, the number of indexed 19 elements. 20 21 strides: ArrayLikeObject<integer> 22 Array-like object containing the stride length for the strided output 23 array. 24 25 fcn: Function 26 Nullary callback. 27 28 Examples 29 -------- 30 > var x = new {{alias:@stdlib/array/float64}}( [ -1.0, -2.0, -3.0, -4.0 ] ); 31 > var shape = [ x.length ]; 32 > var strides = [ 1, 1 ]; 33 > var fcn = {{alias:@stdlib/utils/constant-function}}( 3.0 ); 34 > {{alias}}( [ x ], shape, strides, fcn ); 35 > x 36 <Float64Array>[ 3.0, 3.0, 3.0, 3.0 ] 37 38 39 {{alias}}.ndarray( arrays, shape, strides, offsets, fcn ) 40 Applies a nullary callback and assigns results to elements in a strided 41 output array using alternative indexing semantics. 42 43 While typed array views mandate a view offset based on the underlying 44 buffer, the `offsets` parameter supports indexing semantics based on 45 starting indices. 46 47 Parameters 48 ---------- 49 arrays: ArrayLikeObject<ArrayLikeObject> 50 Array-like object containing one strided output array. 51 52 shape: ArrayLikeObject<integer> 53 Array-like object containing a single element, the number of indexed 54 elements. 55 56 strides: ArrayLikeObject<integer> 57 Array-like object containing the stride length for the strided output 58 array. 59 60 offsets: ArrayLikeObject<integer> 61 Array-like object containing the starting index (i.e., index offset) for 62 the strided output array. 63 64 fcn: Function 65 Nullary callback. 66 67 Examples 68 -------- 69 > var x = new {{alias:@stdlib/array/float64}}( [ -1.0, -2.0, -3.0, -4.0 ] ); 70 > var shape = [ x.length ]; 71 > var strides = [ 1 ]; 72 > var offsets = [ 0 ]; 73 > var fcn = {{alias:@stdlib/utils/constant-function}}( 3.0 ); 74 > {{alias}}.ndarray( [ x ], shape, strides, offsets, fcn ); 75 > x 76 <Float64Array>[ 3.0, 3.0, 3.0, 3.0 ] 77 78 See Also 79 -------- 80