next up previous
Next: 2 Union TypeSpec Up: 1 General Operator TypeSpec Previous: 1 General Operator TypeSpec

1 Struct TypeSpec


<Struct TypeSpec> ::= 
    MP_CommonOperatorPkt(MP_Struct)n<MP TypeSpec>n 

A collection of (possibly heterogeneous) objects to be treated as logically related is described using a MP_Struct. The number of arguments field specifies both the number of actual arguments the operator has in the Prototype tree and the number of data items to be read from the data packet that follows the Prototype tree. The arguments to the struct operator specify the types of the arguments individually using MP TypeSpecs. Figure 4 shows how a sparse matrix can be represented (see also Figures 1 and 2 for comparison). Note that the statically defined representation in Figure 1 required 48 bytes and the prototyped version requires only 76 bytes, but the size of the prototype remains constant.


  
Figure 4: A sparse matrix
\begin{figure}% latex2html id marker 414
\setlength{\tabcolsep}{1.0mm} \centerin...
... \\
& & 4 & & \\
& & 1 & &[2,4]=1\\ \hline\end{tabular}\end{small}\end{figure}


next up previous
Next: 2 Union TypeSpec Up: 1 General Operator TypeSpec Previous: 1 General Operator TypeSpec
| ZCA Home | Reports |