?syr

Performs a rank-1 update of a symmetric matrix.

Syntax

FORTRAN 77:

call ssyr(uplo, n, alpha, x, incx, a, lda)

call dsyr(uplo, n, alpha, x, incx, a, lda)

Fortran 95:

call syr(a, x [,uplo] [, alpha])

C:

void cblas_ssyr (const CBLAS_LAYOUT Layout, const CBLAS_UPLO uplo, const MKL_INT n, const float alpha, const float *x, const MKL_INT incx, float a, const MKL_INT lda);

void cblas_dsyr (const CBLAS_LAYOUT Layout, const CBLAS_UPLO uplo, const MKL_INT n, const double alpha, const double *x, const MKL_INT incx, double a, const MKL_INT lda);

Include Files

  • Fortran: mkl.fi
  • Fortran 95: blas.f90
  • C: mkl.h

Description

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

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

where:

alpha is a real scalar,

x is an n-element vector,

A is an n-by-n symmetric matrix.

Input Parameters

Layout

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

uplo

CHARACTER*1. Specifies whether the upper or lower triangular part of the array a is used.

If uplo = 'U' or 'u', then the upper triangular part of the array a is used.

If uplo = 'L' or 'l', then the low triangular part of the array a is used.

n

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

alpha

REAL for ssyr

DOUBLE PRECISION for dsyr

Specifies the scalar alpha.

x

REAL for ssyr

DOUBLE PRECISION for dsyr

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

incx

INTEGER. Specifies the increment for the elements of x.

The value of incx must not be zero.

a

REAL for ssyr

DOUBLE PRECISION for dsyr

Array, size (lda, n).

Before entry with uplo = 'U' or 'u', the leading n-by-n upper triangular part of the array a must contain the upper triangular part of the symmetric matrix A and the strictly lower triangular part of a is not referenced.

Before entry with uplo = 'L' or 'l', the leading n-by-n lower triangular part of the array a must contain the lower triangular part of the symmetric matrix A and the strictly upper triangular part of a is not referenced.

lda

INTEGER. Specifies the leading dimension of a as declared in the calling (sub)program. The value of lda must be at least max(1, n).

Output Parameters

a

With uplo = 'U' or 'u', the upper triangular part of the array a is overwritten by the upper triangular part of the updated matrix.

With uplo = 'L' or 'l', the lower triangular part of the array a is overwritten by the lower triangular part of the updated matrix.

Fortran 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.

Specific details for the routine syr interface are the following:

a

Holds the matrix A of size (n,n).

x

Holds the vector with the number of elements n.

uplo

Must be 'U' or 'L'. The default value is 'U'.

alpha

The default value is 1.

For more complete information about compiler optimizations, see our Optimization Notice.