-
-
Notifications
You must be signed in to change notification settings - Fork 804
/
Copy pathrepl.txt
46 lines (39 loc) · 1.31 KB
/
repl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{{alias}}( arrays, shape, fcn )
Applies a binary callback to elements in two three-dimensional nested input
arrays according to elements in a three-dimensional nested mask array and
assigns results to elements in a three-dimensional nested output array.
An element in an input array is "masked" if the corresponding element in the
mask array is non-zero.
Parameters
----------
arrays: ArrayLikeObject
Array-like object containing two input nested arrays, an input nested
mask array, and one output nested array.
shape: Array<integer>
Array shape.
fcn: Function
Binary callback.
Examples
--------
> var x = [
... [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ],
... [ [ 5.0, 6.0 ], [ 7.0, 8.0 ] ]
... ];
> var y = [
... [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ],
... [ [ 5.0, 6.0 ], [ 7.0, 8.0 ] ]
... ];
> var m = [
... [ [ 0, 1 ], [ 0, 0 ] ],
... [ [ 1, 0 ], [ 0, 1 ] ]
... ];
> var z = [
... [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ],
... [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
... ];
> var shape = [ 2, 2, 2 ];
> {{alias}}( [ x, y, m, z ], shape, {{alias:@stdlib/number/float64/base/add}} );
> z
[ [ [ 2.0, 0.0 ], [ 6.0, 8.0 ] ], [ [ 0.0, 12.0 ], [ 14.0, 0.0 ] ] ]
See Also
--------