sasum(3S)
SASUM, DASUM, SCASUM, DZASUM - Sums the absolute value of elements in a real or complex vector
As shipped in IRIX 6.5.30. Last changed in IRIX 6.5.19.
NAME SASUM, DASUM, SCASUM, DZASUM - Sums the absolute value of elements in a real or complex vector SYNOPSIS Single precision Fortran: real SASUM real sum sum = SASUM (n, x, incx) C/C++: #include <scsl_blas.h> float sasum( int n, float *x, int incx ); Double precision Fortran: double precision DASUM double precision sum sum = DASUM (n, x, incx) C/C++: #include <scsl_blas.h> double dasum( int n, double *x, int incx ); Single precision complex Fortran: real SCASUM real sum sum = SCASUM (n, x, incx) C/C++: #include <scsl_blas.h> float scasum( int n, scsl_complex *x, int incx ); C++ STL: #include <complex.h> #include <scsl_blas.h> float scasum( int n, complex<float> *x, int incx ); Double precision complex Fortran: double precision DZASUM double precision sum sum = DZASUM (n, x, incx) C/C++: #include <scsl_blas.h> double dzasum( int n, scsl_zomplex *x, int incx ); C++ STL: #include <complex.h> #include <scsl_blas.h> double dzasum( int n, complex<double> *x, int incx ); IMPLEMENTATION These routines are part of the SCSL Scientific Library and can be loaded using either the -lscs or the -lscs_mp option. The -lscs_mp option directs the linker to use the multi-processor version of the library. When linking to SCSL with -lscs or -lscs_mp, the default integer size is 4 bytes (32 bits). Another version of SCSL is available in which integers are 8 bytes (64 bits). This version allows the user access to larger memory sizes and helps when porting legacy Cray codes. It can be loaded by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use only one of the two versions; 4-byte integer and 8-byte integer library calls cannot be mixed. The C and C++ prototypes shown above are appropriate for the 4-byte integer version of SCSL. When using the 8-byte integer version, the variables of type int become long long and the <scsl_blas_i8.h> header file should be included. DESCRIPTION SASUM and DASUM sum the absolute values of the elements of a real vector, as follows: n sum <- ||x|| = Sum |x | 1 i=1 i where x is a real vector of length n. SCASUM and DZASUM sum the absolute values of the real and imaginary parts of the elements of a complex vector, as follows: sum <- ||Real(x)|| + Imag(x)|| = 1 1 n n Sum |Real(x )| + Sum |Imag(x )| i=1 i j=1 j where x is a complex vector of length n. For C/C++ arrays, the indices are from 0 to n-1. See the NOTES section of this man page for information about the interpretation of the data types described in the following arguments. These functions have the following arguments: sum Sum of values. SASUM: Real sum of the absolute values of the elements of x. DASUM: Double precision sum of the absolute values of the elements of x. SCASUM: Real sum of the absolute values of the real and imaginary parts of the elements of x. DZASUM: Double precision sum of the absolute values of the real and imaginary parts of the elements of x. n Integer. (input) Number of elements in the vector to be summed. If n <= 0, these routines return 0. x Array of dimension (n-1) * |incx| + 1. (input) SASUM: Single precision array. DASUM: Double precision array. SCASUM: Single precision complex array. DZASUM: Double precision complex array. Array x contains the vector to be summed. incx Integer. (input) Increment between elements of x. If incx = 0, the results will be unpredictable. NOTES These routines are Level 1 Basic Linear Algebra Subprograms (Level 1 BLAS). When working backward (incx < 0), each routine starts at the end of the vector and moves backward, as follows: Fortran: x(1-incx *(n-1)), x(1incx * (n-2)), ... , x(1) C/C++: x(1-incx * (n-2)), x(1-incx * (n-3)), ..., x(0) Data Types The following data types are described in this documentation: Term Used Data type Fortran: Array dimensioned n x(n) Character CHARACTER Integer INTEGER (INTEGER*8 for -lscs_i8[_mp]) Single precision REAL Double precision DOUBLE PRECISION Single precision complex COMPLEX Double precision complex DOUBLE COMPLEX C/C++: Array dimensioned n x[n] Character char Integer int (long long for -lscs_i8[_mp]) Single precision float Double precision double Single precision complex scsl_complex Double precision complex scsl_zomplex C++ STL: Array dimensioned n x[n] Character char Integer int (long long for -lscs_i8[_mp]) Single precision float Double precision double Single precision complex complex<float> Double precision complex complex<double> SEE ALSO INTRO_SCSL(3S), INTRO_BLAS1(3S) INTRO_CBLAS(3S) for information about using the C interface to Fortran 77 Basic Linear Algebra Subprograms (legacy BLAS) set forth by the Basic Linear Algebra Subprograms Technical Forum.