LAPACK 3.11.0
LAPACK: Linear Algebra PACKage
|
real(wp) function snrm2 | ( | integer | n, |
real(wp), dimension(*) | x, | ||
integer | incx | ||
) |
SNRM2
SNRM2 returns the euclidean norm of a vector via the function name, so that SNRM2 := sqrt( x'*x ).
[in] | N | N is INTEGER number of elements in input vector(s) |
[in] | X | X is REAL array, dimension ( 1 + ( N - 1 )*abs( INCX ) ) |
[in] | INCX | INCX is INTEGER, storage spacing between elements of X If INCX > 0, X(1+(i-1)*INCX) = x(i) for 1 <= i <= n If INCX < 0, X(1-(n-i)*INCX) = x(i) for 1 <= i <= n If INCX = 0, x isn't a vector so there is no need to call this subroutine. If you call it anyway, it will count x(1) in the vector norm N times. |
Anderson E. (2017) Algorithm 978: Safe Scaling in the Level 1 BLAS ACM Trans Math Softw 44:1--28 https://doi.org/10.1145/3061665 Blue, James L. (1978) A Portable Fortran Program to Find the Euclidean Norm of a Vector ACM Trans Math Softw 4:15--23 https://doi.org/10.1145/355769.355771