NAME
merge_multi -- generalized merge for data vectors
PROTOTYPE
unitptr merge_multi( int iNum, int iRec, int *piDim, unitptr uHost)
ARGUMENTS
- int iNum
- nr of data vectors to merge
- int iRec
- nr of data records in each vector
- int *piDim
- iNum elements: the record size (=nr of float els) within each data vector
- unitptr uHost
- host unit
RETURN VALUE:
A pointer to the created unit or NULL in the case of an error.
INTERFACE OF CREATED UNIT:
- in_0:
- input field 0 for first data vector (dimension ABS(iRec)*piDim[0])
- ...
- in_iNum-1:
- input field iNum-1 for last data vector (dimension ABS(iRec)*piDim[0])
- CTL_in:
- control field (a value of 0 switches the unit off)
- out_0
- output field of dimension iNum*ABS(iRec*piDim[k]), holding the
merged data
DESCRIPTION:
Performs a generalized merge operation for the data in
iNum data vectors. Each data vector is considered as
the concatenation of iRec shorter records. The number iRec
of these shorter records must be the same for each vector,
but their length can be different for each vector and is specified
in piDim[k] for the k-th (k=0,1,2..iNum-1) vector (within
each vector k, all records must be of the same length piDim[k]).
The merge_multi unit merges these records into a single large vector
by first concatenating all records at the initial position in
each vector, then concatenating all records at the next position
in each vector and so on, until all records at the last position
of each vector. If iRec=1, i.e., each vector consists of a
single record only, this reduces to the simpler merge operation
of the merger unit.
The split_multi unit performs the inverse operation.
EXAMPLE:
For iNum=3 data vectors A, B and C of dimensions 2,1 and 3
and iRec=n records in each data set,
the output vector will be (letters Aij, Bij, Cij
denote the j-th element of record i in each dataset):
A11 A12 B11 C11 C12 C13 A21 A22 B21 C21 C22 C23 ...
...
An1 An1 Bn1 Cn1 Cn2 Cn3
SEE ALSO:
split_multi, merger, splitter
FILE
/amnt/loge/users/nistaff02/nistaff/rhaschke/nst7/man/../o.linux//../nstsrc/nst_misc.c