Elementary vector operation

SAXPY/DAXPY/CAXPY/CAXPYC/ZAXPY/ZAXPYC

Name SAXPY/DAXPY/CAXPY/CAXPYC/ZAXPY/ZAXPYC

Elementary vector operation

Purpose

Given a real or complex scalar a and real or complex vectors x and y of length n,

 

these subprograms perform the elementary vector operations

 

y ax + y

and

y a

x

+ y

 

where x is the complex conjugate of x. The vectors can be stored in

 

one-dimensional arrays or in either rows or columns of two-dimensional arrays,

 

and the indexing through the arrays can be either forward or backward.

Usage

VECLIB:

 

 

 

 

INTEGER*4

n, incx, incy

REAL*4

a, x(lenx), y(leny)

CALL SAXPY(n, a, x, incx, y, incy)

INTEGER*4

n, incx, incy

REAL*8

a, x(lenx), y(leny)

CALL DAXPY(n, a, x, incx, y, incy)

INTEGER*4

n, incx, incy

COMPLEX*8

a, x(lenx), y(leny)

CALL CAXPY(n, a, x, incx, y, incy)

INTEGER*4

n, incx, incy

COMPLEX*8

a, x(lenx), y(leny)

CALL CAXPYC(n, a, x, incx, y, incy)

INTEGER*4

n, incx, incy

COMPLEX*16

a, x(lenx), y(leny)

CALL ZAXPY(n, a, x, incx, y, incy)

INTEGER*4

n, incx, incy

COMPLEX*16

a, x(lenx), y(leny)

CALL ZAXPYC(n, a, x, incx, y, incy)

VECLIB8:

INTEGER*8

n, incx, incy

REAL*4

a, x(lenx), y(leny)

CALL SAXPY(n, a, x, incx, y, incy)

INTEGER*8

n, incx, incy

REAL*8

a, x(lenx), y(leny)

CALL DAXPY(n, a, x, incx, y, incy)

Chapter 2 Basic Vector Operations 65