CXML
OSRCHI (3sciport)
Searches an ordered vector for the first occurrence of a target
value
SYNOPSIS
Call OSRCHI( n, x, incx, target, index, where, num )
ARGUMENTS
n Integer.
The number of elements of vector x to be searched.
x Integer vector.
The ordered integer input vector to be searched.
incx Integer.
The increment between elements of vector x.
A positive increment indicates an ascending vector and
returns the index of the first element encountered,
starting at the beginning of the vector.
A negative increment indicates a descending vector and
returns the index of the first element encountered,
starting at the end of the vector.
target Integer.
The target of the search.
index Integer.
The index of the first element of vector x containing
target.
Exceptions:
(1) If n is less than one, index = 0
(2) If no element equals target, index = n+1.
where Integer.
The index of the first location in array x that would
contain target if it were found. (If target is found, index
= where).
Exception: if n is less than one, where = 0.
num Integer.
The number of target elements found in array x. For the
total number of occurrences of target in array x, this
parameter must be specified nonzero.
DESCRIPTION
Subroutine OSRCHI searches ordered integer array x and returns the index of
the first location that contains an integer target. The total number of
occurrences of target in array x can also be returned.
For equations and other information, see Volume 3: UNICOS Math and
Scientific Library Reference Manual SR-2081 7.0, Cray Research, Inc.
CXML Home Page Index of CXML Routines