NORM

The NORM function computes the Euclidean norm of a vector. Alternatively, NORM computes the Infinity norm of an array.

This routine is written in the IDL language. Its source code can be found in the file norm.pro in the lib subdirectory of the IDL distribution.

Calling Sequence

Result = NORM( A )

Arguments

A

A can be either of the following:

Keywords

DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

Examples

Define an n -element complex vector A:

A = [COMPLEX(1, 0), COMPLEX(2,-2), COMPLEX(-3,1)]

PRINT, NORM(A) ; Compute the Euclidean norm of A and print.

IDL prints:

4.35890

Define an m by n complex array A:

B = [[COMPLEX(1, 0), COMPLEX(2,-2), COMPLEX(-3,1)], $

     [COMPLEX(1,-2), COMPLEX(2, 2), COMPLEX(1, 0)]]

PRINT, NORM(B, /DOUBLE) ; Compute the Infinity norm of B and print.

IDL prints:

6.9907048

See Also

COND