1. Home
  2. VEQUATE procedure

VEQUATE procedure

Equates values across a set of data structures (P.W. Goedhart).

No options

Parameters

OLDSTRUCTURES = pointers Structures whose values are to be transferred – each pointer should contain a set of structures with the same length and type (either scalar, variate, matrix, diagonal matrix, symmetric matrix, table, text or pointer)
NEWSTRUCTURES = pointers Structures to contain the transferred values – each pointer contains a set of either variates, texts or pointers, as relevant to the type of the OLDSTRUCTURES

Description

VEQUATE allows the values in a set of structures to be copied into another set of structures, one for each element of the original structures. The original structures are input in a pointer, using the OLDSTRUCTURES parameter. They must all be of the same type (scalar, variate, matrix, diagonal matrix, symmetric matrix, table, text or pointer), and have the same number of values.

The structures to take the values are returned in a pointer, whose identifier is specified by the NEWSTRUCTURES parameter. The values in the first element of each of the original structures are copied into the first structure in the NEWSTRUCTURES pointer, then those in the second element are copied into the second structure, and so on. If the old structures contain numbers, the new structures will be variates. If they are texts, the new structures will be texts. Finally, if they are pointers, the new structures will be pointers. If NEWSTRUCTURES has already been declared, it should be to a pointer of the correct length. The structures to which it points will be redefined, if necessary, to have the correct length.

Options: none.

Parameters: OLDSTRUCTURES, NEWSTRUCTURES.

Method

EQUATE is used to transfer values. If OLDSTRUCTURES points to restricted variates or texts, the values included in the subset are first copied to dummy structures.

Action with RESTRICT

If the OLDSTRUCTURES pointer consists of variates or texts, any restrictions will be taken into account and, if the NEWSTRUCTURES pointer is not declared in advance, its suffixes will be set to the units in the restricted set.

See also

Directive: EQUATE.

Procedures: APPEND, STACK.

Commands for: Calculations and manipulation.

Example

CAPTION  'VEQUATE example',\ 
         'The first example equates variates.',\ 
         'The second example equates restricted variates.',\ 
         'The third example equates symmetric matrices.';\
         STYLE=meta,3(plain)
VARIATE  [NVALUES=5] oldvari[1...3] ; !(1...5), !(11...15), !(21...25)
VEQUATE  OLDSTRUCTURES=oldvari; NEWSTRUCTURES=newvari
PRINT    oldvari[]; DECIMALS=0
PRINT    newvari[]; DECIMALS=0

RESTRICT oldvari[]; CONDITION=!(1,0,0,1,1)
VEQUATE  OLDSTRUCTURES=oldvari; NEWSTRUCTURES=restvari
PRINT    restvari[]; DECIMALS=0

SYMMETRIC [ROWS=3] oldsymm[1...2]; VALUES=!(1...6),!(101...106)
VEQUATE   oldsymm; !P(first,second,third,fourth,fifth,sixth)
PRINT     [SERIAL=yes] oldsymm[]; DECIMALS=0
PRINT     first,second,third,fourth,fifth,sixth; DECIMALS=0
Updated on March 4, 2019

Was this article helpful?