Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?nrm2
Computes the Euclidean norm of a vector.
Syntax
res = snrm2(n, x, incx)
res = dnrm2(n, x, incx)
res = scnrm2(n, x, incx)
res = dznrm2(n, x, incx)
res = nrm2(x)
Include Files
mkl.fi, mkl_blas.f90
Description
The ?nrm2 routines perform a vector reduction operation defined as
\[\sqrt{\sum_{i=1}^n x_i^2} \,, \]
where \(x_i\) is an element of the vector x.
Input Parameters
- n
-
INTEGER. Specifies the number of elements in vector x.
- x
-
REAL array for snrm2
DOUBLE PRECISION array for dnrm2
COMPLEX array for scnrm2
DOUBLE COMPLEX array for dznrm2
The size is at least 1 + (n - 1) * abs(incx).
- incx
-
INTEGER. Specifies the increment for the elements of x.
Return Values
- res
-
REAL for snrm2
DOUBLE PRECISION for dnrm2
REAL for scnrm2
DOUBLE PRECISION for dznrm2
Contains the Euclidean norm of the vector x.
BLAS 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 BLAS 95 Interface Conventions.
Specific details for the routine nrm2 interface are the following:
- x
-
Holds the vector with the number of elements n.