Content |
BLAS Level 1: asum
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
x |
(input) real or complex valued DenseVector |
absoluteSum |
(output) real scalar |
Function Variant
x |
(input) real or complex valued DenseVector |
Return value:
The computed sum of absolute values of elements of vector \(x\).
Defined in namespace flens::blas. Function asum with 2 template parameters.
Defined in namespace flens::blas. Function asum with 1 template parameters.