NAME

multi_for_op -- nested for_op to iterate operands

PROTOTYPE

unitptr multi_for_op( int nu, int nn, int *piMaxIndex, float *pfMin, float *pfMax, char *pcFmt, unitptr uHost)

ARGUMENTS

int nu
ABS(nu)=number of successor units to iterate.
int nn
number of nested for-levels. Level 0 is outermost
int *piMaxIndex
index limits for levels 0..nn-1. Initializes input field 0
float *pfMin
for convenience, the multi-for-loop maps its nn- dimensional iteration index `volume'' onto a nn-dimensional scaled range with lower limits pfMin and upper limits pfMax. The lower limit vector pfMin initializes input field 1
float *pfMax
upper limits of scaled iteration volume. initializes input field 2.
char *pcFmt
option string (see below)
unitptr uHost
host unit

RETURN VALUE:

A pointer to the created unit or NULL in the case of an error.

INTERFACE OF CREATED UNIT:

X_in[nn]
index limits. The i -th for-loop will iterate for integer index values 0=< i < X_in[i].
Y_in[nn]
lower limits of scaled iteration range. The continuous iteration index offered at out_1 will have the values in Y_in as its lower limits.
Z_in[nn]
upper limits of scaled iteration range. The continuous iteration index offered at out_1 will have the values in Z_in as its upper limits.
out_0[nn]
current iteration index; operands are iterated for all integer index values out_0[k] between X_in[k] and Y_in[k]-1, inclusive. After completion, out_0[k]=Y_in[k] for all k.
out_1[nn]
current scaled iteration index. out_1[k] ranges between Y_in[k] and Z_in[k]. The upper limit Z_in[k] will be assumed whenever the associated integer index is at its maximum value X_in[k]-1.

DESCRIPTION:

This unit is provided to perform repeated iterations of its nu successor units in the exec-queue. These will become operands of the multi_for_op unit.

EXECUTION:

An exec call to the multi_for_op unit will have the effect to iterate its nu successors over all integer index tuples in the range given by X_in[] and Y_in[] (with the latter limits excluded). Changes to the input fields of this unit are only noticed before or after the iterations are executed (i.e., changes to the input fields effected by the iterated operands take only effect after the last iteration has been completed). By specifying the %a option (``exec+adapt'' in NEO), the for-iterations will include adaptation steps according to the pattern

   for (i=0; i<steps; i++) {
       exec_unit(Operand_1) ... exec_unit(Operand_nu);
       adapt_unit(Operand_nu) ... adapt_unit(Operand_1);
   }

In this case, no further adaptation calls to the operands will be made during the adapt_unit() call for the multi_for_op.

ADAPTATION:

At present, the only implemented adaptation mode is the exec+adapt-mode described in the previous section.

SEE ALSO:

for_op, iterator

FILE

/local/homes/rhaschke/nst7/man/../o.linx86//../nstsrc/nst_misc.c