Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

cblas_?spr2

Computes a rank-2 update of a symmetric packed matrix.

Syntax

void cblas_sspr2 (const CBLAS_LAYOUT Layout, const CBLAS_UPLO uplo, const MKL_INT n, const float alpha, const float *x, const MKL_INT incx, const float *y, const MKL_INT incy, float *ap);

void cblas_dspr2 (const CBLAS_LAYOUT Layout, const CBLAS_UPLO uplo, const MKL_INT n, const double alpha, const double *x, const MKL_INT incx, const double *y, const MKL_INT incy, double *ap);

Include Files

  • mkl.h

Description

The ?spr2 routines perform a matrix-vector operation defined as

A:= alpha*x*y'+ alpha*y*x' + A,

where:

alpha is a scalar,

x and y are n-element vectors,

A is an n-by-n symmetric matrix, supplied in packed form.

Input Parameters

Layout

Specifies whether two-dimensional array storage is row-major (CblasRowMajor) or column-major (CblasColMajor).

uplo

Specifies whether the upper or lower triangular part of the matrix A is supplied in the packed array ap.

If uplo = CblasUpper, then the upper triangular part of the matrix A is supplied in the packed array ap .

If uplo = CblasLower, then the low triangular part of the matrix A is supplied in the packed array ap .

n

Specifies the order of the matrix A. The value of n must be at least zero.

alpha

Specifies the scalar alpha.

x

Array, size at least (1 + (n - 1)*abs(incx)). Before entry, the incremented array x must contain the n-element vector x.

incx

Specifies the increment for the elements of x.

The value of incx must not be zero.

y

Array, size at least (1 + (n - 1)*abs(incy)). Before entry, the incremented array y must contain the n-element vector y.

incy

Specifies the increment for the elements of y. The value of incy must not be zero.

ap

For Layout = CblasColMajor:

Before entry with uplo = CblasUpper, the array ap must contain the upper triangular part of the symmetric matrix packed sequentially, column-by-column, so that ap[0] contains A1, 1, ap[1] and ap[2] contain A1, 2 and A2, 2 respectively, and so on.

Before entry with uplo = CblasLower, the array ap must contain the lower triangular part of the symmetric matrix packed sequentially, column-by-column, so that ap[0] contains A1, 1, ap[1] and ap[2] contain A2, 1 and A3, 1 respectively, and so on.

For Layout = CblasRowMajor:

Before entry with uplo = CblasUpper, the array ap must contain the upper triangular part of the symmetric matrix packed sequentially, row-by-row, ap[0] contains A1, 1, ap[1] and ap[2] contain A1, 2 and A1, 3 respectively, and so on.

Before entry with uplo = CblasLower, the array ap must contain the lower triangular part of the symmetric matrix packed sequentially, row-by-row, so that ap[0] contains A1, 1, ap[1] and ap[2] contain A2, 1 and A2, 2 respectively, and so on.

Output Parameters

:

 

ap

With uplo = CblasUpper, overwritten by the upper triangular part of the updated matrix.

With uplo = CblasLower, overwritten by the lower triangular part of the updated matrix.