|PDGELS solves overdetermined or underdetermined real linear systems involving a real general matrix A or its transpose, using a QR or LQ factorization. It is assumed that A has full rank.
|PZGELS solves overdetermined or underdetermined complex linear |systems involving a complex general matrix A or its conjugate |transpose, using a QR or LQ factorization. It is |assumed that A has full rank.
The following options are provided:
In the formulas above:
If (m = 0 and n = 0) or nrhs = 0, then the subroutine returns after doing some parameter checking.
A, B, work | Subroutine |
Long-precision real | PDGELS |
Long-precision complex | PZGELS |
Fortran | CALL PDGELS|PZGELS (transa, m, n, nrhs, a, ia, ja, desc_a, b, ib, jb, desc_b, work, lwork, info) |
C and C++ | pdgels|pzgels (transa, m, n, nrhs, a, ia, ja, desc_a, b, ib, jb, desc_b, work, lwork, info); |
If transa = 'N', matrix A is used.
If transa = 'T', matrix AT is used.
|If transa = 'C', matrix |AH is used.
Scope: global
Specified as: a single character; transa = 'N', 'T', |or 'C'.
Scope: global
Specified as: a fullword integer; m >= 0.
Scope: global
Specified as: a fullword integer; n >= 0.
Scope: global
Specified as: a fullword integer; nrhs >= 0.
Scope: local
Specified as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 64. 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+m-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 m = 0 or n = 0:
M_A >= 0
Otherwise: M_A >= 1 | Global |
4 | N_A | Number of columns in the global matrix | If m = 0 or 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.
If transa = 'N', the leading LOCp(ib+m-1) by LOCq(jb+nrhs-1) part of the local array B must contain the local pieces of the leading ib+m-1 by jb+nrhs-1 part of the global matrix; otherwise, the leading LOCp(ib+n-1) by LOCq(jb+nrhs-1) part of the local array B must contain the local pieces of the leading ib+n-1 by jb+nrhs-1 part of the global matrix.
Scope: local
Specified as: an LLD_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 64. Details about the square 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 + max(m, n)-1 <= M_B.
Scope: global
Specified as: a fullword integer; 1 <= jb <= N_B and jb+nrhs-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 (m = 0 and n = 0) or
(nrhs = 0): M_B >= 0
Otherwise: M_B >= 1 | Global |
4 | N_B | Number of columns in the global matrix | If (m = 0 and n = 0) or
(nrhs = 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.
If lwork = 0, work is ignored.
If lwork <> 0, work is the work area used by this subroutine, where:
Scope: local
Specified as: an area of storage containing numbers of data type indicated in Table 64.
Scope:
Specified as: a fullword integer; where:
lwork >= ltau + max(lwf, lws)
where:
where:
Scope: local
Returned as: an LLD_A by (at least) LOCq(N_A) array, containing numbers of the data type indicated in Table 64. Details about the block-cyclic data distribution of global matrix A are stored in desc_a.
Scope: local
Returned as: an LLD_B by (at least) LOCq(N_B) array, containing numbers of the data type indicated in Table 64. Details about the block-cyclic data distribution of global matrix B are stored in desc_b.
Scope: local
Returned as: an area of storage, where:
If lwork >= 1 or lwork = -1, then work1 is set to the minimum lwork value and contains numbers of the data type indicated in Table 64. Except for work1, the contents of work are overwritten on return.
Scope: global
Returned as: a fullword integer; info = 0.
|PDGELS solves overdetermined or underdetermined real linear systems involving a real general rectangular matrix A, or its transpose, using a QR or LQ factorization. It is assumed that A has full rank.
|PZGELS solves overdetermined or underdetermined complex linear |systems involving a complex general matrix A or its conjugate |transpose, using a QR or LQ factorization. It is |assumed that A has full rank.
The following options are provided:
In the formulas above:
If (m = 0 and n = 0) or nrhs = 0, then the subroutine returns after doing some parameter checking.
None
Stage 5: If m <> 0, n <> 0, and nrhs <> 0 and if Aia:ia+min(m, n)-1, ja:ja+min(m, n)-1 is not contained in a single block, that is, either of the following is true:
If m <> 0 and n <> 0:
If (m <> 0 or n <> 0) and nrhs <> 0:
If Aia:ia+min(m, n)-1, ja:ja+min(m, n)-1 is not contained in a single block and (m <> 0, n <> 0, and nrhs <> 0):
If m >= n:
If m < n:
If m >= n:
If m < n and (m <> 0, n <> 0, and nrhs <> 0) :
In all cases:
Each of the following global input arguments are checked to determine whether its value differs from the value specified on process P00:
Also:
This example illustrates the least squares solution of an overdetermined |real general system of size 4 × 3 with 5 right hand sides, 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) TRANSA M N NRHS A IA JA DESC_A B IB JB DESC_B WORK LWORK INFO | | | | | | | | | | | | | | | CALL PDGELS ( 'N' , 4 , 3 , 5 , A , 1 , 1 , DESC_A , B , 1 , 1 , DESC_B , WORK , 0 , INFO )
| DESC_A | DESC_B |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(IOBG57) | icontxt(IOBG57) |
M_ | 4 | 4 |
N_ | 3 | 5 |
MB_ | 1 | 1 |
NB_ | 1 | 2 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(EPSSL57) | See below(EPSSL57) |
Notes: |
Global general matrix A of size 4 by 3, with block sizes 1 × 1:
B,D 0 1 2 * * 0 | 1.00 | -2.00 | -1.00 | | ------|--------|--------| 1 | 2.00 | .00 | 1.00 | | ------|--------|--------| 2 | 2.00 | -4.00 | 2.00 | | ------|--------|--------| 3 | 4.00 | .00 | .00 | * *
Global general matrix B of size 4 by 5, with block sizes 1 × 2:
B,D 0 1 2 * * 0 | -1.00 -2.00 | -7.00 0.00 | -5.00 | | -------------|--------------|--------| 1 | 1.00 3.00 | 4.00 3.00 | 5.00 | | -------------|--------------|--------| 2 | 1.00 0.00 | 4.00 2.00 | 2.00 | | -------------|--------------|--------| 3 | -2.00 4.00 | 4.00 0.00 | 4.00 | * *
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 | 1.00 -1.00 | -2.00 | 2.00 2.00 | -4.00 -----|--------------|-------- 1 | 2.00 1.00 | 0.00 | 4.00 0.00 | 0.00
Local arrays for B:
p,q | 0 | 1 -----|---------------------|--------------- 0 | -1.00 -2.00 -5.00 | -7.00 0.00 | 1.00 0.00 2.00 | 4.00 2.00 -----|---------------------|--------------- 1 | 1.00 3.00 5.00 | 4.00 3.00 | -2.00 4.00 4.00 | 4.00 0.00
Output:
Global general matrix B of size 4 by 5, with block sizes 1 × 2:
B,D 0 1 2 * * 0 | -0.40 1.00 | 0.80 0.20 | 1.00 | | -------------|--------------|--------| 1 | 0.00 1.00 | 1.50 0.00 | 1.50 | | -------------|--------------|--------| 2 | 1.00 1.00 | 4.00 1.00 | 3.00 | | -------------|--------------|--------| 3 | -1.00 0.00 | 2.00 -2.00 | 0.00 | * *
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.40 1.00 1.00 | 0.80 0.20 | 1.00 1.00 3.00 | 4.00 1.00 -----|---------------------|--------------- 1 | 0.00 1.00 1.50 | 1.50 0.00 | -1.00 0.00 0.00 | 2.00 -2.00
The value of info is 0 on all processes.
|This example illustrates the least squares solution of an underdetermined |complex general system of size 3 × 4 with 3 right hand sides, |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) | | TRANSA M N NRHS A IA JA DESC_A B IB JB DESC_B WORK LWORK INFO | | | | | | | | | | | | | | | | |CALL PZGELS ( 'N' , 3 , 4 , 3 , A , 1 , 1 , DESC_A , B , 1 , 1 , DESC_B , WORK , 0 , INFO )
| DESC_A | DESC_B |
---|---|---|
DTYPE_ | 1 | 1 |
CTXT_ | icontxt(NT1GELS) | icontxt(NT1GELS) |
M_ | 3 | 4 |
N_ | 4 | 3 |
MB_ | 1 | 1 |
NB_ | 1 | 1 |
RSRC_ | 0 | 0 |
CSRC_ | 0 | 0 |
LLD_ | See below(NT2GELS) | See below(NT2GELS) |
Notes: |
|Global general matrix A of size 3 by 4, with block sizes |1 × 1:
|B,D 0 1 2 3 | * * | 0 | ( 1.00, 0.00) | (-2.00, 1.00) | (-3.00,-1.00) | ( 4.00,-3.00) | | | --------------|---------------|-------------- |-------------- | | 1 | ( 1.00,-1.00) | ( 2.00, 2.00) | (-3.00, 0.00) | (-4.00,-2.00) | | | --------------|---------------|-------------- |-------------- | | 2 | ( 1.00,-2.00) | (-2.00, 3.00) | (-3.00, 1.00) | ( 4.00,-1.00) | | | --------------|---------------|-------------- |-------------- | | * * |
|Global general matrix B of size 4 by 3, with block sizes |1 × 1:
|B,D 0 1 2 | * * | 0 | ( 1.00, .00) | ( .00, 1.00) | ( 1.00, 1.00) | | | -------------|--------------|---------------| | 1 | (-1.00,1.00) | (1.00,-1.00) | ( .00, .00) | | | -------------|--------------|---------------| | 2 | 2.00,1.00 | (1.00, 2.00) | (-1.00,-1.00) | | | -------------|--------------|---------------| | 3 | ( . , . ) | ( . , . ) | ( . , . ) | | * *
|The following is the 2 × 2 process grid:
|B,D | 0 2 | 1 3 |-----| ------- |----- |0 | P00 | P01 |2 | | |-----| ------- |----- |1 | P10 | P11 |3 | |
|Local arrays for A:
|p,q | 0 | 1 |-----|-----------------------------|----------------------------- | 0 | (1.00, 0.00) (-3.00,-1.00) | (-2.00, 1.00) ( 4.00,-3.00) | | (1.00,-2.00) (-3.00, 1.00) | (-2.00, 3.00) ( 4.00,-1.00) |-----|-----------------------------|----------------------------- | 1 | (1.00,-1.00) (-3.00, 0.00) | ( 2.00, 2.00) (-4.00,-2.00) |
|Local arrays for B:
|p,q | 0 | 1 |-----|-----------------------------|--------------- | 0 | ( 1.00, .00) ( 1.00, 1.00) | ( 1.00,-1.00) | | ( 2.00, 1.00) (-1.00,-1.00) | ( 1.00, 2.00) |-----|-----------------------------|--------------- | 1 | (-1.00, 1.00) ( .00, .00) | ( 1.00,-1.00) | | ( . , . ) ( . , . ) | ( . , . )
|Output:
|Global general matrix B of size 4 by 3, with block sizes |1 × 1:
|B,D 0 1 2 | * * | 0 | ( -.16, .15) | ( -.08, .18) | ( .16, -.31) | | | --------------|---------------|---------------| | 1 | ( .11, .02) | ( .21, -.50) | ( -.38, .65) | | | --------------|---------------|---------------| | 2 | ( -.13, -.32) | ( .16, .12) | ( -.27, -.28) | | | --------------|---------------|---------------| | 3 | ( .37, -.05) | ( .04, .06) | ( -.19, .32) | | * *
|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 | ( -.16, .15) ( .16, -.31) | ( -.08, .18) | | ( -.13, -.32) ( -.27, -.28) | ( .16, .12) |-----|-----------------------------|-------------- | 1 | ( .11, .02) ( -.38, .65) | ( .21, -.50) | | ( .37, -.05) ( -.19, .32) | ( .04, .06)
|The value of info is 0 on all processes.