Minimum of magnitudes

SAMIN/DAMIN/IAMIN/SCAMIN/DZAMIN

Name SAMIN/DAMIN/IAMIN/SCAMIN/DZAMIN

Minimum of magnitudes

Purpose Given a real or integer vector x of length n, SAMIN, DAMIN, or IAMIN computes the minimum of the magnitudes of the elements of the vector

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

Given a complex vector x of length n, SCAMIN or DZAMIN computes

s= min( Re( xi) + Im( xi) : i = 1, 2, …, n)

where Re(xi) and Im(xi) are the real and imaginary parts of xi, respectively. The usual definition of the minimum of magnitudes of a complex vector is

t = min({ Re( xi)2 + Im( xi)2}1 2 : i = 1, 2, …, n).

s is computed instead of t because, with its lack of square roots, it is faster to compute. Because t s 2t , s is often an acceptable substitute for t.

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, SAMIN, x(lenx)

 

s = SAMIN(n, x, incx)

 

INTEGER*4

n, incx

 

REAL*8

s, DAMIN, x(lenx)

 

s = DAMIN(n, x, incx)

 

INTEGER*4

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

 

s = IAMIN(n, x, incx)

 

INTEGER*4

n, incx

 

REAL*4

s, SCAMIN

 

COMPLEX*8

x(lenx)

 

s = SCAMIN(n, x, incx)

 

INTEGER*4

n, incx

 

REAL*8

s, DZAMIN

 

COMPLEX*16

x(lenx)

s = DZAMIN(n, x, incx)

VECLIB8:

Chapter 2 Basic Vector Operations 59