V304: Search a Vector for a Given Element

Author(s): J. Zoll, C. Letertre Library: KERNLIB
Submitter: Submitted: 01.03.1968
Language: Fortran or Assembler Revised: 16.09.1991

These routines all search through a vector for a given element. The calling sequences and the default returns are different.

Structure:

FUNCTION subprograms
User Entry Names: IUCOMP, IUCOLA, IUFIND, IUFILA, IUHUNT, IULAST

Usage:

IUCOMP(IT,IVEC,N) or IUCOLA(IT,IVEC,N)

returns the relative address in the array IVEC of the first (or the last) word which is equal to IT, or zero if IT is not contained in IVEC(1),...,IVEC(N) or if tex2html_wrap_inline102 .
IUFIND(IT,IVEC,JL,JR) or IUFILA(IT,IVEC,JL,JR)

returns the relative address in the array IVEC of the first (or the last) element between IVEC(JL) and IVEC(JR) tex2html_wrap_inline104 which equals IT, or tex2html_wrap_inline106 if IT is not contained in IVEC(JL),IVEC(JL+1),..., IVEC(JR) or if tex2html_wrap_inline108 .

    IUHUNT(IT,IVEC,N,INC)
returns the relative address of the first word among IVEC(1),IVEC(INC+1),IVEC(2*INC+1),... of array IVEC (the search does not go beyond IVEC(N)) which equals IT, or zero if IT is not found or if tex2html_wrap_inline110 .
    IULAST(IT,IVEC,N)
returns the relative address of the last word which, in the array IVEC of N elements, is not equal to IT, or zero if tex2html_wrap_inline112 or if all elements in IVEC equal IT.

Notes:

IVEC and IT above may be of type INTEGER or REAL, but the comparison is done in type INTEGER.
tex2html_wrap_inline114


Michel Goossens Wed Jun 5 09:20:22 METDST 1996