VEC_$DZERO_I Domain/OS VEC_$DZERO_I
NAME
vec_$dzero_i - zero a vector in a double-precision matrix
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$dzero_i(
double *vector,
long int &inc,
long int &length)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$dzero_i(
var vector: univ vec_$double_vector;
in inc: integer32;
in length: integer32)
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
double precision vector(nvec)
integer*4 length, inc
call vec_$dzero_i(vector, inc, length)
DESCRIPTION
Vec_$dzero_i zeros the length elements of the double-precision array vec-
tor selected by inc.
Through appropriate choice of inc, a program can use vec_$dzero_i to zero
a vector within a matrix. To search the Mth vector in a matrix, choose
inc equal to the number of vectors in the matrix, and place the Mth ele-
ment of the matrix array at the beginning of vector.
In C, the resulting operation is
j = 0;
for (i = 0; i < length; ++i) {
vector[i] = 0.0;
j += inc;
}
In Pascal, the resulting operation is
j := 1;
for i := 1 to length do
begin
vector[i] := 0.0;
j := j + inc;
end
In FORTRAN, the resulting operation is
j = 1
do 10 i = 1, length
vec(j) = 0.0
j = j + inc
10 continue
vector
The vector to be zeroed.
inc An increment for the index of vector that chooses the elements to be
zeroed.
length
The number of elements in vector to zero.
NOTES
In C and Pascal, vec_$dzero_i zeros a column vector; whereas in FORTRAN,
it zeros a row vector.
SEE ALSO
vec_$dzero, vec_$izero16_i, vec_$izero_i, vec_$zero_i.