PDSYR2K and PZSYR2K compute one of the following rank-2k updates:
PZHER2K computes one of the following rank-2k updates:
where, in the formulas above:
In the following two cases, no computation is performed and the subroutine returns after doing some parameter checking:
A, B, C, alpha | beta | Subprogram |
Long-precision real | Long-precision real | PDSYR2K |
Long-precision complex | Long-precision complex | PZSYR2K |
Long-precision complex | Long-precision real | PZHER2K |
Fortran | CALL PDSYR2K | PZSYR2K | PZHER2K (uplo, trans, n, k, alpha, a, ia, ja, desc_a, b, ib, jb, desc_b, beta, c, ic, jc, desc_c) |
C and C++ | pdsyr2k | pzsyr2k | pzher2k (uplo, trans, n, k, alpha, a, ia, ja, desc_a, b, ib, jb, desc_b, beta, c, ic, jc, desc_c); |
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'.
If trans = 'N', A and B are used.
If trans = 'T', AT and BT are used.
If trans = 'C', AH and BH are used.
Scope: global
Specified as: a single character, where:
For PDSYR2K, it must be 'N', 'T', or 'C'.
For PZSYR2K, it must be 'N' or 'T'.
For PZHER2K, it must be 'N' or 'C'.
If trans = 'N', it is the number of rows in submatrices A and B used in the computation.
If trans = 'T' or 'C', it is the number of columns in submatrices A and B used in the computation.
Scope: global
Specified as: a fullword integer; n >= 0.
If trans = 'N', it is the number of columns in submatrices A and B used in the computation.
If trans = 'T' or 'C', it is the number of rows in submatrices A and B used in the computation.
Scope: global
Specified as: a fullword integer; k >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 52.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 52. Details about the 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:
If trans = 'N', then ia+n-1 <= M_A.
If trans = 'T' or 'C', then ia+k-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A, and:
If trans = 'N', then ja+k-1 <= N_A.
If trans = 'T' or 'C', then 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 or k = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix |
If n = 0 or k = 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
Specified as: an LLD_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 52. Details about the block-cyclic data distribution of global matrix B are stored in desc_b.
Scope: global
Specified as: a fullword integer; 1 <= ib <= M_B, and:
If trans = 'N', then ib+n-1 <= M_B.
If trans = 'T' or 'C', then ib+k-1 <= M_B.
Scope: global
Specified as: a fullword integer; 1 <= jb <= N_B, and:
If trans = 'N', then jb+k-1 <= N_B.
If trans = 'T' or 'C', then jb+n-1 <= N_B.
desc_b | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_B | Descriptor type | DTYPE_B=1 | Global |
2 | CTXT_B | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_B | Number of rows in the global matrix |
If n = 0 or k = 0: M_B >= 0 Otherwise: M_B >= 1 | Global |
4 | N_B | Number of columns in the global matrix |
If n = 0 or k = 0: N_B >= 0 Otherwise: N_B >= 1 | Global |
5 | MB_B | Row block size | MB_B >= 1 | Global |
6 | NB_B | Column block size | NB_B >= 1 | Global |
7 | RSRC_B | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_B < p | Global |
8 | CSRC_B | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_B < q | Global |
9 | LLD_B | The leading dimension of the local array | LLD_B >= max(1,LOCp(M_B)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: global
Specified as: a number of the data type indicated in Table 52.
When beta is zero, C need not be set on input.
Scope: local
Specified as: an LLD_C by (at least) LOCq(N_C) array, containing numbers of the data type indicated in Table 52. Details about the block-cyclic data distribution of global matrix C are stored in desc_c.
Scope: global
Specified as: a fullword integer; 1 <= ic <= M_C and ic+n-1 <= M_C.
Scope: global
Specified as: a fullword integer; 1 <= jc <= N_C and jc+n-1 <= N_C.
desc_c | Name | Description | Limits | Scope |
---|---|---|---|---|
1 | DTYPE_C | Descriptor type | DTYPE_C=1 | Global |
2 | CTXT_C | BLACS context | Valid value, as returned by BLACS_GRIDINIT or BLACS_GRIDMAP | Global |
3 | M_C | Number of rows in the global matrix |
If n = 0: M_C >= 0 Otherwise: M_C >= 1 | Global |
4 | N_C | Number of columns in the global matrix |
If n = 0: N_C >= 0 Otherwise: N_C >= 1 | Global |
5 | MB_C | Row block size | MB_C >= 1 | Global |
6 | NB_C | Column block size | NB_C >= 1 | Global |
7 | RSRC_C | The process row of the p × q grid over which the first row of the global matrix is distributed | 0 <= RSRC_C < p | Global |
8 | CSRC_C | The process column of the p × q grid over which the first column of the global matrix is distributed | 0 <= CSRC_C < q | Global |
9 | LLD_C | The leading dimension of the local array | LLD_C >= max(1,LOCp(M_C)) | Local |
Specified as: an array of (at least) length 9, containing fullword integers.
Scope: local
Returned as: an LLD_C by (at least) LOCq(N_C) array, containing numbers of the data type indicated in Table 52.
then the block column offset of A must be equal to the block column offset of B; that is, mod(ja-1, NB_A) = mod(jb-1, NB_B).
then the block row offset of A must be equal to the block row offset of B; that is, mod(ia-1, MB_A) = mod(ib-1, MB_B)
then you must follow these rules:
or if all the following are true:
then you must follow these rules:
None
Unable to allocate work space
Stage 5: If n <> 0 and k <> 0:
If n <> 0:
Stage 6: If C is contained within a single block, that is:
and:
then:
and NB_A <> NB_B.
and MB_A <> MB_B.
If C is not contained within a single block, or if C is contained within a single block and:
then:
If trans = 'N':
If trans = 'T' or 'C':
In all cases:
If trans = 'N':
If trans = 'T' or 'C':
This example computes C = alphaATB+alphaBTA+betaC 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 TRANS N K ALPHA A IA JA DESC_A B IB JB | | | | | | | | | | | | CALL PDSYR2K( 'U' , 'T' , 9 , 8 , 1.0D0 , A , 1 , 1 , DESC_A , B , 1 , 1 , DESC_B BETA C IC JC DESC_C | | | | | | DESC_B , 0.0D0 , C , 1 , 1 , DESC_C )
| Desc_A | Desc_B | Desc_C |
---|---|---|---|
DTYPE_ | 1 | 1 | 1 |
CTXT_ | icontxt(IOBG29) | icontxt(IOBG29) | icontxt(IOBG29) |
M_ | 8 | 8 | 9 |
N_ | 9 | 9 | 9 |
MB_ | 2 | 2 | 4 |
NB_ | 4 | 4 | 4 |
RSRC_ | 0 | 0 | 0 |
CSRC_ | 0 | 0 | 0 |
LLD_ | See below(EPSSL29) | See below(EPSSL29) | See below(EPSSL29) |
Notes:
|
Global general 8 × 9 matrix A with block size 2 × 4:
B,D 0 1 2 * * 0 | 0.0 -1.0 -1.0 0.0 | 0.0 0.0 0.0 0.0 | 1.0 | | 0.0 1.0 0.0 1.0 | 0.0 1.0 0.0 1.0 | 1.0 | | ---------------------|-----------------------|------ | 1 | 0.0 0.0 -1.0 -1.0 | 0.0 0.0 1.0 0.0 | 1.0 | | 0.0 1.0 0.0 -1.0 | 1.0 1.0 0.0 1.0 | 1.0 | | ---------------------|-----------------------|------ | 2 | 1.0 0.0 0.0 0.0 | -1.0 0.0 0.0 0.0 | 1.0 | | 1.0 0.0 0.0 0.0 | 1.0 1.0 0.0 0.0 | 1.0 | | ---------------------|-----------------------|------ | 3 | 0.0 0.0 -1.0 0.0 | -1.0 0.0 0.0 0.0 | 1.0 | | -1.0 0.0 0.0 0.0 | 0.0 0.0 -1.0 0.0 | 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1 -----|---------------------------|---------------------- | 0.0 -1.0 -1.0 0.0 1.0 | 0.0 0.0 0.0 0.0 | 0.0 1.0 0.0 1.0 1.0 | 0.0 1.0 0.0 1.0 0 | 1.0 0.0 0.0 0.0 1.0 | -1.0 0.0 0.0 0.0 | 1.0 0.0 0.0 0.0 1.0 | 1.0 1.0 0.0 0.0 -----|---------------------------|---------------------- | 0.0 0.0 -1.0 -1.0 1.0 | 0.0 0.0 1.0 0.0 | 0.0 1.0 0.0 -1.0 1.0 | 1.0 1.0 0.0 1.0 1 | 0.0 0.0 -1.0 0.0 1.0 | -1.0 0.0 0.0 0.0 | -1.0 0.0 0.0 0.0 1.0 | 0.0 0.0 -1.0 0.0
Global general 8 × 9 matrix B with block size 2 × 4:
B,D 0 1 2 * * 0 | 0.0 1.0 1.0 0.0 | 0.0 0.0 0.0 0.0 | -1.0 | | 0.0 -1.0 0.0 -1.0 | 0.0 -1.0 0.0 -1.0 | -1.0 | | ---------------------|-----------------------|------ | 1 | 0.0 0.0 1.0 1.0 | 0.0 0.0 -1.0 0.0 | -1.0 | | 0.0 -1.0 0.0 1.0 | -1.0 -1.0 0.0 -1.0 | -1.0 | | ---------------------|-----------------------|------ | 2 | -1.0 0.0 0.0 0.0 | 1.0 0.0 0.0 0.0 | -1.0 | | -1.0 0.0 0.0 0.0 | -1.0 -1.0 0.0 0.0 | -1.0 | | ---------------------|-----------------------|------ | 3 | 0.0 0.0 1.0 0.0 | 1.0 0.0 0.0 0.0 | -1.0 | | 1.0 0.0 0.0 0.0 | 0.0 0.0 1.0 0.0 | -1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for B:
p,q | 0 | 1 -----|---------------------------|---------------------- | 0.0 1.0 1.0 0.0 -1.0 | 0.0 0.0 0.0 0.0 | 0.0 -1.0 0.0 -1.0 -1.0 | 0.0 -1.0 0.0 -1.0 0 | -1.0 0.0 0.0 0.0 -1.0 | 1.0 0.0 0.0 0.0 | -1.0 0.0 0.0 0.0 -1.0 | -1.0 -1.0 0.0 0.0 -----|---------------------------|---------------------- | 0.0 0.0 1.0 1.0 -1.0 | 0.0 0.0 -1.0 0.0 | 0.0 -1.0 0.0 1.0 -1.0 | -1.0 -1.0 0.0 -1.0 1 | 0.0 0.0 1.0 0.0 -1.0 | 1.0 0.0 0.0 0.0 | 1.0 0.0 0.0 0.0 -1.0 | 0.0 0.0 1.0 0.0
Output:
Global real symmetric matrix C of order 9 with block size 4 × 4:
B,D 0 1 2 * * | -6.0 0.0 0.0 0.0 | 0.0 -2.0 -2.0 0.0 | -2.0 | | . -6.0 -2.0 0.0 | -2.0 -4.0 0.0 -4.0 | -2.0 | 0 | . . -6.0 -2.0 | -2.0 0.0 2.0 0.0 | 6.0 | | . . . -6.0 | 2.0 0.0 2.0 0.0 | 2.0 | | ---------------------|-----------------------|------- | | . . . . | -8.0 -4.0 0.0 -2.0 | 0.0 | | . . . . | . -6.0 0.0 -4.0 | -6.0 | 1 | . . . . | . . -4.0 0.0 | 0.0 | | . . . . | . . . -4.0 | -4.0 | | ---------------------|-----------------------|------- | 2 | . . . . | . . . . | -16.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1 -----|----------------------------|---------------------- | -6.0 0.0 0.0 0.0 -2.0 | 0.0 -2.0 -2.0 0.0 | . -6.0 -2.0 0.0 -2.0 | -2.0 -4.0 0.0 -4.0 0 | . . -6.0 -2.0 6.0 | -2.0 0.0 2.0 0.0 | . . . -6.0 2.0 | 2.0 0.0 2.0 0.0 | . . . . -16.0 | . . . . -----|----------------------------|---------------------- | . . . . 0.0 | -8.0 -4.0 0.0 -2.0 | . . . . -6.0 | . -6.0 0.0 -4.0 1 | . . . . 0.0 | . . -4.0 0.0 | . . . . -4.0 | . . . -4.0
This example computes C = alphaATB+alphaBTA+betaC 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 TRANS N K ALPHA A IA JA DESC_A B IB JB | | | | | | | | | | | | CALL PZSYR2K( 'U' , 'T' , 7 , 8 , ALPHA , A , 1 , 1 , DESC_A , B , 1 , 1 , DESC_B BETA C IC JC DESC_C | | | | | | DESC_B , BETA , C , 1 , 1 , DESC_C ) ALPHA = (1.0,0.0) BETA = (0.0,0.0)
| Desc_A | Desc_B | Desc_C |
---|---|---|---|
DTYPE_ | 1 | 1 | 1 |
CTXT_ | icontxt(IOBG30) | icontxt(IOBG30) | icontxt(IOBG30) |
M_ | 8 | 8 | 7 |
N_ | 7 | 7 | 7 |
MB_ | 2 | 2 | 3 |
NB_ | 3 | 3 | 3 |
RSRC_ | 0 | 0 | 0 |
CSRC_ | 0 | 0 | 0 |
LLD_ | See below(EPSSL30) | See below(EPSSL30) | See below(EPSSL30) |
Notes:
|
Global general 8 × 7 matrix A with block size 2 × 3:
B,D 0 1 2
* *
0 | ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|--------------------------------------|------------ |
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|--------------------------------------|------------ |
2 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|--------------------------------------|------------ |
3 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1
-----|-------------------------------------------------|-------------------------------------
| ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0)
0 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0)
-----|-------------------------------------------------|-------------------------------------
| ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 1.0, 2.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0)
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
Global general 8 × 7 matrix B with block size 2 × 3:
B,D 0 1 2
* *
0 | ( 0.0,-2.0) ( 1.0,-1.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) |
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) | (-1.0,-3.0) ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) |
| ------------------------------------|--------------------------------------|------------ |
1 | ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) | ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) | (-1.0,-3.0) |
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) | ( 1.0,-1.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) |
| ------------------------------------|--------------------------------------|------------ |
2 | (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) |
| (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) |
| ------------------------------------|--------------------------------------|------------ |
3 | ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) |
| ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 1.0,-1.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for B:
p,q | 0 | 1
-----|-------------------------------------------------|-------------------------------------
| ( 0.0,-2.0) ( 1.0,-1.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | (-1.0,-3.0) ( 0.0,-2.0) (-1.0,-3.0)
0 | (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0)
| (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) (-1.0,-3.0) (-1.0,-3.0)
-----|-------------------------------------------------|-------------------------------------
| ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) (-1.0,-3.0) | ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0)
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 1.0,-1.0) (-1.0,-3.0) (-1.0,-3.0)
1 | ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0)
| ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
Output:
Global complex symmetric matrix C of order 7 with block size 3 × 3:
B,D 0 1 2
* *
| ( 38.0,-18.0) ( 38.0, -6.0) ( 26.0, 6.0) | ( 32.0, 0.0) ( 35.0, -3.0) ( 44.0,-16.0) | ( 35.0, -7.0) |
0 | . ( 38.0,-18.0) ( 26.0, 2.0) | ( 32.0, 0.0) ( 35.0, -7.0) ( 44.0,-20.0) | ( 35.0, -3.0) |
| . . ( 14.0, 6.0) | ( 20.0, 8.0) ( 23.0, 5.0) ( 32.0, 0.0) | ( 23.0, 13.0) |
| ------------------------------------------|-------------------------------------------|-------------- |
| . . . | ( 26.0, -6.0) ( 29.0, 7.0) ( 38.0, -6.0) | ( 29.0, 7.0) |
1 | . . . | . ( 32.0,-16.0) ( 41.0,-17.0) | ( 32.0, 0.0) |
| . . . | . . ( 50.0,-30.0) | ( 41.0, -9.0) |
| ------------------------------------------|-------------------------------------------|-------------- |
2 | . . . | . . , | ( 32.0, -8.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|----------------------------------------------------------|-------------------------------------------
| ( 38.0, -18.0) ( 38.0, -6.0) ( 26.0, 6.0) ( 35.0, -7.0) | ( 32.0, 0.0) ( 35.0, -3.0) ( 44.0,-16.0)
| . ( 38.0,-18.0) ( 26.0, 2.0) ( 35.0, -3.0) | ( 32.0, 0.0) ( 35.0, -7.0) ( 44.0,-20.0)
0 | . . ( 14.0, 6.0) ( 23.0, 13.0) | ( 20.0, 8.0) ( 23.0, 5.0) ( 32.0, 0.0)
| . . . ( 32.0, -8.0) | . . .
-----|----------------------------------------------------------|-------------------------------------------
| . . . ( 29.0, 7.0) | ( 26.0, -6.0) ( 29.0, 7.0) ( 38.0, -6.0)
1 | . . . ( 32.0, 0.0) | . ( 32.0,-16.0) ( 41.0,-17.0)
| . . . ( 41.0, -9.0) | . . ( 50.0,-30.0)
This example computes:
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 TRANS N K ALPHA A IA JA DESC_A B IB JB | | | | | | | | | | | | CALL PZHER2K( 'U' , 'C' , 7 , 8 , ALPHA , A , 1 , 1 , DESC_A , B , 1 , 1 , DESC_B BETA C IC JC DESC_C | | | | | | DESC_B , BETA , C , 1 , 1 , DESC_C ) ALPHA = (1.0,0.0) BETA = 0.0
| Desc_A | Desc_B | Desc_C |
---|---|---|---|
DTYPE_ | 1 | 1 | 1 |
CTXT_ | icontxt(IOBG31) | icontxt(IOBG31) | icontxt(IOBG31) |
M_ | 8 | 8 | 7 |
N_ | 7 | 7 | 7 |
MB_ | 2 | 2 | 3 |
NB_ | 3 | 3 | 3 |
RSRC_ | 0 | 0 | 0 |
CSRC_ | 0 | 0 | 0 |
LLD_ | See below(EPSSL31) | See below(EPSSL31) | See below(EPSSL31) |
Notes:
|
Global general 8 × 7 matrix A with block size 2 × 3:
B,D 0 1 2
* *
0 | ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|--------------------------------------|------------ |
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) |
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|--------------------------------------|------------ |
2 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0) | ( 0.0, 1.0) |
| ------------------------------------|--------------------------------------|------------ |
3 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) |
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1
-----|-------------------------------------------------|-------------------------------------
| ( 0.0, 1.0) (-1.0, 0.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 1.0, 2.0) ( 0.0, 1.0) ( 1.0, 2.0)
0 | ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0) | ( 0.0, 1.0) ( 1.0, 2.0) ( 1.0, 2.0)
-----|-------------------------------------------------|-------------------------------------
| ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 1.0, 2.0) | (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0)
| ( 0.0, 1.0) ( 1.0, 2.0) ( 0.0, 1.0) ( 0.0, 1.0) | (-1.0, 0.0) ( 1.0, 2.0) ( 1.0, 2.0)
1 | ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0) | ( 0.0, 1.0) (-1.0, 0.0) ( 0.0, 1.0)
| (-1.0, 0.0) ( 0.0, 1.0) ( 0.0, 1.0) (-1.0, 0.0) | ( 0.0, 1.0) ( 0.0, 1.0) ( 0.0, 1.0)
Global general 8 × 7 matrix B with block size 2 × 3:
B,D 0 1 2
* *
0 | ( 0.0,-2.0) ( 1.0,-1.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) |
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) | (-1.0,-3.0) ( 0.0,-2.0) (-1.0,-3.0) | ( 0.0,-2.0) |
| ------------------------------------|--------------------------------------|------------ |
1 | ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) | ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) | (-1.0,-3.0) |
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) | ( 1.0,-1.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) |
| ------------------------------------|--------------------------------------|------------ |
2 | (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) |
| (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) (-1.0,-3.0) (-1.0,-3.0) | ( 0.0,-2.0) |
| ------------------------------------|--------------------------------------|------------ |
3 | ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) |
| ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 1.0,-1.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for B:
p,q | 0 | 1
-----|-------------------------------------------------|-------------------------------------
| ( 0.0,-2.0) ( 1.0,-1.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | (-1.0,-3.0) ( 0.0,-2.0) (-1.0,-3.0)
0 | (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0)
| (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 0.0,-2.0) (-1.0,-3.0) (-1.0,-3.0)
-----|-------------------------------------------------|-------------------------------------
| ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) (-1.0,-3.0) | ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0)
| ( 0.0,-2.0) (-1.0,-3.0) ( 0.0,-2.0) ( 0.0,-2.0) | ( 1.0,-1.0) (-1.0,-3.0) (-1.0,-3.0)
1 | ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0) | ( 0.0,-2.0) ( 1.0,-1.0) ( 0.0,-2.0)
| ( 1.0,-1.0) ( 0.0,-2.0) ( 0.0,-2.0) ( 1.0,-1.0) | ( 0.0,-2.0) ( 0.0,-2.0) ( 0.0,-2.0)
Output:
Global complex Hermitian matrix C of order 7 with block size 3 × 3:
B,D 0 1 2
* *
| (-50.0, 0.0) (-38.0, 0.0) (-26.0,-12.0) | (-32.0, -6.0) (-35.0, -3.0) (-48.0, 6.0) | (-39.0, -3.0) |
0 | . (-50.0, 0.0) (-30.0,-12.0) | (-32.0, -6.0) (-39.0, -3.0) (-52.0, 6.0) | (-35.0, -3.0) |
| . . (-26.0, 0.0) | (-24.0, 6.0) (-27.0, 9.0) (-32.0, 18.0) | (-19.0, 9.0) |
| ------------------------------------------|-------------------------------------------|-------------- |
| . . . | (-38.0, 0.0) (-25.0, 3.0) (-38.0, 12.0) | (-25.0, 3.0) |
1 | . . . | . (-48.0, 0.0) (-49.0, 9.0) | (-32.0, 0.0) |
| . . . | . . (-62.0, 0.0) | (-41.0, -9.0) |
| ------------------------------------------|-------------------------------------------|-------------- |
2 | . . . | . . , | (-40.0, 0.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for C:
p,q | 0 | 1
-----|----------------------------------------------------------|-------------------------------------------
| (-50.0, 0.0) (-38.0, 0.0) (-26.0,-12.0) (-39.0, -3.0) | (-32.0, -6.0) (-35.0, -3.0) (-48.0, 6.0)
| . (-50.0, 0.0) (-30.0,-12.0) (-35.0, -3.0) | (-32.0, -6.0) (-39.0, -3.0) (-52.0, 6.0)
0 | . . (-26.0, 0.0) (-19.0, 9.0) | (-24.0, 6.0) (-27.0, 9.0) (-32.0, 18.0)
| . . . (-40.0, 0.0) | . . .
-----|----------------------------------------------------------|-------------------------------------------
| . . . (-25.0, 3.0) | (-38.0, 0.0) (-25.0, 3.0) (-38.0, 12.0)
1 | . . . (-32.0, 0.0) | . (-48.0, 0.0) (-49.0, 9.0)
| . . . (-41.0, -9.0) | . . (-62.0, 0.0)