PrevUpHomeNext
syr2k
Prototype

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

syr2k( const Scalar >, const MatrixA& a, const MatrixB& b,
        const Scalar >, MatrixC& c );

syr2k( const Scalar alpha, const MatrixA& a, const MatrixB& b,
        const Scalar beta, MatrixC& c );

Description

syr2k (short for symmetric rank-2k update) provides a C++ interface to BLAS routines SSYR2K, DSYR2K, CSYR2K, and ZSYR2K. syr2k performs one of the symmetric rank 2k operations

C := alpha*A*B' + alpha*B*A' + beta*C,

or

C := alpha*A'*B + alpha*B'*A + beta*C,

where alpha and beta are scalars, C is an n by n symmetric matrix and A and B are n by k matrices in the first case and k by n matrices in the second case.

The selection of the BLAS routine is done during compile-time, and is determined by the type of values contained in type MatrixA. The type of values is obtained through the value_type meta-function typename value_type<MatrixA>::type. Table X below illustrates to which specific routine this dispatching will take place.

Table 1.92. Dispatching of syr2k.

Value type of MatrixA

BLAS routine

CBLAS routine

CUBLAS routine

float

SSYR2K

cblas_ssyr2k

cublasSsyr2k

double

DSYR2K

cblas_dsyr2k

cublasDsyr2k

complex<float>

CSYR2K

cblas_csyr2k

cublasCsyr2k

complex<double>

ZSYR2K

cblas_zsyr2k

Unavailable


The original routines SSYR2K, DSYR2K, CSYR2K, and ZSYR2K have twelve arguments, whereas syr2k requires five arguments.

Table 1.93. Deduction of arguments of syr2k.


Definition

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

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

this will output

[5] 0 1 2 3 4 5

Notes
See Also

PrevUpHomeNext