1DLATRS(1) LAPACK auxiliary routine (version 3.2) DLATRS(1)
2
3
4
6 DLATRS - solves one of the triangular systems A *x = s*b or A'*x =
7 s*b with scaling to prevent overflow
8
10 SUBROUTINE DLATRS( UPLO, TRANS, DIAG, NORMIN, N, A, LDA, X, SCALE,
11 CNORM, INFO )
12
13 CHARACTER DIAG, NORMIN, TRANS, UPLO
14
15 INTEGER INFO, LDA, N
16
17 DOUBLE PRECISION SCALE
18
19 DOUBLE PRECISION A( LDA, * ), CNORM( * ), X( * )
20
22 DLATRS solves one of the triangular systems triangular matrix, A'
23 denotes the transpose of A, x and b are n-element vectors, and s is a
24 scaling factor, usually less than or equal to 1, chosen so that the
25 components of x will be less than the overflow threshold. If the
26 unscaled problem will not cause overflow, the Level 2 BLAS routine
27 DTRSV is called. If the matrix A is singular (A(j,j) = 0 for some j),
28 then s is set to 0 and a non-trivial solution to A*x = 0 is returned.
29
31 UPLO (input) CHARACTER*1
32 Specifies whether the matrix A is upper or lower triangular. =
33 'U': Upper triangular
34 = 'L': Lower triangular
35
36 TRANS (input) CHARACTER*1
37 Specifies the operation applied to A. = 'N': Solve A * x =
38 s*b (No transpose)
39 = 'T': Solve A'* x = s*b (Transpose)
40 = 'C': Solve A'* x = s*b (Conjugate transpose = Transpose)
41
42 DIAG (input) CHARACTER*1
43 Specifies whether or not the matrix A is unit triangular. =
44 'N': Non-unit triangular
45 = 'U': Unit triangular
46
47 NORMIN (input) CHARACTER*1
48 Specifies whether CNORM has been set or not. = 'Y': CNORM
49 contains the column norms on entry
50 = 'N': CNORM is not set on entry. On exit, the norms will be
51 computed and stored in CNORM.
52
53 N (input) INTEGER
54 The order of the matrix A. N >= 0.
55
56 A (input) DOUBLE PRECISION array, dimension (LDA,N)
57 The triangular matrix A. If UPLO = 'U', the leading n by n
58 upper triangular part of the array A contains the upper trian‐
59 gular matrix, and the strictly lower triangular part of A is
60 not referenced. If UPLO = 'L', the leading n by n lower trian‐
61 gular part of the array A contains the lower triangular matrix,
62 and the strictly upper triangular part of A is not referenced.
63 If DIAG = 'U', the diagonal elements of A are also not refer‐
64 enced and are assumed to be 1.
65
66 LDA (input) INTEGER
67 The leading dimension of the array A. LDA >= max (1,N).
68
69 X (input/output) DOUBLE PRECISION array, dimension (N)
70 On entry, the right hand side b of the triangular system. On
71 exit, X is overwritten by the solution vector x.
72
73 SCALE (output) DOUBLE PRECISION
74 The scaling factor s for the triangular system A * x = s*b or
75 A'* x = s*b. If SCALE = 0, the matrix A is singular or badly
76 scaled, and the vector x is an exact or approximate solution to
77 A*x = 0.
78
79 CNORM (input or output) DOUBLE PRECISION array, dimension (N)
80 If NORMIN = 'Y', CNORM is an input argument and CNORM(j) con‐
81 tains the norm of the off-diagonal part of the j-th column of
82 A. If TRANS = 'N', CNORM(j) must be greater than or equal to
83 the infinity-norm, and if TRANS = 'T' or 'C', CNORM(j) must be
84 greater than or equal to the 1-norm. If NORMIN = 'N', CNORM is
85 an output argument and CNORM(j) returns the 1-norm of the off‐
86 diagonal part of the j-th column of A.
87
88 INFO (output) INTEGER
89 = 0: successful exit
90 < 0: if INFO = -k, the k-th argument had an illegal value
91
93 A rough bound on x is computed; if that is less than overflow, DTRSV is
94 called, otherwise, specific code is used which checks for possible
95 overflow or divide-by-zero at every operation.
96 A columnwise scheme is used for solving A*x = b. The basic algorithm
97 if A is lower triangular is
98 x[1:n] := b[1:n]
99 for j = 1, ..., n
100 x(j) := x(j) / A(j,j)
101 x[j+1:n] := x[j+1:n] - x(j) * A[j+1:n,j]
102 end
103 Define bounds on the components of x after j iterations of the loop:
104 M(j) = bound on x[1:j]
105 G(j) = bound on x[j+1:n]
106 Initially, let M(0) = 0 and G(0) = max{x(i), i=1,...,n}.
107 Then for iteration j+1 we have
108 M(j+1) <= G(j) / | A(j+1,j+1) |
109 G(j+1) <= G(j) + M(j+1) * | A[j+2:n,j+1] |
110 <= G(j) ( 1 + CNORM(j+1) / | A(j+1,j+1) | )
111 where CNORM(j+1) is greater than or equal to the infinity-norm of col‐
112 umn j+1 of A, not counting the diagonal. Hence
113 G(j) <= G(0) product ( 1 + CNORM(i) / | A(i,i) | )
114 1<=i<=j
115 and
116 |x(j)| <= ( G(0) / |A(j,j)| ) product ( 1 + CNORM(i) / |A(i,i)| )
117 1<=i< j
118 Since |x(j)| <= M(j), we use the Level 2 BLAS routine DTRSV if the
119 reciprocal of the largest M(j), j=1,..,n, is larger than
120 max(underflow, 1/overflow).
121 The bound on x(j) is also used to determine when a step in the column‐
122 wise method can be performed without fear of overflow. If the computed
123 bound is greater than a large constant, x is scaled to prevent over‐
124 flow, but if the bound overflows, x is set to 0, x(j) to 1, and scale
125 to 0, and a non-trivial solution to A*x = 0 is found. Similarly, a
126 row-wise scheme is used to solve A'*x = b. The basic algorithm for A
127 upper triangular is
128 for j = 1, ..., n
129 x(j) := ( b(j) - A[1:j-1,j]' * x[1:j-1] ) / A(j,j)
130 end
131 We simultaneously compute two bounds
132 G(j) = bound on ( b(i) - A[1:i-1,i]' * x[1:i-1] ), 1<=i<=j
133 M(j) = bound on x(i), 1<=i<=j
134 The initial values are G(0) = 0, M(0) = max{b(i), i=1,..,n}, and we add
135 the constraint G(j) >= G(j-1) and M(j) >= M(j-1) for j >= 1. Then the
136 bound on x(j) is
137 M(j) <= M(j-1) * ( 1 + CNORM(j) ) / | A(j,j) |
138 <= M(0) * product ( ( 1 + CNORM(i) ) / |A(i,i)| )
139 1<=i<=j
140 and we can safely call DTRSV if 1/M(n) and 1/G(n) are both greater than
141 max(underflow, 1/overflow).
142
143
144
145 LAPACK auxiliary routine (versionNo3v.e2m)ber 2008 DLATRS(1)