# ?axpy

Computes a vector-scalar product and adds the result to a vector.

## Syntax

FORTRAN 77:

call saxpy(n, a, x, incx, y, incy)

call daxpy(n, a, x, incx, y, incy)

call caxpy(n, a, x, incx, y, incy)

call zaxpy(n, a, x, incx, y, incy)

Fortran 95:

call axpy(x, y [,a])

## Description

The ?axpy routines perform a vector-vector operation defined as
`y := a*x + y`

where:

a is a scalar

x and y are vectors of order n.

## Input Parameters

n

  INTEGER. Specifies the number of elements in vectors x and y.

a

  REAL for saxpy

  DOUBLE PRECISION for daxpy

  COMPLEX for caxpy

  DOUBLE COMPLEX for zaxpy

  Specifies the scalar a.

x

  REAL for saxpy

  DOUBLE PRECISION for daxpy

  COMPLEX for caxpy

  DOUBLE COMPLEX for zaxpy

  Array, DIMENSION at least `(1 + (n-1)*abs(incx))`.

incx

  INTEGER. Specifies the increment for the elements of x.

y

  REAL for saxpy

  DOUBLE PRECISION for daxpy

  COMPLEX for caxpy

  DOUBLE COMPLEX for zaxpy

  Array, DIMENSION at least `(1 + (n-1)*abs(incy))`.

incy

  INTEGER. Specifies the increment for the elements of y.

## Output Parameters

y

  Contains the updated vector y.

## Fortran 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 Fortran 95 Interface Conventions.

Specific details for the routine axpy interface are the following:

x

  Holds the array of size (n).

y

  Holds the array of size (n).

a

  The default value is 1.

Parent topic: BLAS Level 1 Routines