CNA – Array (vector/matrix) constant

Block SymbolLicensing group: STANDARD
PIC

Function Description
The block CNA allocates memory for nmax elements of the type etype of the vector/matrix referenced by the output vec and initializes all elements to data stored in the parameter acn.

If the string parameter filename is not empty then it loads initalization data from the filename file on the host computer in CSV format. Column separator can be comma or semicolon or space (but the same in the whole file), decimal separator have to be dot, row separator is new line. Empty lines are skipped.

If the parameter TRN = on then the output reference vec contains transposed data.

Note: In case of etype = Large (I64), values loaded from parameter acn are converted to double-precision float due to implementation reasons, so you can loose precision for very large values. If this could be a problem, use external file for initialization which does not have this issue.

Parameters

filename

CSV data file

String

TRN

Transpose loaded matrix

Bool

nmax

Allocated size of output matrix (total number of items)   2  10000000 1.00E+02

Long (I32)

etype

Type of elements  8.00E+00

Long(I32)

1 ....

Bool

2 ....

Byte (U8)

3 ....

Short (I16)

4 ....

Long (I32)

5 ....

Word (U16)

6 ....

DWord (U32)

7 ....

Float (F32)

8 ....

Double (F64)

–- ...

10 ...

Large (I64)

acn

Initial array value  [0 1 2 3]

Double (F64)

Output

vec

Reference to vector/matrix data

Reference

2022 © REX Controls s.r.o., www.rexygen.com