Data structures

Data structures store the information on which a Genstat program operates. Structures can be defined, or declared, by a Genstat statement known as a declaration. The directive for declaring each type of structure has the same name as given to that type of structure, for example SCALAR to declare a scalar (or single-valued numerical structure), and so on. These are the directives, with details of their corresponding data structures:

    SCALAR single number
    VARIATE series of numbers
    TEXT series of character strings (or lines of text)
    FACTOR series of group allocations (using a pre-defined set of numbers or strings to indicate the groups)
    MATRIX rectangular matrix
    SYMMETRICMATRIX symmetric matrix
    DIAGONALMATRIX diagonal matrix
    TABLE table (to store tabular summaries like means, totals etc)
    DUMMY single identifier
    POINTER series of identifiers (e.g. to represent a set of structures)
    EXPRESSION arithmetic expression
    FORMULA model formula (to be fitted in a statistical analysis)
    LRV latent roots and vectors
    SSPM sums of squares and products with associated information such as means
    TREE tree (as used to represent classification trees, identification keys and regression trees)
    TSM model for Box-Jenkins modelling of time series

You can rename a data structure, or create a new one with attributes the same as those of an existing structure.

    RENAME renames a data structure, to give it a new identifier
    DUPLICATE forms new data structures with attributes taken from an existing structure
    PDUPLICATE duplicates a pointer, with all its components
    SETNAME sets the identifier of a data structure to be one specified in a text

You can also define data structures whose contents are customized for particular tasks.

    STRUCTURE defines a customized data structure
    DECLARE declares one or more customized data structures

There are commands to access and display the attributes of data structures, and to work out the best formats for printing their values.

    DUMP prints attributes of data structures and other internal information
    DECIMALS sets the number of decimals for a structure, using its round-off
    GETATTRIBUTE accesses attributes of data structures
    LIST lists details of the data structures that currently exist in your program
    MINFIELDWIDTH calculates minimum field widths for printing data structures
Updated on March 6, 2019

Was this article helpful?