LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
ssycon_rook.f
Go to the documentation of this file.
1 *> \brief \b SSYCON_ROOK
2 *
3 * =========== DOCUMENTATION ===========
4 *
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
7 *
8 *> \htmlonly
9 *> Download SSYCON_ROOK + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ssycon_rook.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ssycon_rook.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ssycon_rook.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE SSYCON_ROOK( UPLO, N, A, LDA, IPIV, ANORM, RCOND,
22 * WORK, IWORK, INFO )
23 *
24 * .. Scalar Arguments ..
25 * CHARACTER UPLO
26 * INTEGER INFO, LDA, N
27 * REAL ANORM, RCOND
28 * ..
29 * .. Array Arguments ..
30 * INTEGER IPIV( * ), IWORK( * )
31 * REAL A( LDA, * ), WORK( * )
32 * ..
33 *
34 *
35 *> \par Purpose:
36 * =============
37 *>
38 *> \verbatim
39 *>
40 *> SSYCON_ROOK estimates the reciprocal of the condition number (in the
41 *> 1-norm) of a real symmetric matrix A using the factorization
42 *> A = U*D*U**T or A = L*D*L**T computed by SSYTRF_ROOK.
43 *>
44 *> An estimate is obtained for norm(inv(A)), and the reciprocal of the
45 *> condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).
46 *> \endverbatim
47 *
48 * Arguments:
49 * ==========
50 *
51 *> \param[in] UPLO
52 *> \verbatim
53 *> UPLO is CHARACTER*1
54 *> Specifies whether the details of the factorization are stored
55 *> as an upper or lower triangular matrix.
56 *> = 'U': Upper triangular, form is A = U*D*U**T;
57 *> = 'L': Lower triangular, form is A = L*D*L**T.
58 *> \endverbatim
59 *>
60 *> \param[in] N
61 *> \verbatim
62 *> N is INTEGER
63 *> The order of the matrix A. N >= 0.
64 *> \endverbatim
65 *>
66 *> \param[in] A
67 *> \verbatim
68 *> A is REAL array, dimension (LDA,N)
69 *> The block diagonal matrix D and the multipliers used to
70 *> obtain the factor U or L as computed by SSYTRF_ROOK.
71 *> \endverbatim
72 *>
73 *> \param[in] LDA
74 *> \verbatim
75 *> LDA is INTEGER
76 *> The leading dimension of the array A. LDA >= max(1,N).
77 *> \endverbatim
78 *>
79 *> \param[in] IPIV
80 *> \verbatim
81 *> IPIV is INTEGER array, dimension (N)
82 *> Details of the interchanges and the block structure of D
83 *> as determined by SSYTRF_ROOK.
84 *> \endverbatim
85 *>
86 *> \param[in] ANORM
87 *> \verbatim
88 *> ANORM is REAL
89 *> The 1-norm of the original matrix A.
90 *> \endverbatim
91 *>
92 *> \param[out] RCOND
93 *> \verbatim
94 *> RCOND is REAL
95 *> The reciprocal of the condition number of the matrix A,
96 *> computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an
97 *> estimate of the 1-norm of inv(A) computed in this routine.
98 *> \endverbatim
99 *>
100 *> \param[out] WORK
101 *> \verbatim
102 *> WORK is REAL array, dimension (2*N)
103 *> \endverbatim
104 *>
105 *> \param[out] IWORK
106 *> \verbatim
107 *> IWORK is INTEGER array, dimension (N)
108 *> \endverbatim
109 *>
110 *> \param[out] INFO
111 *> \verbatim
112 *> INFO is INTEGER
113 *> = 0: successful exit
114 *> < 0: if INFO = -i, the i-th argument had an illegal value
115 *> \endverbatim
116 *
117 * Authors:
118 * ========
119 *
120 *> \author Univ. of Tennessee
121 *> \author Univ. of California Berkeley
122 *> \author Univ. of Colorado Denver
123 *> \author NAG Ltd.
124 *
125 *> \date November 2015
126 *
127 *> \ingroup realSYcomputational
128 *
129 *> \par Contributors:
130 * ==================
131 *> \verbatim
132 *>
133 *> November 2015, Igor Kozachenko,
134 *> Computer Science Division,
135 *> University of California, Berkeley
136 *>
137 *> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
138 *> School of Mathematics,
139 *> University of Manchester
140 *>
141 *> \endverbatim
142 *
143 * =====================================================================
144  SUBROUTINE ssycon_rook( UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK,
145  $ iwork, info )
146 *
147 * -- LAPACK computational routine (version 3.6.0) --
148 * -- LAPACK is a software package provided by Univ. of Tennessee, --
149 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
150 * November 2015
151 *
152 * .. Scalar Arguments ..
153  CHARACTER UPLO
154  INTEGER INFO, LDA, N
155  REAL ANORM, RCOND
156 * ..
157 * .. Array Arguments ..
158  INTEGER IPIV( * ), IWORK( * )
159  REAL A( lda, * ), WORK( * )
160 * ..
161 *
162 * =====================================================================
163 *
164 * .. Parameters ..
165  REAL ONE, ZERO
166  parameter ( one = 1.0e+0, zero = 0.0e+0 )
167 * ..
168 * .. Local Scalars ..
169  LOGICAL UPPER
170  INTEGER I, KASE
171  REAL AINVNM
172 * ..
173 * .. Local Arrays ..
174  INTEGER ISAVE( 3 )
175 * ..
176 * .. External Functions ..
177  LOGICAL LSAME
178  EXTERNAL lsame
179 * ..
180 * .. External Subroutines ..
181  EXTERNAL slacn2, ssytrs_rook, xerbla
182 * ..
183 * .. Intrinsic Functions ..
184  INTRINSIC max
185 * ..
186 * .. Executable Statements ..
187 *
188 * Test the input parameters.
189 *
190  info = 0
191  upper = lsame( uplo, 'U' )
192  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
193  info = -1
194  ELSE IF( n.LT.0 ) THEN
195  info = -2
196  ELSE IF( lda.LT.max( 1, n ) ) THEN
197  info = -4
198  ELSE IF( anorm.LT.zero ) THEN
199  info = -6
200  END IF
201  IF( info.NE.0 ) THEN
202  CALL xerbla( 'SSYCON_ROOK', -info )
203  RETURN
204  END IF
205 *
206 * Quick return if possible
207 *
208  rcond = zero
209  IF( n.EQ.0 ) THEN
210  rcond = one
211  RETURN
212  ELSE IF( anorm.LE.zero ) THEN
213  RETURN
214  END IF
215 *
216 * Check that the diagonal matrix D is nonsingular.
217 *
218  IF( upper ) THEN
219 *
220 * Upper triangular storage: examine D from bottom to top
221 *
222  DO 10 i = n, 1, -1
223  IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
224  $ RETURN
225  10 CONTINUE
226  ELSE
227 *
228 * Lower triangular storage: examine D from top to bottom.
229 *
230  DO 20 i = 1, n
231  IF( ipiv( i ).GT.0 .AND. a( i, i ).EQ.zero )
232  $ RETURN
233  20 CONTINUE
234  END IF
235 *
236 * Estimate the 1-norm of the inverse.
237 *
238  kase = 0
239  30 CONTINUE
240  CALL slacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
241  IF( kase.NE.0 ) THEN
242 *
243 * Multiply by inv(L*D*L**T) or inv(U*D*U**T).
244 *
245  CALL ssytrs_rook( uplo, n, 1, a, lda, ipiv, work, n, info )
246  GO TO 30
247  END IF
248 *
249 * Compute the estimate of the reciprocal condition number.
250 *
251  IF( ainvnm.NE.zero )
252  $ rcond = ( one / ainvnm ) / anorm
253 *
254  RETURN
255 *
256 * End of SSYCON_ROOK
257 *
258  END
subroutine ssycon_rook(UPLO, N, A, LDA, IPIV, ANORM, RCOND, WORK, IWORK, INFO)
SSYCON_ROOK
Definition: ssycon_rook.f:146
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine ssytrs_rook(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
SSYTRS_ROOK
Definition: ssytrs_rook.f:138
subroutine slacn2(N, V, X, ISGN, EST, KASE, ISAVE)
SLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: slacn2.f:138