================== BLAS Level 1: nrm2 [TOC] ================== *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 ================== *--[CODEREF]----------------------------------------------------------------* | | | template | | typename RestrictTo::value, void>::Type | | nrm2(const DenseVector &x, T &norm); | | | *---------------------------------------------------------------------------* [c:@N@flens@N@blas@FT@>2#T#Tnrm2#&1>@N@flens@CT>1#T] [@DenseVector1t0.0#&t0.1#templatetypenameX,typename] [TtypenameRestrictToIsNotComplexTvalue,voidType ] x `(input) real or complex valued DenseVector` + Source vector. norm `(output) real scalar` + On exit, the computed euklidian norm of vector $x$. Function Variant ================ *--[CODEREF]----------------------------------------------------------------* | | | template | | typename ComplexTrait::PrimitiveType | | nrm2(const DenseVector &x); | | | *---------------------------------------------------------------------------* [c:@N@flens@N@blas@FT@>1#Tnrm2#&1>@N@flens@CT>1#T@D] [enseVector1t0.0#templatetypenameXtypenameComplexTr] [aittypenameXElementTypePrimitiveType ] x `(input) real or complex valued DenseVector` + Source vector. *Return value:* On exit, the computed euklidian norm of vector $x$.