next up previous contents
Next: Parameters Up: Reduction Operations Previous: High-level Reduction Operations   Contents

Weighted Reduction Operations

It is often convenient to assign a weight $w_i$ to each value $a_i$. In this case, the basic reduction operations are redefined as follows.
count:
The number of values

\begin{displaymath}\mathrm{count} := \sum_i w_i \end{displaymath}

sum:
The sum of the values

\begin{displaymath}\mathrm{sum} := \sum_i w_i a_i \end{displaymath}

product:
The product of the values

\begin{displaymath}\mathrm{product} := \exp \sum_i w_i \log a_i \end{displaymath}

sum2:
The sum of the squares of the values

\begin{displaymath}\mathrm{sum2} := \sum_i w_i a_i^2 \end{displaymath}

sumabs:
The sum of the absolute values

\begin{displaymath}\mathrm{sum2} := \sum_i w_i \vert a_i\vert \end{displaymath}

sumabs2:
The sum of the squares of the absolute values

\begin{displaymath}\mathrm{sumabs2} := \sum_i w_i \vert a_i\vert^2 \end{displaymath}

min:
The minimum of the values

\begin{displaymath}\mathrm{min} := \min_i w_i \ne 0: a_i \end{displaymath}

max:
The maximum of the values

\begin{displaymath}\mathrm{max} := \max_i w_i \ne 0: a_i \end{displaymath}

maxabs:
The maximum of the absolute values

\begin{displaymath}\mathrm{maxabs} := \max_i w_i \ne 0: \vert a_i\vert \end{displaymath}

The notation $\min_i w_i \ne 0: a_i$ means: ``The minimum of $a_i$ where $i$ runs over all values where $w_i \ne 0$''. The definition of the high-level reduction operations does not change when weights are present.


next up previous contents
Next: Parameters Up: Reduction Operations Previous: High-level Reduction Operations   Contents