There are two prototypes of scal
available, please see below.
scal( const Scalar >, VectorX& x );
scal( const ScalarA a, VectorX& x );
scal (short for scale)
provides a C++ interface to BLAS routines SSCAL, DSCAL, CSSCAL, ZDSCAL,
CSCAL, and ZSCAL.
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.28. Dispatching of scal.
|
Value type of VectorX |
BLAS routine |
CBLAS routine |
CUBLAS routine |
|---|---|---|---|
|
|
SSCAL |
cblas_sscal |
cublasSscal |
|
|
DSCAL |
cblas_dscal |
cublasDscal |
|
|
CSSCAL |
cblas_csscal |
cublasCsscal |
|
|
ZDSCAL |
cblas_zdscal |
Unavailable |
|
|
CSCAL |
cblas_cscal |
cublasCscal |
|
|
ZSCAL |
cblas_zscal |
cublasZscal |
The original routines SSCAL, DSCAL, CSSCAL, ZDSCAL, CSCAL, and ZSCAL
have four arguments, whereas scal
requires two arguments.
Defined in header boost/numeric/bindings/blas/level1/scal.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/scal.hpp> using namespace boost::numeric::bindings; blas::scal( x, y, z );
this will output
[5] 0 1 2 3 4 5