VEC_$ISCATTER Domain/OS VEC_$ISCATTER
NAME
vec_$iscatter - translate a 32-bit integer vector into scattered form
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$iscatter(
long int *start_vec,
long int *indices,
long int &length,
long int *result_vec)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$iscatter(
in start_vec: univ vec_$integer32_vector;
in indices: univ vec_$integer32_vector;
in length: integer32;
out result_vec: univ vec_$integer32_vector);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
integer*4 start_vec(nvec), result_vec(nvec)
integer*4 indices(nvec), length
call vec_$iscatter(start_vec, indices, length, result_vec)
DESCRIPTION
Vec_$iscatter translates its input arrays from sparse form (all entries
are consecutively numbered, and entries of zero may be present) into
dense form (two arrays, one containing non-zero data, the other contain-
ing the corresponding array index). Vec_$igather is the inverse operation
of vec_$iscatter.
For instance, if passed the array start_vec containing seven entries [0,
-1, 20, 0, 30, 0, 7], vec_$iscatter would produce an indices array con-
taining [2, 3, 5, 7] and a result_vec containing [-1, 20, 30, 7].
The index array contains 32-bit integers. The individual entries are
calculated relative to an array beginning of 1. That is, an entry of 1
in indices denotes the first element in the array, which is referred to
as start_vec[0] in C, start_vec(1) in FORTRAN, and as start_vec[whatever
was declared as the starting entry] in Pascal.
start_vec
The sparse array.
indices
The array of indices into result_vec.
length
The number of elements to be operated on; normally the same as the
number of elements in the vectors.
result_vec
The scattered array corresponding to start_vec.
NOTES
When vec_$iscatter is used to operate on matrixes in C and Pascal,
start_vec and result_vec are row vectors; in FORTRAN, they are column
vectors.
As in all the vec_$ calls, the result array must not overlap any of the
input arrays; the result array may be identical to an input, but must not
contain any subset of it. Because of pipelining, using overlapping
input and output arrays may cause incorrect results.
SEE ALSO
vec_$gather, vec_$scatter, vec_$dscatter, vec_$iscatter16.