HP MLIB User's Guide Vol. 1 7th Ed.

110 HP MLIB User’s Guide
SNRSQ/DNRSQ/SCNRSQ/DZNRSQ Euclidean norm squared
Name SNRSQ/DNRSQ/SCNRSQ/DZNRSQ
Euclidean norm squared
Purpose Given a real or complex vector x of length n, these subprograms compute the
square of the Euclidean (that is, l
2
) norm of the vector
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, SNRSQ, x(lenx)
s = SNRSQ(n, x, incx)
INTEGER*4 n, incx
REAL*8 s, DNRSQ, x(lenx)
s = DNRSQ(n, x, incx)
INTEGER*4 n, incx
REAL*4 s, SCNRSQ
COMPLEX*8 x(lenx)
s = SCNRSQ(n, x, incx)
INTEGER*4 n, incx
REAL*8 s, DZNRSQ
COMPLEX*16 x(lenx)
s = DZNRSQ(n, x, incx)
VECLIB8:
INTEGER*8 n, incx
REAL*4 s, SNRSQ, x(lenx)
s = SNRSQ(n, x, incx)
INTEGER*8 n, incx
REAL*8 s, DNRSQ, x(lenx)
s = DNRSQ(n, x, incx)
INTEGER*8 n, incx
REAL*4 s, SCNRSQ
COMPLEX*8 x(lenx)
s = SCNRSQ(n, x, incx)
sx
2
2
x
i
i 1=
n
==