PDTRSV performs one of the following solves for a triangular system of
equations with a single right-hand side:
| Solution | Equation |
|
|---|---|---|
| 1. x<--A-1x | Ax = b |
|
| 2. x<--A-Tx | ATx = b |
|
PZTRSV performs one of the following solves for a triangular system of
equations with a single right-hand side:
| Solution | Equation |
|
|---|---|---|
| 1. x<--A-1x | Ax = b |
|
| 2. x<--A-Tx | ATx = b |
|
| 3. x<--A-Hx | AHx = b |
|
where, in the formulas above:
Notes:
If n = 0, no computation is performed and the subroutine
returns after doing some parameter checking. See references [14] and [15].
| A, x | Subprogram |
| Long-precision real | PDTRSV |
| Long-precision complex | PZTRSV |
| Fortran | CALL PDTRSV | PZTRSV (uplo, transa, diag, n, a, ia, ja, desc_a, x, ix, jx, desc_x, incx) |
| C and C++ | pdtrsv | pztrsv (uplo, transa, diag, n, a, ia, ja, desc_a, x, ix, jx, desc_x, incx); |
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 in the system of equations.
If transa = 'T', AT is used in the system of equations.
If transa = 'C', AH is used in the system of equations.
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'.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 43. 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 and ia+n-1 <= M_A.
Scope: global
Specified as: a fullword integer; 1 <= ja 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: M_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_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 43. 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: M_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
Returned as: an LLD_X by (at least) LOCq(N_X) array, containing numbers of the data type indicated in Table 43.
None
Unable to allocate work space
If n <> 0:
If incx = M_X:
If incx = 1( <> M_X):
Otherwise:
This example solves x<--A-1x using a 2 × 2 process grid, where A is a unit triangular matrix. It uses a global submatrix A within a global matrix A by specifying ia = 2 and ja = 2. It uses vector x, which is a row-distributed vector within a row of global matrix X, by specifying incx = M_X = 1, ix = 1, and jx = 2.
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 TRANSA DIAG N A IA JA DESC_A X IX JX
| | | | | | | | | | |
CALL PDTRSV( 'L' , 'N' , 'U' , 12 , A , 2 , 2 , DESC_A , X , 1 , 2 ,
DESC_X INCX
| |
DESC_X , 1 )
|
| Desc_A | Desc_X |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG15) | icontxt(IOBG15) |
| M_ | 13 | 1 |
| N_ | 13 | 13 |
| MB_ | 3 | 1 |
| NB_ | 3 | 3 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL15) | See below(EPSSL15) |
|
Notes:
| ||
After the global matrix A is distributed over the process grid, only a portion of the global data structure is used--that is, global submatrix A. Following is the global submatrix A of order 12, starting at row 2 and column 2 in global triangular matrix A of order 13 with block size 3 × 3:
B,D 0 1 2 3 4
* *
| . . . | . . . | . . . | . . . | . |
0 | . 1.0 . | . . . | . . . | . . . | . |
| . 2.0 1.0 | . . . | . . . | . . . | . |
| ----------------|------------------|------------------|------------------|------ |
| . 3.0 2.0 | 1.0 . . | . . . | . . . | . |
1 | . 1.0 3.0 | 2.0 1.0 . | . . . | . . . | . |
| . 2.0 1.0 | 3.0 2.0 1.0 | . . . | . . . | . |
| ----------------|------------------|------------------|------------------|------ |
| . 3.0 2.0 | 1.0 3.0 2.0 | 1.0 . . | . . . | . |
2 | . 1.0 3.0 | 2.0 1.0 3.0 | 2.0 1.0 . | . . . | . |
| . 2.0 1.0 | 3.0 2.0 1.0 | 3.0 2.0 1.0 | . . . | . |
| ----------------|------------------|------------------|------------------|------ |
| . 3.0 2.0 | 1.0 3.0 2.0 | 1.0 3.0 2.0 | 1.0 . . | . |
3 | . 1.0 3.0 | 2.0 1.0 3.0 | 2.0 1.0 3.0 | 2.0 1.0 . | . |
| . 2.0 1.0 | 3.0 2.0 1.0 | 3.0 2.0 1.0 | 3.0 2.0 1.0 | . |
| ----------------|------------------|------------------|------------------|------ |
4 | . 3.0 2.0 | 1.0 3.0 2.0 | 1.0 3.0 2.0 | 1.0 3.0 2.0 | 1.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 -----| ------- |----- 0 | P00 | P01 2 | | 4 | | -----| ------- |----- 1 | P10 | P11 3 | |
Local arrays for A:
p,q | 0 | 1
-----|------------------------------------|--------------------------------
| . . . . . . . | . . . . . .
| . . . . . . . | . . . . . .
| . 2.0 . . . . . | . . . . . .
0 | . 3.0 2.0 . . . . | 1.0 3.0 2.0 . . .
| . 1.0 3.0 2.0 . . . | 2.0 1.0 3.0 . . .
| . 2.0 1.0 3.0 2.0 . . | 3.0 2.0 1.0 . . .
| . 3.0 2.0 1.0 3.0 2.0 . | 1.0 3.0 2.0 1.0 3.0 2.0
-----|------------------------------------|--------------------------------
| . 3.0 2.0 . . . . | . . . . . .
| . 1.0 3.0 . . . . | 2.0 . . . . .
| . 2.0 1.0 . . . . | 3.0 2.0 . . . .
1 | . 3.0 2.0 1.0 3.0 2.0 . | 1.0 3.0 2.0 . . .
| . 1.0 3.0 2.0 1.0 3.0 . | 2.0 1.0 3.0 2.0 . .
| . 2.0 1.0 3.0 2.0 1.0 . | 3.0 2.0 1.0 3.0 2.0 .
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a row-distributed vector. Following is the global vector x of size 1 × 12, starting at row 1 and column 2 in 1 × 13 global matrix X with block size 1 × 3:
B,D 0 1 2 3 4
* *
0 | . 2.0 7.0 | 13.0 15.0 17.0 | 26.0 28.0 27.0 | 39.0 41.0 37.0 | 52.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- -- | P10 | P11
Local arrays for x:
p,q | 0 | 1 -----|-------------------------------------|-------------------------------- 0 | . 2.0 7.0 26.0 28.0 27.0 52.0 | 13.0 15.0 17.0 39.0 41.0 37.0
Output:
After the global matrix X is distributed over the process grid, only a portion of the global data structure is used--that is, global vector x, which is a row-distributed vector. Following is the global vector x of size 1 × 12, starting at row 1 and column 2 in 1 × 13 global matrix X with block size 1 × 3:
B,D 0 1 2 3 4
* *
0 | . 2.0 3.0 | 1.0 2.0 3.0 | 1.0 2.0 3.0 | 1.0 2.0 3.0 | 1.0 |
* *
The following is the 2 × 2 process grid:
B,D | 0 2 4 | 1 3 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- -- | P10 | P11
Local arrays for x:
p,q | 0 | 1 -----|-------------------------------------|-------------------------------- 0 | . 2.0 3.0 1.0 2.0 3.0 1.0 | 1.0 2.0 3.0 1.0 2.0 3.0
This example solves x<--A-1x using a 2 × 2 process grid, where A is a unit triangular matrix.
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 TRANSA DIAG N A IA JA DESC_A X IX JX
| | | | | | | | | | |
CALL PZTRSV( 'L' , 'N' , 'U' , 4 , A , 1 , 1 , DESC_A , X , 1 , 1 ,
DESC_X INCX
| |
DESC_X , 1 )
|
| Desc_A | Desc_X |
|---|---|---|
| DTYPE_ | 1 | 1 |
| CTXT_ | icontxt(IOBG16) | icontxt(IOBG16) |
| M_ | 4 | 4 |
| N_ | 4 | 1 |
| MB_ | 2 | 2 |
| NB_ | 2 | 1 |
| RSRC_ | 0 | 0 |
| CSRC_ | 0 | 0 |
| LLD_ | See below(EPSSL16) | See below(EPSSL16) |
|
Notes:
| ||
Global triangular matrix A of order 4 with block size 2 × 2:
B,D 0 1
* *
| (1.0,0.0) . | . . |
0 | (1.0,1.0) (1.0,0.0) | . . |
| --------------------|-------------------- |
| (1.0,1.0) (3.0,3.0) | (1.0,0.0) . |
1 | (3.0,3.0) (4.0,4.0) | (3.0,3.0) (1.0,0.0) |
* *
The following is the 2 × 2 process grid:
B,D | 0 | 1 -----| ------- |----- 0 | P00 | P01 -----| ------- |----- 1 | P10 | P11
Local arrays for A:
p,q | 0 | 1
-----|---------------------|--------------------
| . . | . .
0 | (1.0,1.0) . | . .
-----|---------------------|---------------------
| (1.0,1.0) (3.0,3.0) | . .
1 | (3.0,3.0) (4.0,4.0) | (3.0,3.0) .
Global vector x of size 4 × 1 with block size 2:
B,D 0
* *
| ( 1.0, 1.0) |
0 | ( 2.0, 4.0) |
| ----------- |
| ( 3.0,17.0) |
1 | ( 4.0,44.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, 1.0)
0 | ( 2.0, 4.0)
-----|-------------
| ( 3.0,17.0)
1 | ( 4.0,44.0)
Output:
Global vector x of size 4 × 1 with block size 2:
B,D 0
* *
| (1.0,1.0) |
0 | (2.0,2.0) |
| --------- |
| (3.0,3.0) |
1 | (4.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,1.0)
0 | (2.0,2.0)
-----|-----------
| (3.0,3.0)
1 | (4.0,4.0)