next up previous contents index
Next: Translating overall constructs Up: Basic translation Previous: Translating on constructs   Contents   Index


Translating at constructs

A translation for the at construct is given in Figure A.18. Note that pre-translation will have reduced $x$ to a simple expression.

The coordinate and local subscript associated with the specified location is returned by the method, location(), which is a member of the Range class. It takes one argument, the global subscript, and returns an object of class Location (see Figure A.59)

The global index for the index $i$ is the value of $\mbox{\it glb}$. This value is used in evaluating the global index expression $i\verb$\lq $$.

The local subscript for the index $i$ is the value of $\mbox{\it sub}$. This value is used in computation of offsets generated when $i$ is used as an array subscript.

The shift step for the index $i$ is the value of $\mbox{\it shf}$. This value is used in computation of offsets associated with shifted index subscripts.

The dimension for the index $i$ is the value of $\mbox{\it dim}$. One possible later use of this value is in computation the distribution group of a section subscripted with $i$.

If the process dimension dim is not an active dimension of apg at the time the method restrict() is invoked, it will throw a DimensionNotInGroupException.

[Variables like $\mbox{\it glb}$, $\mbox{\it sub}$, etc, should be final, so that they can be accessed in local classes defined inside the at construct? Unclear whether distributed indices should be useable inside such classes, but no immediately obvious reason to forbid it.]

Figure A.19: Translation of overall construct.
SOURCE:

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$overall...
...mbox{\small stp}}$\verb$) $$S$ \\
\end{tabbing}\end{minipage}\end{displaymath}

TRANSLATION:


\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$Block $...
...ert{p}\right.\right]$ \\
\verb$}$
\end{tabbing}\end{minipage}\end{displaymath}

where:

\begin{displaymath}
\begin{array}{l}
\mbox{$i$ is an index name in the source p...
... $\mbox{\it glb}$ are names of new variables.} \\
\end{array}\end{displaymath}


next up previous contents index
Next: Translating overall constructs Up: Basic translation Previous: Translating on constructs   Contents   Index
Bryan Carpenter 2003-04-15