DADiSP Worksheet Functions > Function Categories > Statistics and Calculus > ROWREDUCE
Applies the REDUCE function to each row of a table.
ROWREDUCE(a, "op", opcode)
a |
- |
A series with one or more rows. |
"op" |
- |
Optional. A string, the binary operator name. |
opcode |
- |
Optional. An integer, the binary operator function code. |
Table with one column and as many rows as the input table.
W1: {{1, 2},
{2, 3},
{3, 4}}
W2: rowreduce(W1, "*")
W2 == {2,
6,
12}
W3: rowreduce(W1, 3)
W3 == {2,
6,
12}
Binary operators include the arithmetic and logical operators. The logical "Exclusive OR" operator is represented by the string "XOR".
The function also accepts an explicit function code instead of an operator string. Either an operator string or function code must be supplied.
The following function codes are supported:
Code |
Operator |
Function |
Description |
1 |
+ |
ADD |
add |
2 |
- |
SUB |
subtract |
3 |
* |
MULT |
multiply |
4 |
/ |
DIV |
divide |
5 |
^ |
POW |
raise to power |
6 |
> |
GREATER |
greater than |
7 |
< |
LESS |
less than |
8 |
>= |
GREATEREQ |
greater or equal to |
9 |
<= |
LESSEREQ |
less or equal to |
10 |
== |
EQUAL |
equal to |
11 |
!= |
NOTEQUAL |
not equal to |
12 |
&& |
AND |
logical and |
13 |
|| |
OR |
logical or |
14 |
XOR |
XOR |
logical exclusive or |
15 |
FLIPFLOP |
FLIPFLOP |
dual pad flipflop |
16 |
ATAN2 |
ATAN2 |
inverse tangent |
17 |
& |
BITAND |
bit and |
18 |
<< |
BITLSHIFT |
bit left shift |
19 |
>> |
BITRSHIFT |
bit right shift |
20 |
|+ |
BITOR |
bit or |
21 |
% |
MOD |
modulo |
22 |
|^ |
BITXOR |
bit exclusive or |
23 |
~ |
BITCOMP |
bit complement |
24 |
MAKECART |
MAKECART |
convert to Cartesian form |
25 |
MAKEPOLAR |
MAKEPOLAR |
convert to polar form |
26 |
MAX |
MAX |
maximum |
27 |
MIN |
MIN |
minimum |
&& || ! AND OR NOT XOR (Logical Operators)