HP MLIB User's Guide Vol. 1 7th Ed.
278 HP MLIB User’s Guide
SSYR/DSYR/CHER/ZHER Rank-1 update
Notes These subprograms conform to specifications of the Level 2 BLAS.
If an error in the arguments is detected, the subprograms call error handler
XERBLA, which writes an error message onto the standard error file and
terminates execution. The standard version of XERBLA (refer to the end of this
chapter) can be replaced with a user-supplied version to change the error
procedure. Error conditions are
uplo ≠ ’L’ or ’l’ or ’U’ or ’u’
n < 0
lda < max(n,1)
incx = 0
Actual character arguments in a subroutine call can be longer than the
corresponding dummy arguments. Therefore, readability of the CALL
statement may be improved by coding the uplo argument as ’LOWER’ for ’L’ or
’UPPER’ for ’U’. Refer to “Example 2.”
Example 1 Apply a REAL*4 symmetric rank-1 update xx
T
to A, where A is a 9-by-9 real
symmetric matrix whose upper triangle is stored in the upper triangle of an
array A whose dimensions are 10-by-10, and x is a real vector 9 elements long
stored in an array X of dimension 10.
CHARACTER*1 UPLO
INTEGER*4 N,LDA,INCX
REAL*4 ALPHA,A(10,10),X(10)
UPLO = ’U’
N = 9
ALPHA = 1.0
LDA = 10
INCX = 1
CALL SSYR (UPLO,N,ALPHA,X,INCX,A,LDA)
Example 2 Apply a COMPLEX*8 Hermitian rank-1 update −2xx* to A, where A is a 9-by-9
complex Hermitian matrix whose lower triangle is stored in the lower triangle
of an array A whose dimensions are 10-by-10, and x is a complex vector 9
elements long stored in an array X of dimension 10.
INTEGER*4 N,LDA
COMPLEX*8 A(10,10),X(10)
N = 9
LDA = 10
CALL CHER (’LOWER’,N,-2.0,X,1,A,LDA)