DNRM2 Function

pure function DNRM2(n, x, incx)

NAME

dnrm2(3f) - [M_odepack::matrix] Compute the Euclidean length (L2 norm) of a vector.

SYNOPSIS

  double precision function dnrm2(n,x,incx)
  integer,intent(in) :: incx,n
  double precision,intent(in) :: x(*)

DESCRIPTION

Euclidean norm of the N-vector stored in DX with storage increment INCX, so that

    DNRM2 := sqrt( x'*x )

INPUT

N
number of elements in input vector(s)
DX
double precision vector with N elements dimensioned to at least ( 1 + ( N - 1 )*abs( INCX ) )
INCX

storage spacing between elements of DX

  • 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.

OUTPUT

DNRM2
double precision result (zero if N .LE. 0)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=dp), intent(in) :: x(*)
integer, intent(in) :: incx

Return Value real(kind=dp)


Variables

Type Visibility Attributes Name Initial
real(kind=dp), public :: abig
real(kind=dp), public :: amed
real(kind=dp), public :: asml
real(kind=dp), public :: ax
integer, public :: i
integer, public :: ix
real(kind=dp), public, parameter :: maxN = huge(0.0_dp)
logical, public :: notbig
real(kind=dp), public, parameter :: one = 1.0_dp
real(kind=dp), public, parameter :: sbig = real(radix(0._dp), dp)**(-ceiling((maxexponent(0._dp)-digits(0._dp)+1)*0.5_dp))
real(kind=dp), public :: scl
real(kind=dp), public, parameter :: ssml = real(radix(0._dp), dp)**(-floor((minexponent(0._dp)-1)*0.5_dp))
real(kind=dp), public :: sumsq
real(kind=dp), public, parameter :: tbig = real(radix(0._dp), dp)**floor((maxexponent(0._dp)-digits(0._dp)+1)*0.5_dp)
real(kind=dp), public, parameter :: tsml = real(radix(0._dp), dp)**ceiling((minexponent(0._dp)-1)*0.5_dp)
real(kind=dp), public :: ymax
real(kind=dp), public :: ymin
real(kind=dp), public, parameter :: zero = 0.0_dp