VEC_$ISCATTER16 Domain/OS VEC_$ISCATTER16
NAME
vec_$iscatter16 - translate a 16-bit integer vector into scattered form
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$iscatter16(
short int *start_vec,
long int *indices,
long int &length,
short int *result_vec)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$iscatter16(
in start_vec: univ vec_$integer16_vector;
in indices: univ vec_$integer32_vector;
in length: integer32;
out result_vec: univ vec_$integer16_vector);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
integer*2 start_vec(nvec), result_vec(nvec)
integer*4 indices(nvec), length
call vec_$iscatter16(start_vec, indices, length, result_vec)
DESCRIPTION
Vec_$iscatter16 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_$igather16 is the inverse opera-
tion of vec_$iscatter16.
For instance, if passed the array start_vec containing seven entries [0,
-1, 20, 0, 30, 0, 7], vec_$iscatter16 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_$iscatter16 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.
Vec_$iscatter16, like all 16-bit integer routines, performs poorly when
compared to the 32-bit integer routines. Its use should be avoided wher-
ever possible, especially on high-performance workstations.
SEE ALSO
vec_$gather, vec_$scatter, vec_$dscatter, vec_$iscatter.