SAXPY

SAXPY

SAXPY (Single-precision real Alpha X Plus Y[1]) is one of the functions in the Basic Linear Algebra Subprograms (BLAS) package, and is a common operation in computations with vector processors. SAXPY is a combination of scalar multiplication and vector addition,

\mathbf{z} = \alpha \mathbf{x} + \mathbf{y}, \,

where α is a scalar, and \mathbf{x} and \mathbf{y} are vectors. As with most functions, there exist four variants of SAXPY in the BLAS package, namely SAXPY, DAXPY, CAXPY and ZAXPY. These variants differ only in the datatype of scalar α. Description of these routines can be found in showed external links.

Contents

Different datatypes

SAXPY

SAXPY [2] is not only the generic term for the combined scalar multiplication plus vector addition operation, but also the specific variant where the scalar α and the vectors \mathbf{x} and \mathbf{y} are of single precision.

DAXPY

DAXPY denotes SAXPY with double precision α, \mathbf{x} and \mathbf{y}.

CAXPY

CAXPY denotes SAXPY with complex α, \mathbf{x} and \mathbf{y}.

ZAXPY

ZAXPY denotes SAXPY with double precision complex α, \mathbf{x} and \mathbf{y}.

Generic implementation

The most generic C implementation of SAXPY looks like the following:

void saxpy(float* x, float* y, int n, float a) {
  int i;
  for (i = 0; i < n; ++i)
    y[i] += a * x[i];
}

References

  1. ^ http://www.gnu.org/software/gsl/manual/html_node/BLAS-Support.html
  2. ^ G. H. Golub, C. F. Loan, Matrix Computations, 3rd edition, Johns Hopkins, 1996. ISBN 0801854148.


External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Minisupercomputer — Not to be confused with superminicomputer. Minisupercomputers constituted a short lived class of computers that emerged in the mid 1980s. As scientific computing using vector processors became more popular, the need for lower cost systems that… …   Wikipedia

  • СЕПСИС — (sepsis, septicaemia), общее инфекционное заболевание, определяемое своеобразной реакцией организма на постоянную или периодическую инфекцию крови различными микроорганизмами и их токсинами, не сопровождающуюся какими либо специфическими… …   Большая медицинская энциклопедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”