SSPR/DSPR/CHPR/ZHPR |
Lower triangular storage
If the lower triangle of A is
11
21 22
31 32 33
41 42 43 44
then A is packed
k | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
ap(k) | 11 | 21 | 31 | 41 | 22 | 32 | 42 | 33 | 43 | 44 |
|
|
|
|
|
|
|
|
|
|
|
Lower triangular matrix element aij is stored in array element ap(i+((j−1)⋅(2n−j))/2).
Usage | VECLIB: |
|
| CHARACTER*1 | uplo |
| INTEGER*4 | n, incx |
| REAL*4 | alpha, ap(lenap), x(lenx) |
| CALL SSPR(uplo, n, alpha, x, incx, ap) | |
| CHARACTER*1 | uplo |
| INTEGER*4 | n, incx |
| REAL*8 | alpha, ap(lenap), x(lenx) |
| CALL DSPR(uplo, n, alpha, x, incx, ap) | |
| CHARACTER*1 | uplo |
| INTEGER*4 | n, incx |
| REAL*4 | alpha |
| COMPLEX*8 | ap(lenap), x(lenx) |
| CALL CHPR(uplo, n, alpha, x, incx, ap) | |
| CHARACTER*1 | uplo |
| INTEGER*4 | n, incx |
| REAL*8 | alpha |
| COMPLEX*16 | ap(lenap), x(lenx) |
CALL ZHPR(uplo, n, alpha, x, incx, ap)
Chapter 3 Basic Matrix Operations 255