Minimum of vector

SMIN/DMIN/IMIN

Name SMIN/DMIN/IMIN

Minimum of vector

Purpose Given a real or integer vector x of length n, these subprograms compute the minimum of the elements of the vector

s= min( xi : i = 1, 2, …, n).

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

n, incx

 

REAL*4

s, SMIN, x(lenx)

 

s = SMIN(n, x, incx)

 

INTEGER*4

n, incx

 

REAL*8

s, DMIN, x(lenx)

 

s = DMIN(n, x, incx)

 

INTEGER*4

n, incx, s, IMIN, x(lenx)

 

s = IMIN(n, x, incx)

 

VECLIB8:

 

 

INTEGER*8

n, incx

 

REAL*4

s, SMIN, x(lenx)

 

s = SMIN(n, x, incx)

 

INTEGER*8

n, incx

 

REAL*8

s, DMIN, x(lenx)

 

s = DMIN(n, x, incx)

 

INTEGER*8

n, incx, s, IMIN, x(lenx)

 

s = IMIN(n, x, incx)

Input

n

Number of elements of vector x to be used. If n ≤ 0, the

 

 

subprograms do not reference x.

 

x

Array of length lenx = (n−1)⋅incx+1 containing the

 

 

n-vector x.

 

incx

Increment for the array x. x is stored forward in array x

 

 

with increment incx; that is, xi is stored in

 

 

x((i−1)⋅incx+1).

Use incx = 1 if the vector x is stored contiguously in array x; that is, if xi is stored in x(i). Refer to “BLAS

Chapter 2 Basic Vector Operations 105