RATS 11
RATS 11

<Root level>

Data Types

Home Page

← Previous Next →

There are two classes of variable types: Basic and Aggregate. Basic variables hold a single object (a single integer, one equation). Aggregate variables hold several pieces of information (for instance, a rectangular array of integers, a data series of real numbers).

Basic types

INTEGER, REAL, COMPLEX, LABEL, STRING, EQUATION, MODEL, PARMSET, and REPORT.

Aggregate types

VECTOR (one-dimensional array), SYMMETRIC (symmetric 2-dimensional array), RECTANGULAR (general 2-dimensional), SERIES, PACKED (lower triangular square array, zeros above diagonal), FRML (a formula of the entry number), HASH (a one-dimensional array index by strings) and LIST (a one-dimensional adjustable array). SYMMETRIC and PACKED both use the "packing" process for saving the information.

 

You can abbreviate type names to 3 or more characters. By default, aggregate variables are aggregates of REALs, but you can define aggregates of any of the other basic types. For example:

 

declare vector[integer] a(10)

 

 

You can also create compound variables, which are aggregates of other aggregates. For example, you can define an array of arrays, or an array of series:

 

declare rectangular[series] datamat(10,10)

declare vector[rectangular[integer]] threedimensional

 

Matrix Packing

The SYMMETRIC and PACKED aggregate types only save the lower triangle (diagonal and below), saved in the following order:

\end{equation} \begin{array}{*{20}c} 1 & {} & {} \\ 2 & 3 & {} \\ 4 & 5 & 6 \\ \ldots & {} & {} \\ \end{array} \notag \end{equation}

Ordinarily, you don't need to know how the information is stored (you reference their information using the row and column positions), but it does matter if you need to input a matrix using INPUT or READ, or if you need to do some complex manipulations with it. The functions %SYMMCOL, %SYMMROW and %SYMMPOS can be used to map between the the position in the "vectorized" version and the corresponding rows and columns.

 


Copyright © 2025 Thomas A. Doan