PrevUpHomeNext
scal
Prototype

There are two prototypes of scal available, please see below.

scal( const Scalar >, VectorX& x );

scal( const ScalarA a, VectorX& x );

Description

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

float

SSCAL

cblas_sscal

cublasSscal

double

DSCAL

cblas_dscal

cublasDscal

combined float and complex<float>

CSSCAL

cblas_csscal

cublasCsscal

combined double and complex<double>

ZDSCAL

cblas_zdscal

Unavailable

complex<float>

CSCAL

cblas_cscal

cublasCscal

complex<double>

ZSCAL

cblas_zscal

cublasZscal


The original routines SSCAL, DSCAL, CSSCAL, ZDSCAL, CSCAL, and ZSCAL have four arguments, whereas scal requires two arguments.

Table 1.29. Deduction of arguments of scal.


Definition

Defined in header boost/numeric/bindings/blas/level1/scal.hpp.

Parameters or Requirements on Types

Parameters

MatrixA

The definition of term 1

MatrixB

The definition of term 2

MatrixC

The definition of term 3.

Definitions may contain paragraphs.

Complexity
Example

#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

Notes
See Also

PrevUpHomeNext