VEC_$ISUM16 Domain/OS VEC_$ISUM16
NAME
vec_$isum16 - sum the elements of a 16-bit integer vector
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
short vec_$isum16(
short *vec,
long int &length)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
function vec_$isum16(
in vec: univ vec_$integer16_vector;
in length: integer32): integer16;
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
integer*2 vec(nvec), sum
integer*4 length
sum = vec_$isum16(vec, length)
DESCRIPTION
Vec_$isum16 adds together length elements of the 16-bit integer array
vector and returns the sum.
In C, the resulting operation is
return_value = 0;
for (i = 0; i < length; ++i)
return_value += vec[i];
In Pascal, the resulting operation is
return_value := 0;
for i := 1 to length do
return_value := return_value + vec[i];
In FORTRAN, the resulting operation is
vec_$isum16 = 0
do 10 i = 1, length
vec_$isum16 = vec_$isum16 + vec(i)
10 continue
vec The vector to sum.
length
The number of elements in vec to sum.
NOTES
When vec_$isum16 is used to operate on matrixes in C and Pascal, vec is a
row vector; whereas in FORTRAN, it is a column vector.
SEE ALSO
vec_$dsum, vec_$isum, vec_$isum16_i, vec_$sum.