next up previous contents
Next: Effect and Restrictions Up: The Java Adlib API Previous: Effect and Restrictions   Contents


Maxval

A maxval() method is a reduction operation for finding the largest elements of a distributed array. It has two prototypes

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ $$t$\verb$ maxval ($$t$\verb$  ...

and

$\displaystyle \begin{minipage}[t]{\linewidth}\small\begin{tabbing}
\verb$ $$t$...
...$ maxval ($$t$\verb$  ...

where the variable $ t$ runs over all primitive types other than boolean, and the notation $ t$ # means a multiarray of arbitrary rank, with elements of type $ t$. The second form takes an extra boolean array aligned with the source array and ignores all elements of source for which the corresponding element of mask is false. The maxval method is implemented by a schedule object with HPspmd class Maxval$ t$. Each primitive types other than boolean has its own schedule class. This class has two constructors with arguments identical to the method above, and has one public method with no arguments called execute(), which executes the schedule. The effective public interface of the Maxval$ t$ class is

$\displaystyle \begin{minipage}[t]{\linewidth}\small\verb$ public class Maxval$$...
...$$T$\verb$ execute () { ... }$\\
\verb$ . . .$\\
\verb$ }$
\end{minipage}
$

The source array is source. It will have elements of type $ T$. The mask array is mask.

Subsections

Bryan Carpenter 2004-06-09