NAME

virtual_for_op -- unit to iterate operands

PROTOTYPE

unitptr virtual_for_op( int nu, int no, int ni, char *pcFmt, unitptr uHost)

ARGUMENTS

int nu
ABS(nu)= number of inner successor units to iterate.
int no
ABS(nu)= number of outer successor units to iterate.
int ni
number of iterations
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[1]
index limit. The virtual_for_op will iterate its operands for integer index values 0=< i < X_in[0].
out_0[1]
current iteration index; operands are iterated for all integer index values out_0[k] between 0 and X_in[0]-1, inclusive.

DESCRIPTION:

This unit is analogous to the for_op unit, but in addition to acting on its nu successor operand units it also acts on the no successors of its enclosing container unit. This is done iteration-wise, i.e., at each iteration first the nu `inner'' successors are executed once, then the no outer successors are executed once. Therefore, embedding a virtual_for_op into a container unit makes the container unit into a for_op - like iterator.

EXECUTION:

An exec call to the virtual_for_op unit will have the effect to execute at each iteration step its no successors (``inner operands''), followed by executing the nu successors of its container unit (``outer operands''). One such iteration step will be made for all integer index tuples in the range given by 0..X_in[0] (with the latter limit excluded). The current index count may be passed at each iteration to the outer operands via a pin in the enclosing container. All options are fully analogous to the for_op unit and are described there. If a break_unit is among the operands, execution will execute the remaining successors that follow after the virtual_for_op unit, then execution will jump to the next outer level (leaving the container) and continue with the first non-operand (i.e., the operands following the container are skipped).

FILE

/homes/jontrup/nst5/man/../o.sol2//../nstsrc/nst_stdr.c