TABULATE definitions

<< Click to Display Table of Contents >>

Navigation:  Problem Descriptor Reference > The Sections of a Descriptor > Definitions >

TABULATE definitions

Previous pageReturn to chapter overviewNext page

The TABULATE statement can be used to generate a TABLE internally from arithmetic expressions.  The result is a TABLE identical to one produced externally and read by the TABLE or TABLEDEF statements.

This facility can be used to tabulate parameters that are very expensive to compute, resulting in an improvement in the efficiency of the system solution.

The TABULATE statement has a syntax identical to that of ARRAY and MATRIX definition, with the addition of a possible third table dimension.

name = TABULATE FOR param1 (first1 BY step1 TO final1 ) : expression

 

name = TABULATE FOR param1 (first1 BY step1 TO final1 )

         FOR param2 (first2 BY step2 TO final2 ) : expression

 

name = TABULATE FOR param1 (first1 BY step1 TO final1 )

                 FOR param2 (first2 BY step2 TO final2 )

         FOR param3 (first3 BY step3 TO final3 ) : expression

 

These statements define name to be a TABLE of values generated by evaluating expression at all combinations of the specified parameters. param1, param2 and param3 must be names already defined in the script, and they become the coordinate values of the table.

As with MATRICES and ARRAYS, table points can be stated explicitly

name = TABULATE FOR param1 ( p11 , p12 { , p13 ...} ) : expression

 

The two forms of coordinate definition can be mixed at will, as in

name = TABULATE FOR param1 ( p1 , p2 , p3 BY step TO final , pN ) :  expression

 

The expression can also be an explicit list of values :

name = TABULATE FOR param1 (first1 BY step1 TO final1 ) : LIST (value1, value2, ...)

 

Interpretation of the resulting table can be modified as with the TABLE statement, by prefixing the TABULATE clause by the modifiers SPLINE, BLOCK or SMOOTH.

Examples:

Samples | Usage | Misc | Tabulate.pde