Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?asum
Computes the sum of magnitudes of the vector elements.
Syntax
res = sasum(n, x, incx)
res = scasum(n, x, incx)
res = dasum(n, x, incx)
res = dzasum(n, x, incx)
res = asum(x)
Include Files
mkl.fi, mkl_blas.f90
Description
The ?asum routine computes the sum of the magnitudes of elements of a real vector, or the sum of magnitudes of the real and imaginary parts of elements of a complex vector, that is,
\[\sum_{i=1}^n \left( \left| \mathrm{Re}(x_i) \right| + \left| \mathrm{Im}(x_i) \right| \right) \,, \]
where x is a vector with n elements.
Input Parameters
- n
-
INTEGER. Specifies the number of elements in vector x.
- x
-
REAL array for sasum
DOUBLE PRECISION array for dasum
COMPLEX array for scasum
DOUBLE COMPLEX array for dzasum
The size is at least 1 + (n - 1) * abs(incx).
- incx
-
INTEGER. Specifies the increment for indexing vector x.
Return Values
- res
-
REAL for sasum
DOUBLE PRECISION for dasum
REAL for scasum
DOUBLE PRECISION for dzasum
Contains the sum of magnitudes of real and imaginary parts of all elements of the vector.
BLAS 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see BLAS 95 Interface Conventions.
Specific details for the routine asum interface are the following:
- x
-
Holds the array of size n.