PrevUpHomeNext
swap
Prototype

There is one prototype of swap available, please see below.

swap( VectorX& x, VectorY& y );

Description

swap (short for TODO) provides a C++ interface to BLAS routines SSWAP, DSWAP, CSWAP, and ZSWAP.

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.30. Dispatching of swap.

Value type of VectorX

BLAS routine

CBLAS routine

CUBLAS routine

float

SSWAP

cblas_sswap

cublasSswap

double

DSWAP

cblas_dswap

cublasDswap

complex<float>

CSWAP

cblas_cswap

cublasCswap

complex<double>

ZSWAP

cblas_zswap

Unavailable


The original routines SSWAP, DSWAP, CSWAP, and ZSWAP have five arguments, whereas swap requires two arguments.

Table 1.31. Deduction of arguments of swap.


Definition

Defined in header boost/numeric/bindings/blas/level1/swap.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/swap.hpp>
using namespace boost::numeric::bindings;

blas::swap( x, y, z );

this will output

[5] 0 1 2 3 4 5

Notes
See Also

PrevUpHomeNext