# ?nrm2

Computes the Euclidean norm of a vector.

## Syntax

FORTRAN 77:

res = snrm2(n, x, incx )

res = dnrm2(n, x, incx )

res = scnrm2(n, x, incx )

res = dznrm2(n, x, incx )

Fortran 95:

res = nrm2(x)

## Description

The ?nrm2 functions perform a vector reduction operation defined as
`res = ||x||,`

where:

x is a vector

res is a value containing the Euclidean norm of the elements of x.

## Input Parameters

n

  INTEGER. Specifies the number of elements in vector x.

x

  REAL for snrm2

  DOUBLE PRECISION for dnrm2

  COMPLEX for scnrm2

  DOUBLE COMPLEX for dznrm2

  Array, DIMENSION at least `(1 + (n -1)*abs (incx))`.

incx

  INTEGER. Specifies the increment for the elements of x.

## Output Parameters

res

  REAL for snrm2

  DOUBLE PRECISION for dnrm2

  REAL for scnrm2

  DOUBLE PRECISION for dznrm2

  Contains the Euclidean norm of the vector x.

## Fortran 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.

Specific details for the routine nrm2 interface are the following:

x

  Holds the vector of length `(n)`.

Parent topic: BLAS Level 1 Routines