There are two prototypes of axpy
available, please see below.
axpy( const Scalar >, const VectorX& x, VectorY& y );
axpy( const Scalar a, const VectorX& x, VectorY& y );
axpy
(short for a times
x plus y) provides a C++ interface to BLAS routines SAXPY, DAXPY, CAXPY,
and ZAXPY.
The selection of the BLAS routine is done during compile-time, and is
determined by the type of values contained in type VectorX
.
The type of values is obtained through the value_type
meta-function typename value_type<VectorX>::type
. Table X below illustrates to
which specific routine this dispatching will take place.
Table 1.6. Dispatching of axpy.
Value type of VectorX |
BLAS routine |
CBLAS routine |
CUBLAS routine |
---|---|---|---|
|
SAXPY |
cblas_saxpy |
cublasSaxpy |
|
DAXPY |
cblas_daxpy |
cublasDaxpy |
|
CAXPY |
cblas_caxpy |
cublasCaxpy |
|
ZAXPY |
cblas_zaxpy |
Unavailable |
The original routines SAXPY, DAXPY, CAXPY, and ZAXPY have six arguments,
whereas axpy
requires
three arguments.
Defined in header boost/numeric/bindings/blas/level1/axpy.hpp
.
Parameters
The definition of term 1
The definition of term 2
The definition of term 3.
Definitions may contain paragraphs.
#include <boost/numeric/bindings/blas/level1/axpy.hpp> using namespace boost::numeric::bindings; blas::axpy( x, y, z );
this will output
[5] 0 1 2 3 4 5