===================== CXXBLAS Level 1: asum [TOC] ===================== *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 ====================== *--[CODEREF]----------------------------------------------------------------* | | | template | | void | | asum(IndexType n, const X *x, IndexType incX, T &absSum); | | | *---------------------------------------------------------------------------* [c:@N@cxxblas@FT@>3#T#T#Tasum#t0.0#*1t0.1#S0_#&t0.2] [#templatetypenameIndexType,typenameX,typenameTvoid] 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 ---------------- *--[CODEREF]----------------------------------------------------------------* | | | template | | typename If::isBlasCompatibleInteger | | asum(IndexType n, const float *x, IndexType incX, | | float &absSum); | | | *---------------------------------------------------------------------------* [c:@N@cxxblas@FT@>1#Tasum#t0.0#*1f#S0_#&f#templatet] [ypenameIndexTypetypenameIfIndexTypeisBlasCompatibl] [eInteger ] Double Precision ---------------- *--[CODEREF]----------------------------------------------------------------* | | | template | | typename If::isBlasCompatibleInteger | | asum(IndexType n, const double *x, IndexType incX, | | double &absSum); | | | *---------------------------------------------------------------------------* [c:@N@cxxblas@FT@>1#Tasum#t0.0#*1d#S0_#&d#templatet] [ypenameIndexTypetypenameIfIndexTypeisBlasCompatibl] [eInteger ] Complex Single Precision ------------------------ *--[CODEREF]----------------------------------------------------------------* | | | template | | typename If::isBlasCompatibleInteger | | asum(IndexType n, const ComplexFloat *x, IndexType incX, | | float &absSum); | | | *---------------------------------------------------------------------------* [c:@N@cxxblas@FT@>1#Tasum#t0.0#*1$@N@std@N@__1@C@co] [mplex>#f#S0_#&f#templatetypenameIndexTypetypenameI] [fIndexTypeisBlasCompatibleInteger ] Complex Double Precision ------------------------ *--[CODEREF]----------------------------------------------------------------* | | | template | | typename If::isBlasCompatibleInteger | | asum(IndexType n, const ComplexDouble *x, IndexType incX, | | double &absSum); | | | *---------------------------------------------------------------------------* [c:@N@cxxblas@FT@>1#Tasum#t0.0#*1$@N@std@N@__1@C@co] [mplex>#d#S0_#&d#templatetypenameIndexTypetypenameI] [fIndexTypeisBlasCompatibleInteger ] :links: __CBLAS__ -> http://www.netlib.org/blas/ __ATLAS__ -> http://math-atlas.sourceforge.net __GotoBLAS__ -> http://www.tacc.utexas.edu/tacc-projects/gotoblas2