Vector sum

SSUM/DSUM/ISUM/CSUM/ZSUM

Name SSUM/DSUM/ISUM/CSUM/ZSUM

Vector sum

Purpose Given a real, integer, or complex vector x of length n, these subprograms compute the sum of the elements of the vector

n

s= xi.

i= 1

The vector can be stored in a one-dimensional array or in either a row or a column of a two-dimensional array.

Usage

VECLIB:

 

 

INTEGER*4

n, incx

 

REAL*4

s, SSUM, x(lenx)

 

s = SSUM(n, x, incx)

 

INTEGER*4

n, incx

 

REAL*8

s, DSUM, x(lenx)

 

s = DSUM(n, x, incx)

 

INTEGER*4

n, incx, s, ISUM, x(lenx)

 

s = ISUM(n, x, incx)

 

INTEGER*4

n, incx

 

COMPLEX*8

s, CSUM, x(lenx)

 

s = CSUM(n, x, incx)

 

INTEGER*4

n, incx

 

COMPLEX*16

s, ZSUM, x(lenx)

s = ZSUM(n, x, incx)

VECLIB8:

INTEGER*8

n, incx

REAL*4

s, SSUM, x(lenx)

s = SSUM(n, x, incx)

INTEGER*8

n, incx

REAL*8

s, DSUM, x(lenx)

s = DSUM(n, x, incx)

INTEGER*8

n, incx, s, ISUM, x(lenx)

s = ISUM(n, x, incx)

Chapter 2 Basic Vector Operations 139