VEC_$IAMAX16_I Domain/OS VEC_$IAMAX16_I
NAME
vec_$iamax16_i - find the maximum absolute value in a 16-bit integer vec-
tor
SYNOPSIS (C)
#include <apollo/base.h>
#include <apollo/vec.h>
long int vec_$iamax16_i(
short int *start_vec,
long int &start_inc,
long int &length,
short int *result)
SYNOPSIS (Pascal)
%include '/sys/ins/base.ins.pas';
%include '/sys/ins/vec.ins.pas';
function vec_$iamax16_i(
in start_vec: univ vec_$integer16_vector;
in start_inc: integer32;
in length: integer32;
out result: integer16): integer32;
SYNOPSIS (FORTRAN)
%include '/sys/ins/base.ins.ftn'
%include '/sys/ins/vec.ins.ftn'
parameter (nvec = 10)
integer*2 start_vec(nvec), result
integer*4 length, location
integer*4 start_inc
location = vec_$iamax16_i(start_vec, start_inc, length, result)
DESCRIPTION
Vec_$iamax16_i searches through length elements of start_vec, places the
greatest absolute-valued element in result, and returns the location of
the element with the greatest absolute value. By contrast, vec_$irmax16_i
finds the element with greatest signed value. (The procedure
vec_$imax16_i is obsolete and should not be used.) Vec_$iamax16_i
differs from vec_$amax_i in that the argument vector contains 16-bit
integers. In the case of a tie, vec_$iamax16_i returns the index of the
first maximum value found.
This call, like all vec_$ calls ending in _i, takes a set of extra stride
arguments, one for every vector argument. The stride arguments determine
which elements in the array are actually processed. For instance, if the
stride for a particular array is set to 3, every third element in the
array will be processed by the routine. The stride arguments need not be
identical. If all stride arguments are set to 1, this call behaves
exactly like the version without the _i in its name.
If the argument start_inc is not set to 1, the returned index is relative
to the stride; it does not necessarily correspond to the actual vector
index. For example, if start_inc is set to 5, and the third element
examined is the largest, this routine will return 3, even though the
actual index of the largest element is 11.
start_vec
The vector to be searched.
start_inc
The stride for start_vec.
length
The number of elements to be operated on; normally the same as the
number of elements in the vectors.
result
The value of the greatest element in start_vec.
NOTES
In C and Pascal, vec_$iamax16_i searches a row vector; in FORTRAN, it
searches a column vector.
Vec_$iamax16_i, 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_$rmax, vec_$rmin, vec_$amin, vec_$amax_i, vec_$damax, vec_$damax_i,
vec_$amax, vec_$iamax_i, vec_$iamax, vec_$iamax16.