Search vector for element

ISSVxx/IDSVxx/IISVxx/ICSVxx/IZSVxx

Name ISSVxx/IDSVxx/IISVxx/ICSVxx/IZSVxx

Search vector for element

Purpose Given a real, integer, or complex vector x of length n, these subprograms search sequentially through the vector for the first element xi that satisfies a specified relationship to a given scalar a and return the index i of that element.

The last two characters of the subprogram name specify the relationship of interest between the element of the vector and the scalar. For real and integer subprograms, these characters, represented by “xx” in the prototype Fortran statements, and the corresponding function values can be:

xx

Function value

EQ

min{i : xi = a}

GE

min{i : xi a}

GT

min{i : xi > a}

LE

min{i : xi a}

LT

min{i : xi < a}

NE

min{i : xi a}

 

 

For complex subprograms, these characters and corresponding function values are:

xx

Function value

EQ

min{i : xi = a}

NE

min{i : xi a}

 

 

The vector can be stored in a one-dimensional array or in either a row or a column of a two-dimensional array.

Usage

VECLIB:

 

 

INTEGER*4

i, ISSVxx, n, incx

 

REAL*4

a, x(lenx)

 

i = ISSVxx(n, x, incx, a)

 

INTEGER*4

i, IDSVxx, n, incx

 

REAL*8

a, x(lenx)

i = IDSVxx(n, x, incx, a)

Chapter 2 Basic Vector Operations 53