VEC_$DGATHER Domain/OS VEC_$DGATHER
NAME
vec_$dgather - translate a double-precision vector out of scattered form
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$dgather(
double *start_vec,
long int *indices,
long int &length,
double *result_vec)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$dgather(
in start_vec: univ vec_$double_vector;
in indices: univ vec_$integer32_vector;
in length: integer32;
out result_vec: univ vec_$double_vector);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
real*8 start_vec(nvec), result_vec(nvec)
integer*4 indices(nvec), length
call vec_$dgather(start_vec, indices, length, result_vec)
DESCRIPTION
Vec_$dgather translates its input arrays from dense form (two arrays,
one containing data, the other containing the corresponding index) into
one sparse output vector. Vec_$dgather is the inverse operation of
vec_$dscatter.
For instance, if passed the arrays start_vec [1, 20, -1, 5] and indices
[4, 5, 2, 7], the first seven entries in the output vector produced by
vec_$dgather would be [0, -1, 0, 1, 20, 0, 5].
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 start_vec[whatever was
declared as the starting entry] in Pascal.
start_vec
The dense array.
indices
The array of indices for start_vec.
length
The number of elements to be operated on; normally the same as the
number of elements in the vectors.
result_vec
The sparse array created by ordering start_vec as indicated by
indices.
NOTES
When vec_$dgather 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_$scatter, vec_$gather, vec_$igather, vec_$igather16.