Content

CXXBLAS Level 1: asum

asum (defined in namespace cxxblas) computes the sum of the absolute values of elements in a vector, i.e. \(\sum\limits_{i} |x_i|\).

Generic Implementation

n

(input)
Specifies the number of elements in vector \(x\).

x

(input)
Pointer to the first element of vector \(x\).

incX

(input)
Specifies the increment for indexing vector \(x\).

absSum

(output)
Contains the sum of magnitudes of real and imaginary parts of all elements of the vector.

CBLAS Implementation

If a CBLAS implementations like ATLAS, GotoBLAS, ... is available then the following optimized variants are provided.

Single Precision

Double Precision

Complex Single Precision

Complex Double Precision