({{, NRM2[x] 
gives the Euclidean norm of the vector x.}})

OpenersNotesSection(Spacer1)Details

To use NRM2, you first need to load the BLAS Package using (RefLink[Needs, paclet:ref/Needs])["LinearAlgebra`BLAS`"].

The following argument must be given:

NRM2[x] is equivalent to (RefLink[Sqrt, paclet:ref/Sqrt])[x.(RefLink[Conjugate, paclet:ref/Conjugate])[x]].

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Load the BLAS package:

Needs["LinearAlgebra`BLAS`"]

Compute the Euclidean norm of a vector:

NRM2[{1,2,3}]

OpenersExampleSection1(Spacer1)Scope  (4)

A real vector:

NRM2[{2.1,3.4,5.7,4.9}]

A complex vector:

NRM2[{2.1+0.3I,2.I,3.9-0.7I}]

An arbitrary-precision vector:

NRM2[{1`20,2`20,3`20}]

A symbolic vector:

NRM2[{v1,v2,v3}]

OpenersExampleSection3(Spacer1)Properties & Relations  (2)

For a vector x, NRM2[x] is equivalent to (RefLink[Norm, paclet:ref/Norm])[x]:

x=RandomComplex[1.+I,{5}];
NRM2[x]==Norm[x]

For a vector x, NRM2[x] is equivalent to (RefLink[Sqrt, paclet:ref/Sqrt])[x.(RefLink[Conjugate, paclet:ref/Conjugate])[x]]:

x=RandomComplex[1.+I,{5}];
NRM2[x]==Sqrt[x.Conjugate[x]]

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Linear Algebra Subroutines, paclet:LowLevelLinearAlgebra/guide/BLASGuide])}})}})