VEC_$ZERO_I Domain/OS VEC_$ZERO_I
NAME
vec_$zero_i - zero a vector in a single-precision matrix
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
void vec_$zero_i(
float *vector,
long int &inc,
long int &length)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
procedure vec_$zero_i(
var vector: univ vec_$real_vector;
in inc: integer32;
in length: integer32);
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
real vector(nvec)
integer*4 length, inc
call vec_$zero_i(vector, inc, length)
DESCRIPTION
Vec_$zero_i zeros the length elements of the single-precision array vec-
tor selected by inc.
Through appropriate choice of inc, a program can use vec_$zero_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_$zero_i zeros column vectors; whereas in FORTRAN, it
zeros row vectors.
SEE ALSO
vec_$dzero_i, vec_$izero16_i, vec_$izero_i, vec_$zero.