{S,D}SPR (uplo, n, alpha, x, incx, ap) {C,Z}HPR (uplo, n, alpha, x, incx, ap)
uplo character*1 On entry, specifies whether the upper- or lower- triangular part of the matrix A is supplied in the packed array AP: If uplo = 'U' or 'u', the upper-triangular part of A is supplied. If uplo = 'L' or 'l', the lower-triangular part of A is supplied. On exit, uplo is unchanged. n integer*4 On entry, the order of the matrix A; n >= 0. On exit, n is unchanged. alpha real*4 | real*8 | complex*8 | complex*16 On entry, the scalar alpha*. On exit, alpha is unchanged. x real*4 | real*8 | complex*8 | complex*16 On entry, a one-dimensional array X of length at least (1+(n-1)*|incx|). Array X contains the vector x. On exit, x is unchanged. incx integer*4 On entry, the increment for the elements of X; incx must not equal zero. On exit, incx is unchanged. ap real*4 | real*8 | complex*8 | complex*16 On entry, a one-dimensional array AP of length at least n(n + 1)/2 If uplo specifies the upper triangular part of the matrix A, the array contains those elements of the matrix, packed sequentially, column by column, so that AP(1) contains a(11), AP(2) and AP(3) contain a(12) and a(22) respectively, and so on. If uplo specifies the lower triangular part to the matrix A, the array contains those elements of the matrix, also packed sequentially, so that AP(1) contains a(11), AP(2) and AP(3) contain a(21) and a(31) respectively, and so on. For CHPR and ZHPR routines, the imaginary parts of the diagonal elements are not accessed, need not be set, and are assumed to be zero. On exit, ap is overwritten by the specified part of the updated matrix.
SSPR and DSPR perform the rank-one update of a real symmetric matrix stored in packed form: A = alpha*x*transp(x) + A CHPR and ZHPR perform the rank-one update of a complex Hermitian matrix stored in packed form: A = alpha*x*conjug_transp(x) + A alpha is a scalar, x is vector with n elements, and A is an n by n matrix in packed form. In the case of SSPR and DSPR, matrix A is a symmetric matrix and in the case of CHPR and ZHPR, matrix A is a Hermitian matrix.
REAL*8 AP(500), X(30), Y(30), alpha INCX = 1 alpha = 1.0D0 N = 30 CALL DSPR('U',N,alpha,X,INCX,AP) This FORTRAN code computes the rank-1 update A = x*transp(x) + A where A is a real symmetric matrix, of order 30, with its upper- triangular part stored in packed form in AP.