HP MLIB User's Guide Vol. 1 7th Ed.
Chapter 2 Basic Vector Operations 59
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
Given a complex vector x of length n, SCAMIN or DZAMIN computes
where Re(x
i
) and Im(x
i
) are the real and imaginary parts of x
i
, respectively.
The usual definition of the minimum of magnitudes of a complex vector is
s is computed instead of t because, with its lack of square roots, it is faster to
compute. Because , 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:
s min x
i
: i 12… n,, ,=().=
s min Re x
i
() Im x
i
(): i+12… n,, ,=()=
t min Re x
i
()
2
Im x
i
()
2
+{}
12⁄
: i 12… n,, ,=().=
t ≤ s ≤ 2t