# Arrays: Vectors and Matrices

### HicEst knows 1- or 2-dimensional rectangular arrays as vectors (1 row, n columns) or m x n matrices. Higher order array can be realized with ALIAS.

use for example and result
REAL declaration
• REAL :: n=3, X(n), A(n,n)
DIMENSION declaration
• Y(3), B(3,3)
DATA initialization
• DATA X/1.1, -9, 1.234E6/
APPENDIX uncompiled data storage at end of script
ALLOCATE resize
= set an array
A = 12.3
 12.3 12.3 12.312.3 12.3 12.312.3 12.3 12.3
>< SWAP array(-elements)
• A >< B
( ) array element
• Y(m) = B(m, n)
unary OP apply OP to all elements
binary OP works element-wise, like Scalars
• X = 1.23 * Y
\$C column index of a left-hand side matrix
A = \$C
 1 2 31 2 31 2 3
\$R row index of a left-hand side matrix
A = \$R
 1 1 12 2 23 3 3
\$ linear index of left-hand side matrix
A = \$
 1 2 34 5 67 8 9
\$1 inlineLoop index
 trace = +(A( \$1 , \$1)) 15
ALIAS named sub-vector
 ALIAS(A,2, vec,3) 2 3 4
named sub-matrix
 ALIAS(A,2, mtx,-2,-3) 2 3 45 6 7
InlineLoop set or reduce arrays or sub-arrays in 1 line
 trace_max = MAX( A( \$1, \$1) ) 9
LEN_TRIM(A) trimmed (linear) length
 L = LEN_TRIM(A) 9
TRIM(A) (linear) length
 L = LEN(A) 9

Support HicEst   ⇾ Impressum