PDSYR computes the following rank-one update:
PZHER computes the following rank-one update:
where, in the formula above:
and:
In the following two cases, no computation is performed and the subroutine returns after doing some parameter checking:
A, x | alpha | Subprogram |
Long-precision real | Long-precision real | PDSYR |
Long-precision complex | Long-precision real | PZHER |
Fortran | CALL PDSYR | PZHER (uplo, n, alpha, x, ix, jx, desc_x, incx, a, ia, ja, desc_a) |
C and C++ | pdsyr | pzher (uplo, n, alpha, x, ix, jx, desc_x, incx, a, ia, ja, desc_a); |
If uplo = 'U', the upper triangular part is referenced.
If uplo = 'L', the lower triangular part is referenced.
Scope: global
Specified as: a single character; uplo = 'U' or 'L'.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 40.
Scope: local
Specified as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 40. Details about the block-cyclic data distribution of the global matrix X are stored in desc_x.
If incx = M_X, it indicates which row of global matrix X is used for vector x.
If incx = 1 and incx <> M_X, it is the row index of global matrix X, identifying the first element of vector x.
Scope: global
Specified as: a fullword integer; 1 <= ix <= M_X and:
If incx = 1 and incx <> M_X, then ix+n-1 <= M_X.
If incx = M_X, it is the column index of global matrix X, identifying the first element of vector x.
If incx = 1 and incx <> M_X, it indicates which column of global matrix X is used for vector x.
Scope: global
Specified as: a fullword integer; 1 <= jx <= N_X and:
If incx = M_X, then jx+n-1 <= N_X.
desc_x | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_X | Descriptor type | DTYPE_X=1 | Global |
2 | CTXT_X | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_X | Number of rows in the global matrix |
If n = 0: M_X >= 0 Otherwise: M_X >= 1 | Global |
4 | N_X | Number of columns in the global matrix |
If n = 0: N_X >= 0 Otherwise: N_X >= 1 | Global |
5 | MB_X | Row block size | MB_X >= 1 | Global |
6 | NB_X | Column block size | NB_X >= 1 | Global |
7 | RSRC_X | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_X < p | Global |
8 | CSRC_X | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_X < q | Global |
9 | LLD_X | The leading dimension of the local array | LLD_X >= max(1,LOCp(M_X)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a fullword integer; incx = 1 or incx = M_X, where:
If incx = M_X, then x is a row-distributed vector.
If incx = 1 and incx <> M_X, then x is a column-distributed vector.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 40. Details about the square block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: global
Specified as: a fullword integer; 1 <= ia <= M_A and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+n-1 <= N_A.
desc_a | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_A | Descriptor type | DTYPE_A=1 | Global |
2 | CTXT_A | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_A | Number of rows in the global matrix |
If n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0: N_A >= 0 Otherwise: N_A >= 1 | Global |
5 | MB_A | Row block size | MB_A >= 1 | Global |
6 | NB_A | Column block size | NB_A >= 1 | Global |
7 | RSRC_A | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_A < p | Global |
8 | CSRC_A | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_A < q | Global |
9 | LLD_A | The leading dimension of the local array | LLD_A >= max(1,LOCp(M_A)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 40.
None
Unable to allocate work space
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
This example computes A = alphaxxT+A using a 2 × 2 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO N ALPHA X IX JX DESC_X INCX A IA JA DESC_A | | | | | | | | | | | | CALL PDSYR( 'L' , 9 , 1.0D0 , X , 1 , 1 , DESC_X , 1 , A , 1 , 1 , DESC_A)
| Desc_A | Desc_X |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBGC9) | icontxt(IOBGC9) |
M_ | 9 | 9 |
N_ | 9 | 1 |
MB_ | 4 | 4 |
NB_ | 4 | 1 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(EPSSLA9) | See below(EPSSLA9) |
Notes:
|
Global real symmetric matrix A of order 9 with block size 4 × 4:
B,D 0 1 2 * * | 1.0 . . . | . . . . | . | | 2.0 12.0 . . | . . . . | . | 0 | 3.0 13.0 23.0 . | . . . . | . | | 4.0 14.0 24.0 34.0 | . . . . | . | | -------------------------|---------------------------|------- | | 5.0 15.0 25.0 35.0 | 45.0 . . . | . | | 6.0 16.0 26.0 36.0 | 46.0 56.0 . . | . | 1 | 7.0 17.0 27.0 37.0 | 47.0 57.0 67.0 . | . | | 8.0 18.0 28.0 38.0 | 48.0 58.0 68.0 78.0 | . | | -------------------------|---------------------------|------- | 2 | 9.0 19.0 29.0 39.0 | 49.0 59.0 69.0 79.0 | 89.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|-------------------------- | 1.0 . . . . | . . . . | 2.0 12.0 . . . | . . . . 0 | 3.0 13.0 23.0 . . | . . . . | 4.0 14.0 24.0 34.0 . | . . . . | 9.0 19.0 29.0 39.0 89.0 | 49.0 59.0 69.0 79.0 -----|--------------------------------|-------------------------- | 5.0 15.0 25.0 35.0 . | 45.0 . . . | 6.0 16.0 26.0 36.0 . | 46.0 56.0 . . 1 | 7.0 17.0 27.0 37.0 . | 47.0 57.0 67.0 . | 8.0 18.0 28.0 38.0 . | 48.0 58.0 68.0 78.0
Global vector x of size 9 × 1 with block size 4:
B,D 0 * * | 1.0 | | 1.0 | 0 | 1.0 | | 1.0 | | ---- | | 1.0 | | 1.0 | 1 | 1.0 | | 1.0 | | ---- | 2 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for x:
p,q | 0 -----|------ | 1.0 | 1.0 0 | 1.0 | 1.0 | 1.0 -----|------ | 1.0 | 1.0 1 | 1.0 | 1.0
Output:
Global real symmetric matrix A of order 9 with block size 4 × 4:
B,D 0 1 2 * * | 2.0 . . . | . . . . | . | | 3.0 13.0 . . | . . . . | . | 0 | 4.0 14.0 24.0 . | . . . . | . | | 5.0 15.0 25.0 35.0 | . . . . | . | | -------------------------|---------------------------|------- | | 6.0 16.0 26.0 36.0 | 46.0 . . . | . | | 7.0 17.0 27.0 37.0 | 47.0 57.0 . . | . | 1 | 8.0 18.0 28.0 38.0 | 48.0 58.0 68.0 . | . | | 9.0 19.0 29.0 39.0 | 49.0 59.0 69.0 79.0 | . | | -------------------------|---------------------------|------- | 2 | 10.0 20.0 30.0 40.0 | 50.0 60.0 70.0 80.0 | 90.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|-------------------------- | 2.0 . . . . | . . . . | 3.0 13.0 . . . | . . . . 0 | 4.0 14.0 24.0 . . | . . . . | 5.0 15.0 25.0 35.0 . | . . . . | 10.0 20.0 30.0 40.0 90.0 | 50.0 60.0 70.0 80.0 -----|--------------------------------|-------------------------- | 6.0 16.0 26.0 36.0 . | 46.0 . . . | 7.0 17.0 27.0 37.0 . | 47.0 57.0 . . 1 | 8.0 18.0 28.0 38.0 . | 48.0 58.0 68.0 . | 9.0 19.0 29.0 39.0 . | 49.0 59.0 69.0 79.0
This example computes A = alphaxxH+A using a 2 × 2 process grid.
ORDER = 'R' NPROW = 2 NPCOL = 2 CALL BLACS_GET (0, 0, ICONTXT) CALL BLACS_GRIDINIT(ICONTXT, ORDER, NPROW, NPCOL) CALL BLACS_GRIDINFO(ICONTXT, NPROW, NPCOL, MYROW, MYCOL) UPLO N ALPHA X IX JX DESC_X INCX A IA JA DESC_A | | | | | | | | | | | | CALL PZHER( 'L' , 3 , 1.0D0 , X , 1 , 1 , DESC_X , 1 , A , 1 , 1 , DESC_A)
| Desc_A | Desc_X |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG10) | icontxt(IOBG10) |
M_ | 3 | 3 |
N_ | 3 | 1 |
MB_ | 2 | 2 |
NB_ | 2 | 1 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(EPSSL10) | See below(EPSSL10) |
Notes:
|
Global complex Hermitian matrix A of order 3 with block size 2 × 2:
B,D 0 1 * * | ( 1.0, 0.0) . | . | 0 | ( 3.0,-5.0) ( 7.0, 0.0) | . | | -------------------------|------------ | 1 | ( 2.0, 3.0) ( 4.0, 8.0) | ( 6.0, 0.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 -----|-------------------------|-------------------------- | ( 1.0, . ) . | . 0 | ( 3.0,-5.0) ( 7.0, . ) | . -----|-------------------------|-------------------------- 1 | ( 2.0, 3.0) ( 4.0, 8.0) | ( 6.0, . ) .
Global vector x of size 3 × 1 with block size 2:
B,D 0 * * | (1.0,2.0) | 0 | (4.0,0.0) | | --------- | 1 | (3.0,4.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 | -- -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11
Local arrays for x:
p,q | 0 -----|----------- | (1.0,2.0) 0 | (4.0,0.0) -----|----------- 1 | (3.0,4.0)
Output:
Global complex Hermitian matrix A of order 3 with block size 2 × 2:
B,D 0 1 * * | ( 6.0, 0.0) . | . | 0 | ( 7.0,-13.0) (23.0, 0.0) | . | | -------------------------|-------------| 1 | (13.0, 1.0) (16.0,24.0) | (31.0, 0.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1 -----|--------------------------|------------- | ( 6.0, 0.0) . | . 0 | ( 7.0,-13.0) (23.0, 0.0) | . -----|--------------------------|------------- 1 | (13.0, 1.0) (16.0,24.0) | (31.0, 0.0)