?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])

Include Files

The FORTRAN 77 interfaces are specified in the mkl_blas.fi include file, the Fortran 95 interfaces are specified in the blas.f90 include file, and the C interfaces are specified in the mkl_blas.h include file.

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 each with a number of elements that equals 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.


Submit feedback on this help topic

Copyright © 1994 - 2011, Intel Corporation. All rights reserved.