UNPKG

@stdlib/array

Version:
35 lines (27 loc) 1.02 kB
{{alias}}( arrays, shape, fcn ) Applies a quaternary callback to elements in four five-dimensional nested input arrays and assigns results to elements in a five-dimensional nested output array. Parameters ---------- arrays: ArrayLikeObject Array-like object containing four input nested arrays and one output nested array. shape: Array<integer> Array shape. fcn: Function Quaternary callback. Examples -------- > function fcn( x, y, z, w ) { return x + y + z + w; }; > var x = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; > var y = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; > var z = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; > var w = [ [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ] ]; > var out = [ [ [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ] ] ]; > var shape = [ 1, 1, 1, 2, 2 ]; > {{alias}}( [ x, y, z, w, out ], shape, fcn ); > out [ [ [ [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ] ] ] ] See Also --------