NAME
split_multi -- generalized split of data vector
PROTOTYPE
unitptr split_multi( int iNum, int iRec, int *piDim, unitptr uHost)
ARGUMENTS
- int iNum
- nr of data sets resulting from split
- int iRec
- nr of records in each split data set
- int *piDim
- iNum elements: the record size (=nr of floats) for each split data set
- 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 of dimension ABS(iRec*SumOfAll piDim[k])
- CTL_in:
- control field (a value of 0 switches the unit off)
- out_0:
- output field 0 for first data subvector (dimension ABS(iRec)*piDim[0])
- ...
- out_iNum-1:
- output field iNum-1 for last data subvector (dimension ABS(iRec)*piDim[0
DESCRIPTION:
Performs a generalized split operation for the data in
input field 0. The input vector is split into iNum smaller
data vectors, each of which consists of iRec portions ("records")
of the original input vector. The length of the portions for
is the same for each output vector k and is given by
piDim[k] (k=0,1,..iRec-1).
The splitting operation is such that it is the inverse of the
merge_multi operation. That is, the k-th output vector is
the concatenation of iRec portions, each of piDim[k] elements,
starting at elements iOffset[k]+j*DimInput/iNum, where
iOffset[]=piDim[0]+piDim[1]..+piDim[k-1], j=0..iRec-1.
EXAMPLE:
For iNum=3, iRec=n and piDim[]=2,1,3, the split_multi unit
has a 6n dimensional input that is partitioned into
three output vectors A, B and C of dimensions 2,1 and 3
according to the following scheme:
A11 A12 B11 C11 C12 C13 A21 A22 B21 C21 C22 C23 ...
...
An1 An1 Bn1 Cn1 Cn2 Cn3
(letters Aij, Bij, Cij
denote the j-th element of record i in each output vector):
SEE ALSO:
merge_multi, merger, splitter
FILE
/local/homes/rhaschke/nst7/man/../o.linx86//../nstsrc/nst_misc.c