SSUM(3S)SSUM(3S)NAME
SSUM, DSUM, CSUM, ZSUM - Sums the elements of a real or complex vector
SYNOPSIS
Single precision
Fortran:
real SSUM
real sum
sum = SSUM (n, x, incx)
C/C++:
#include <scsl_blas.h>
float ssum (int n, float *x, int incx);
Double precision
Fortran:
double precision IDSUM
double precision sum
sum = DSUM (n, x, incx)
CC++:
#include <scsl_blas.h>
double dsum (int n, double *x, int incx);
Single precision complex
Fortran:
complex CSUM
complex sum
sum = CSUM (n, x, incx)
C/C++:
#include <scsl_blas.h>
scsl_complex csum (int n, scsl_complex *x, int incx);
C++ STL:
#include <complex.h>
#include <scsl_blas.h>
complex<float> csum (int n, complex<float> *x, int incx);
Double precision complex
Fortran:
double complex ZSUM
double complex sum
sum = ZSUM (n, x, incx)
C/C++:
#include <scsl_blas.h>
scsl_zomplex zsum (int n, scsl_zomplex *x, int incx);
Page 1
SSUM(3S)SSUM(3S)
C++ STL:
#include <complex.h>
#include <scsl_blas.h>
complex<double> zsum (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.h> header file
should be included.
DESCRIPTION
SSUM/DSUM sums the elements of a real vector.
CSUM/ZSUM sums the elements of a complex vector.
These routines perform the following vector operation:
n
sum <- Sum x
i=1 i
These routines have the following arguments:
sum Sum of the elements of the vector x. If n <= 0, sum is set to
0. (input)
SSUM: Single precision sum.
DSUM: Double precision sum.
CSUM: Single precision complex sum.
ZSUM: Double precision complex sum.
n Integer. (input)
Number of vector elements to be summed.
x Array of dimension (n-1) * |incx| + 1. (input)
SSUM: Single precision array.
DSUM: Double precision array.
CSUM: Single precision complex array.
ZSUM: Double precision complex array.
Page 2
SSUM(3S)SSUM(3S)
Vector that contains elements to be summed.
incx Integer. (input)
Increment between elements of x. If incx = 0, the results will
be unpredictable.
NOTES
These routines are extensions to the standard 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(1 - incx * (n-2)), ..., x(1)
C/C++:
x[-incx * (n-1)], x[-incx * (n-2)], ..., x[0]
Data Types
The following data types are described in this documentation:
Term Used Data type
Fortran:
Array dimensioned n x(n)
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]
Integer int (long long for -lscs_i8[_mp])
Single precision float
Page 3
SSUM(3S)SSUM(3S)
Double precision double
Single precision complex scsl_complex
Double precision complex scsl_zomplex
C++ STL:
Array dimensioned n x[n]
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 ALSOINTRO_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.
Page 4