ISMIN(3dxml) — Subroutines
Name
ismin, idmin − Index of the real vector element with minimum value
FORMAT
I{S,D}MIN (n, x, incx)
Function Value
imininteger∗4
The index of the first element of the real vector x such that (X(1+(imin-1)∗|incx|)) is the smallest of all elements in the vector. If n<=0, imin returns the value 0.
Arguments
ninteger∗4
On entry, the number of elements in the vector x.
On exit, n is unchanged.
xreal∗4 | real∗8
On entry, a one-dimensional array X of length at least (1+(n-1)∗|incx|), containing the elements of the real vector x.
On exit, x is unchanged.
incxinteger∗4
On entry, the increment for the array X.
If incx > 0, vector x is stored forward in the array, so that x(i) is stored in location X(1+(i-1)∗incx).
If incx < 0, vector x is stored backward in the array, so that x(i) is stored in location X(1+(n-i)∗|incx|).
If incx = 0, only the first element is accessed.
On exit, incx is unchanged.
Description
ISMIN and IDMIN determine the first integer i such that: x(i) = MIN{x(j), j = 1,2, ...,n}
If incx = 0, the computation is a time-consuming way of setting imin = 1.
Example
INTEGER∗4 N, INCX, IMIN
REAL∗4 X(40)
INCX = 2
N = 20
IMIN = ISMIN(N,X,INCX)
This FORTRAN example shows how to compute the index of the vector element with minimum value.