These functions compute the norm of real or complex general matrix A, where in this description A represents the global general submatrix Aia:ia+m-1, ja:ja+n-1.
If m = 0 or n = 0, then zero is returned
as the value of the function.
A | Result | work | Subprogram |
Long-precision real | Long-precision real | Long-precision real | PDLANGE |
Long-precision complex | Long-precision real | Long-precision real | PZLANGE |
Fortran |
PDLANGE | PZLANGE (norm, m, n, a, ia, ja, desc_a, work)
|
C and C++ |
pdlange | pzlange (norm, m, n, a, ia, ja, desc_a, work); |
If norm = 'O' or '1', the one norm of A is computed.
If norm = 'I', the infinity norm of A is computed.
If norm = 'F' or 'E', the Frobenius norm of A is computed.
If norm = 'M', the absolute value of the matrix element having the largest absolute value, i.e., max ( |A|), is returned.
Scope: global
Specified as: a single character; norm = 'O', '1', 'I', 'F', 'E', or 'M'.
Scope: global
Specified as: a fullword integer; m >= 0.
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 118. 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.
where:
Scope: local
Specified as: an area of storage containing numbers of data type indicated in Table 118.
If norm = 'O' or '1', the one norm of A is returned.
If norm = 'I', the infinity norm of A is returned.
If norm = 'F' or 'E', the Frobenius norm of A is returned.
If norm = 'M', the absolute value of the matrix element having the largest absolute value, i.e., max ( |A|), is returned.
Scope: global
If m = 0 or n = 0, the function returns zero.
Returned as: a long-precision real value.
None
None
If (m <> 0 and n <> 0):
This example computes the one norm of a real general matrix A of order 9, 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) NORM M N A IA JA DESC_A WORK | | | | | | | | ANORM = PDLANGE('O', 9 , 9 , A , 1 , 1 , DESC_A , WORK )
| Desc_A |
---|---|
DTYPE_ | 1 |
CTXT_ | icontxt(IOBG59) |
M_ | 9 |
N_ | 9 |
MB_ | 3 |
NB_ | 3 |
RSRC_ | 1 |
CSRC_ | 0 |
LLD_ | See below(EPSSL59) |
Notes: |
Input:
Global general 9 × 9 matrix A with block size 3 × 3:
B,D 0 1 2 * * | 1.0 1.2 1.4 | 1.6 1.8 2.0 | 2.2 2.4 2.6 | 0 | 1.2 1.0 1.2 | 1.4 1.6 1.8 | 2.0 2.2 2.4 | | 1.4 1.2 1.0 | 1.2 1.4 1.6 | 1.8 2.0 2.2 | | ----------------|------------------|---------------- | | 1.6 1.4 1.2 | 1.0 1.2 1.4 | 1.6 1.8 2.0 | 1 | 1.8 1.6 1.4 | 1.2 1.0 1.2 | 1.4 1.6 1.8 | | 2.0 1.8 1.6 | 1.4 1.2 1.0 | 1.2 1.4 1.6 | | ----------------|------------------|---------------- | | 2.2 2.0 1.8 | 1.6 1.4 1.2 | 1.0 1.2 1.4 | 2 | 2.4 2.2 2.0 | 1.8 1.6 1.4 | 1.2 1.0 1.2 | | 2.6 2.4 2.2 | 2.0 1.8 1.6 | 1.4 1.2 1.0 | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 1 | P00 | P01 -----| ------- |----- 0 | P10 | P11 2 | |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------|----------------- | 1.6 1.4 1.2 1.6 1.8 2.0 | 1.0 1.2 1.4 0 | 1.8 1.6 1.4 1.4 1.6 1.8 | 1.2 1.0 1.2 | 2.0 1.8 1.6 1.2 1.4 1.6 | 1.4 1.2 1.0 -----|--------------------------------|----------------- | 1.0 1.2 1.4 2.2 2.4 2.6 | 1.6 1.8 2.0 | 1.2 1.0 1.2 2.0 2.2 2.4 | 1.4 1.6 1.8 | 1.4 1.2 1.0 1.8 2.0 2.2 | 1.2 1.4 1.6 1 | 2.2 2.0 1.8 1.0 1.2 1.4 | 1.6 1.4 1.2 | 2.4 2.2 2.0 1.2 1.0 1.2 | 1.8 1.6 1.4 | 2.6 2.4 2.2 1.4 1.2 1.0 | 2.0 1.8 1.6
Output:
anorm = 16.2 on all processes.
This example computes the one norm of a complex general matrix A of order 9, 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) NORM M N A IA JA DESC_A WORK | | | | | | | | ANORM = PZLANGE('O', 9 , 9 , A , 1 , 1 , DESC_A , WORK )
| Desc_A |
---|---|
DTYPE_ | 1 |
CTXT_ | icontxt(IOBG60) |
M_ | 9 |
N_ | 9 |
MB_ | 3 |
NB_ | 3 |
RSRC_ | 1 |
CSRC_ | 0 |
LLD_A | See below(EPSSL60) |
Notes: |
Global general 9 × 9 matrix A with block size 3 × 3:
B,D 0 1 2 * * | (2.0, 1.0) (2.4,-1.0) (2.8,-1.0) | (3.2,-1.0) (3.6,-1.0) (4.0,-1.0) | (4.4,-1.0) (4.8,-1.0) (5.2,-1.0) | 0 | (2.4, 1.0) (2.0, 1.0) (2.4,-1.0) | (2.8,-1.0) (3.2,-1.0) (3.6,-1.0) | (4.0,-1.0) (4.4,-1.0) (4.8,-1.0) | | (2.8, 1.0) (2.4, 1.0) (2.0, 1.0) | (2.4,-1.0) (2.8,-1.0) (3.2,-1.0) | (3.6,-1.0) (4.0,-1.0) (4.4,-1.0) | | -------------------------------------|---------------------------------------|------------------------------------- | | (3.2, 1.0) (2.8, 1.0) (2.4, 1.0) | (2.0, 1.0) (2.4,-1.0) (2.8,-1.0) | (3.2,-1.0) (3.6,-1.0) (4.0,-1.0) | 1 | (3.6, 1.0) (3.2, 1.0) (2.8, 1.0) | (2.4, 1.0) (2.0, 1.0) (2.4,-1.0) | (2.8,-1.0) (3.2,-1.0) (3.6,-1.0) | | (4.0, 1.0) (3.6, 1.0) (3.2, 1.0) | (2.8, 1.0) (2.4, 1.0) (2.0, 1.0) | (2.4,-1.0) (2.8,-1.0) (3.2,-1.0) | | -------------------------------------|---------------------------------------|------------------------------------- | | (4.4, 1.0) (4.0, 1.0) (3.6, 1.0) | (3.2, 1.0) (2.8, 1.0) (2.4, 1.0) | (2.0, 1.0) (2.4,-1.0) (2.8,-1.0) | 2 | (4.8, 1.0) (4.4, 1.0) (4.0, 1.0) | (3.6, 1.0) (3.2, 1.0) (2.8, 1.0) | (2.4, 1.0) (2.0, 1.0) (2.4,-1.0) | | (5.2, 1.0) (4.8, 1.0) (4.4, 1.0) | (4.0, 1.0) (3.6, 1.0) (3.2, 1.0) | (2.8, 1.0) (2.4, 1.0) (2.0, 1.0) | * *
The following is the 2 × 2 process grid:
B,D | 0 2 | 1 -----| ------- |----- 1 | P00 | P01 -----| ------- |----- 0 | P10 | P11 2 | |
Local arrays for A:
p,q | 0 | 1 -----|--------------------------------------------------------------------------|-------------------------------------- | (3.2, 1.0) (2.8, 1.0) (2.4, 1.0) (3.2,-1.0) (3.6,-1.0) (4.0,-1.0) | (2.0, 1.0) (2.4,-1.0) (2.8,-1.0) 0 | (3.6, 1.0) (3.2, 1.0) (2.8, 1.0) (2.8,-1.0) (3.2,-1.0) (3.6,-1.0) | (2.4, 1.0) (2.0, 1.0) (2.4,-1.0) | (4.0, 1.0) (3.6, 1.0) (3.2, 1.0) (2.4,-1.0) (2.8,-1.0) (3.2,-1.0) | (2.8, 1.0) (2.4, 1.0) (2.0, 1.0) -----|--------------------------------------------------------------------------|-------------------------------------- | (2.0, 1.0) (2.4,-1.0) (2.8,-1.0) (4.4,-1.0) (4.8,-1.0) (5.2,-1.0) | (3.2,-1.0) (3.6,-1.0) (4.0,-1.0) | (2.4, 1.0) (2.0, 1.0) (2.4,-1.0) (4.0,-1.0) (4.4,-1.0) (4.8,-1.0) | (2.8,-1.0) (3.2,-1.0) (3.6,-1.0) | (2.8, 1.0) (2.4, 1.0) (2.0, 1.0) (3.6,-1.0) (4.0,-1.0) (4.4,-1.0) | (2.4,-1.0) (2.8,-1.0) (3.2,-1.0) 1 | (4.4, 1.0) (4.0, 1.0) (3.6, 1.0) (2.0, 1.0) (2.4,-1.0) (2.8,-1.0) | (3.2, 1.0) (2.8, 1.0) (2.4, 1.0) | (4.8, 1.0) (4.4, 1.0) (4.0, 1.0) (2.4, 1.0) (2.0, 1.0) (2.4,-1.0) | (3.6, 1.0) (3.2, 1.0) (2.8, 1.0) | (5.2, 1.0) (4.8, 1.0) (4.4, 1.0) (2.8, 1.0) (2.4, 1.0) (2.0, 1.0) | (4.0, 1.0) (3.6, 1.0) (3.2, 1.0)
Output:
anorm = 33.73 on all processes.