PDTRSM perform one of the following solves for a triangular system of
equations with multiple right-hand sides, using scalar alpha, rectangular
matrix B, and triangular matrix A or its
transpose:
| Solution | Equation |
|
|---|---|---|
| 1. B<--alpha(A-1)B | AX = alphaB |
|
| 2. B<--alpha(A-T)B | ATX = alphaB |
|
| 3. B<--alphaB(A-1) | XA = alphaB |
|
| 4. B<--alphaB(A-T) | XAT = alphaB |
|
PZTRSM performs one of the following solves for a triangular system of
equations with multiple right-hand sides, using scalar alpha, rectangular
matrix B, and triangular matrix A, its transpose, or its
conjugate transpose:
| Solution | Equation |
|
|---|---|---|
| 1. B<--alpha(A-1)B | AX = alphaB |
|
| 2. B<--alpha(A-T)B | ATX = alphaB |
|
| 3. B<--alphaB(A-1) | XA = alphaB |
|
| 4. B<--alphaB(A-T) | XAT = alphaB |
|
| 5. B<--alpha(A-H)B | AHX = alphaB |
|
| 6. B<--alphaB(A-H) | XAH = alphaB |
|
where, in the formulas above:
Notes:
If m = 0 or n = 0, no computation is performed, and the subroutine returns after doing some parameter checking.
| alpha, A, B | Subprogram |
| Long-precision real | PDTRSM |
| Long-precision complex | PZTRSM |
| Fortran | CALL PDTRSM | PZTRSM (side, uplo, transa, diag, m, n, alpha, a, ia, ja, desc_a, b, ib, jb, desc_b) |
| C and C++ | pdtrsm | pztrsm (side, uplo, transa, diag, m, n, alpha, a, ia, ja, desc_a, b, ib, jb, desc_b); |
If side = 'L', A is to the left of B.
If side = 'R', A is to the right of B.
Scope: global
Specified as: a single character; side = 'L' or 'R'.
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 transa = 'N', A is used.
If transa = 'T', AT is used.
If transa = 'C', AH is used.
Scope: global
Specified as: a single character; transa = 'N', 'T', or 'C'.
If diag = 'U', A is a unit triangular matrix.
If diag = 'N', A is not a unit triangular matrix.
Scope: global
Specified as: a single character; diag = 'U' or 'N'.
If side = 'L', it is the number of rows and columns in submatrix A used in the computation.
Scope: global
Specified as: a fullword integer; m >= 0.
If side = 'R', it is the number of rows and columns in submatrix A used in the computation.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a number of the data type indicated in Table 50.
If side = 'L', numa = m
If side = 'R', numa = n
the leading LOCp(ia+numa-1) by LOCq(ja+numa-1) part of the local array A must contain the local pieces of the leading ia+numa-1 by ja+numa-1 part of the global matrix, and:
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 50. 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 ia+numa-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja <= N_A and ja+numa-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 side = 'L' and m = 0: M_A >= 0 If side = 'R' and n = 0: M_A >= 0 Otherwise: M_A >= 1 | Global |
| 4 | N_A | Number of columns in the global matrix |
If side = 'L' and m = 0: N_A >= 0 If side = 'R' and 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
Specified as: an LLD_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 50. 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 ib+m-1 <= M_B.
Scope: global
Specified as: a fullword integer; 1 <= jb <= N_B and 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 side = 'L' and m = 0: M_B >= 0 If side = 'R' and n = 0: M_B >= 0 Otherwise: M_B >= 1 | Global |
| 4 | N_B | Number of columns in the global matrix | N_B >= 1 | Global |
| 5 | MB_B | Row block size | MB_B >= 1 | Global |
| 6 | NB_B | Column block size |
If side = 'L' and m = 0: N_B >= 0 If side = 'R' and n = 0: N_B >= 0 Otherwise: N_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: local
Returned as: an LLD_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 50.
then the global triangular matrix A must be distributed using a square block-cyclic distribution; that is, MB_A = NB_A.
None
Unable to allocate work space
Stage 5: If A is not contained within a single block, that is, either of the following is true:
then:
If (m <> 0 or side <> 'L') and (n <> 0 or side <> 'R'):
where numa = m if side = 'L' and numa = n if side = 'R'.
If m <> 0 and n <> 0:
If A is not contained in a single block:
If side = 'L':
If side = 'R':
This example shows the solution B<--alpha(A-1)B 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)
SIDE UPLO TRANSA DIAG M N ALPHA A IA JA DESC_A
| | | | | | | | | | |
CALL PDTRSM( 'L' , 'U' , 'N' , 'N' , 5 , 3 , 1.0D0 , A , 1 , 1 , DESC_A ,
B IB JB DESC_B
| | | |
B , 1 , 1 , DESC_B )
|
| Desc_A | Desc_B |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG24) | icontxt(IOBG24) |
| M_ | 5 | 5 |
| N_ | 5 | 3 |
| MB_ | 2 | 2 |
| NB_ | 2 | 2 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL24) | See below(EPSSL24) |
|
Notes: | ||
Global triangular matrix A of order 5 is upper triangular with block size 2 × 2:
B,D 0 1 2
* *
0 | 3.0 -1.0 | 2.0 2.0 | 1.0 |
| . -2.0 | 4.0 -1.0 | 3.0 |
| -----------|-------------|------ |
1 | . . | -3.0 0.0 | 2.0 |
| . . | . 4.0 | -2.0 |
| -----------|-------------|------ |
2 | . . | . . | 1.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
-----|-----------------|------------
| 3.0 -1.0 1.0 | 2.0 2.0
0 | . -2.0 3.0 | 4.0 -1.0
| . . 1.0 | . .
-----|-----------------|------------
1 | . . 2.0 | -3.0 0.0
| . . -2.0 | . 4.0
Global general 5 × 3 matrix B with block size 2 × 2:
B,D 0 1
* *
0 | 6.0 10.0 | -2.0 |
| -16.0 -1.0 | 6.0 |
| -------------|------- |
1 | -2.0 1.0 | -4.0 |
| 14.0 0.0 | -14.0 |
| -------------|------- |
2 | -1.0 2.0 | 1.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1
-----|--------------|--------
| 6.0 10.0 | -2.0
0 | -16.0 -1.0 | 6.0
| -1.0 2.0 | 1.0
-----|--------------|--------
1 | -2.0 1.0 | -4.0
| 14.0 0.0 | -14.0
Output:
Global general 5 × 3 matrix B with block size 2 × 2:
B,D 0 1
* *
0 | 2.0 3.0 | 1.0 |
| 5.0 5.0 | 4.0 |
| -----------|------ |
1 | 0.0 1.0 | 2.0 |
| 3.0 1.0 | -3.0 |
| -----------|------ |
2 | -1.0 2.0 | 1.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 | 1 -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1
-----|------------|-------
| 2.0 3.0 | 1.0
0 | 5.0 5.0 | 4.0
| -1.0 2.0 | 1.0
-----|------------|-------
1 | 0.0 1.0 | 2.0
| 3.0 1.0 | -3.0
This example shows the solution B<--alpha(A-H)B 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)
SIDE UPLO TRANSA DIAG M N ALPHA A IA JA DESC_A
| | | | | | | | | | |
CALL PZTRSM( 'L' , 'U' , 'C' , 'N' , 5 , 2 , ALPHA , A , 1 , 1 , DESC_A ,
B IB JB DESC_B
| | | |
B , 1 , 1 , DESC_B )
ALPHA = (1.0D0, -1.0D0)
|
| Desc_A | Desc_B |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG25) | icontxt(IOBG25) |
| M_ | 5 | 5 |
| N_ | 5 | 2 |
| MB_ | 2 | 2 |
| NB_ | 2 | 2 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL25) | See below(EPSSL25) |
|
Notes: | ||
Global triangular matrix A of order 5 is upper triangular with block size 2 × 2:
B,D 0 1 2
* *
0 | (-4.0, 1.0) ( 4.0,-3.0) | (-1.0, 3.0) ( 0.0, 0.0) | (-1.0, 0.0) |
| . (-2.0, 0.0) | (-3.0,-1.0) (-2.0,-1.0) | ( 4.0, 3.0) |
| ------------------------|-------------------------|------------ |
1 | . . | (-5.0, 3.0) (-3.0,-3.0) | (-5.0,-5.0) |
| . . | . ( 4.0,-4.0) | ( 2.0, 0.0) |
| ------------------------|-------------------------|------------ |
2 | . . | . . | ( 2.0,-1.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
-----|-------------------------------------|-------------------------------
| (-4.0, 1.0) ( 4.0,-3.0) (-1.0, 0.0) | (-1.0, 3.0) ( 0.0, 0.0) .
0 | . (-2.0, 0.0) ( 4.0, 3.0) | (-3.0,-1.0) (-2.0,-1.0) .
| . . ( 2.0,-1.0) | . . .
-----|-------------------------------------|-------------------------------
1 | . . (-5.0,-5.0) | (-5.0, 3.0) (-3.0,-3.0) .
| . . ( 2.0, 0.0) | . ( 4.0,-4.0) .
Global general 5 × 2 matrix B with block size 2 × 2:
B,D 0
* *
0 | ( 5.5,-13.5) (-3.0, -5.0) |
| (-6.5, 14.5) (-3.0, 5.0) |
| ------------------------- |
1 | (26.0, 18.0) ( 4.0, -3.0) |
| (10.0, 3.0) ( 6.0, -6.0) |
| ------------------------- |
2 | ( 8.5, 10.5) (13.0,-12.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 | -- -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1
-----|---------------------------|------------------------
| ( 5.5,-13.5) (-3.0, -5.0) | .
0 | (-6.5, 14.5) (-3.0, 5.0) | .
| ( 8.5, 10.5) (13.0,-12.0) | .
-----|---------------------------|------------------------
| (26.0, 18.0) ( 4.0, -3.0) | .
1 | (10.0, 3.0) ( 6.0, -6.0) | .
Output:
Global general 5 × 2 matrix B with block size 2 × 2:
B,D 0
* *
0 | ( 3.0,4.0) ( 2.0, 0.0) |
| (-4.0,2.0) ( 3.0,-1.0) |
| ---------------------- |
1 | (-5.0,0.0) (-1.0, 2.0) |
| ( 1.0,3.0) ( 0.0,-2.0) |
| ---------------------- |
2 | ( 3.0,1.0) ( 1.0, 3.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 | -- -----| ------- |----- 0 | P00 | P01 2 | | -----| ------- |----- 1 | P10 | P11
Local arrays for B:
p,q | 0 | 1
-----|-------------------------|-----------------------
| ( 3.0, 4.0) ( 2.0, 0.0) | .
0 | (-4.0, 2.0) ( 3.0,-1.0) | .
| ( 3.0, 1.0) ( 1.0, 3.0) | .
-----|-------------------------|-----------------------
1 | (-5.0, 0.0) (-1.0, 2.0) | .
| ( 1.0, 3.0) ( 0.0,-2.0) | .