# ?spr

Performs the symmetrical rank-1 update of a complex symmetric packed matrix.

## Syntax

call cspr( uplo, n, alpha, x, incx, ap )

call zspr( uplo, n, alpha, x, incx, ap )

## Description

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

`a:= alpha*x*conjg(x') + a`,

where:

alpha is a complex scalar

x is an n-element complex vector

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

These routines have their real equivalents in BLAS (see ?spr in Chapter “BLAS and Sparse BLAS Routines”).

## Input Parameters

uplo

  CHARACTER*1. Specifies whether the upper or lower triangular part of the matrix a is supplied in the packed array ap, as follows:

  If `uplo = 'U'` or 'u', the upper triangular part of the matrix a is supplied in the array ap.

  If `uplo = 'L'` or 'l', the lower triangular part of the matrix a is supplied in the array ap .

n

  INTEGER.

  Specifies the order of the matrix a.

  The value of n must be at least zero.

alpha

  COMPLEX for cspr

  COMPLEX*16 for zspr

  Specifies the scalar alpha.

x

  COMPLEX for cspr

  COMPLEX*16 for zspr

  Array, DIMENSION 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.

ap

  COMPLEX for cspr

  COMPLEX*16 for zspr

  Array, DIMENSION at least ((n*(n + 1))/2). Before entry, with uplo = 'U' or 'u', the array ap must contain the upper triangular part of the symmetric matrix packed sequentially, column-by-column, so that `ap(1)` contains A(1,1), `ap(2)` and `ap(3)` contain A(1, 2) and A(2,2) respectively, and so on.

  Before entry, with uplo = 'L' or 'l', the array ap must contain the lower triangular part of the symmetric matrix packed sequentially, column-by-column, so that `ap(1)` contains a(1,1), `ap(2)` and `ap(3)` contain a(2,1) and a(3,1) respectively, and so on.

  Note that the imaginary parts of the diagonal elements need not be set, they are assumed to be zero, and on exit they are set to zero.

## Output Parameters

ap

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

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

Parent topic: Auxiliary Routines