================== BLAS Level 1: asum [TOC] ================== *asum* (defined in namespace `flens::blas`) computes the sum of the absolute values of elements in a vector, i.e. $\sum\limits_{i} |x_i|$. Two variants are provided: - The so called _subroutine variant_ gets an output parameter `absoluteSum` 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 `absoluteSum` 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 | | asum(const DenseVector &x, T &absoluteSum); | | | *---------------------------------------------------------------------------* [c:@N@flens@N@blas@FT@>2#T#Tasum#&1>@N@flens@CT>1#T] [@DenseVector1t0.0#&t0.1#templatetypenameX,typename] [TtypenameRestrictToIsNotComplexTvalue,voidType ] x `(input) real or complex valued DenseVector` + Source vector. absoluteSum `(output) real scalar` + On exit, the computed sum of absolute values of elements of vector $x$. Function Variant ================ *--[CODEREF]----------------------------------------------------------------* | | | template | | const typename ComplexTrait::PrimitiveType | | asum(const DenseVector &x); | | | *---------------------------------------------------------------------------* [c:@N@flens@N@blas@FT@>1#Tasum#&1>@N@flens@CT>1#T@D] [enseVector1t0.0#templatetypenameXconsttypenameComp] [lexTraittypenameXElementTypePrimitiveType ] x `(input) real or complex valued DenseVector` + Source vector. *Return value:* The computed sum of absolute values of elements of vector $x$. ################################################################################ # # The following CODEREFs are automatically created stubs. # ################################################################################ *--[CODEREF]----------------------------------------------------------------* | | | template | | typename RestrictTo::value, void>::Type | | asum(const GeMatrix &A, T &absoluteSum); | | | *---------------------------------------------------------------------------* [c:@N@flens@N@blas@FT@>2#T#Tasum#&1>@N@flens@CT>1#T] [@GeMatrix1t0.0#&t0.1#templatetypenameMA,typenameTt] [ypenameRestrictToIsNotComplexTvalue,voidType ] Defined in namespace `flens::blas`. Function `asum` with 2 template parameters. *--[CODEREF]-----------------------------------------------------------------* | | | template | | const typename ComplexTrait::PrimitiveType | | asum(const GeMatrix &A); | | | *----------------------------------------------------------------------------* [c:@N@flens@N@blas@FT@>1#Tasum#&1>@N@flens@CT>1#T@G] [eMatrix1t0.0#templatetypenameMAconsttypenameComple] [xTraittypenameMAElementTypePrimitiveType ] Defined in namespace `flens::blas`. Function `asum` with 1 template parameters.