El
Scan Operator (\)
The symbol for the scan operator is \. The forms of scan are:@\[Il B,@\B or
@+B, where@can be any scalar dyadic primitive function and argument B is a
numeric vector or other array. The scan operator, like the reduction operator,
operates on the elements of a single vector, and is the same as putting the primitive
dyadic function between each of the elements. But the scan operator accumulates
the results as the operation is repeated along the vector. The shape of the result is
the same as that of the input argument:
+\ 1. 2 J I+ 5
+ 1.
+ 1. +* 2
4. 1. .t 24.3
.e 1. +2+3+4
.t.3.+.~.t.3+l.~.t.~~;
1. 3 rs 1.0 3.54 This result is the same
I.
3
6
1. 0
15
as doing the following for
each element in the result.
When argument B is a multidimensional array, the [I] index entry is used to specify
the coordinate the scan is to proceed along. If the index entry is omitted, the last
coordinate (columns) is acted on. If the@ +B form is'used, the first coordinate
is acted on.
Bt-3 4p I 12
B
1. 2 3 I+
5 b '7 8
9 10 11. 12
23b
8 1.0 3.2
1.8 21. 24.
.+\I: 1.JH- The first coordinate (rows) is specified; therefore,
the scan is between rows.
4 The second coordinate (columns) is specified;
therefore, the scan is between columns.
3 3. 1. 3. 8 20
9 19 30 b2
*+a \ B
1. 3 6 10
!3 1 :I. 1.8 26
9 19 30 42
4tB
1234
6 83.03.2
15 1.8 21 24.
118
1.3 1.4 1.5 :I. 6
I. "7 1.8 1. P 2 0
2 I. 22 23 24.
a+.\ c: 1. 1 A
- The first coordinate (planes) is specified;
1. 2 3 4 therefore, the scan operation is between planes.
3 6 7 8
B
1. 0 1. :I. 1.2
1.4. 1. b 1. 8 2 0
22 24 26 2t3
J0 32 34. 36
+ \ I:: 2 ::1 R
-
The second coordinate (rows) is specified;
1. 2 J 4. therefore, the scan operation is between rows
h I3 1. 0 I. 2 for each plane.
1.2; 1.8 2 1. 211.
1. 3 :I. 14. :I. 5 1. b
3 0 32 34. 36
51. 54. 5'7 60
+\ I:: 3 7 A
- The third coordinate (columns) is specified;
1. 3 b I. 0 therefore, the scan operation is between columns
5 1. 1. 1. 8 2 h for each plane.
9 1.P 30 1.1.2
1.3 27 '4.2 50
:I. 7 35 54 74
21. 43 66 YO
119
Previous Page Next Page