Content |
BLAS Level 1: nrm2
nrm2 (defined in namespace flens::blas) computes the euklidian norm of \(x\), i.e. \(\sqrt{\sum\limits_{i} |x_i|^2}\).
Two variants are provided:
-
The so called subroutine variant gets an output parameter norm via references. The precision of the computation is determined by the type of the output parameter. E.g. if elements of \(x\) have type float and norm has type double then the accumulation is done in double precision and not in single precision.
-
The so called function variant simply returns the computed result. The precision is determined by the type of the vector elements. In the example above the computation would be carried out in single precision.
Subroutine Variant
x |
(input) real or complex valued DenseVector |
norm |
(output) real scalar |
Function Variant
x |
(input) real or complex valued DenseVector |
Return value:
On exit, the computed euklidian norm of vector \(x\).