LAPACK  3.10.1
LAPACK: Linear Algebra PACKage

◆ cla_hercond_x()

real function cla_hercond_x ( character  UPLO,
integer  N,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldaf, * )  AF,
integer  LDAF,
integer, dimension( * )  IPIV,
complex, dimension( * )  X,
integer  INFO,
complex, dimension( * )  WORK,
real, dimension( * )  RWORK 
)

CLA_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite matrices.

Download CLA_HERCOND_X + dependencies [TGZ] [ZIP] [TXT]

Purpose:
    CLA_HERCOND_X computes the infinity norm condition number of
    op(A) * diag(X) where X is a COMPLEX vector.
Parameters
[in]UPLO
          UPLO is CHARACTER*1
       = 'U':  Upper triangle of A is stored;
       = 'L':  Lower triangle of A is stored.
[in]N
          N is INTEGER
     The number of linear equations, i.e., the order of the
     matrix A.  N >= 0.
[in]A
          A is COMPLEX array, dimension (LDA,N)
     On entry, the N-by-N matrix A.
[in]LDA
          LDA is INTEGER
     The leading dimension of the array A.  LDA >= max(1,N).
[in]AF
          AF is COMPLEX array, dimension (LDAF,N)
     The block diagonal matrix D and the multipliers used to
     obtain the factor U or L as computed by CHETRF.
[in]LDAF
          LDAF is INTEGER
     The leading dimension of the array AF.  LDAF >= max(1,N).
[in]IPIV
          IPIV is INTEGER array, dimension (N)
     Details of the interchanges and the block structure of D
     as determined by CHETRF.
[in]X
          X is COMPLEX array, dimension (N)
     The vector X in the formula op(A) * diag(X).
[out]INFO
          INFO is INTEGER
       = 0:  Successful exit.
     i > 0:  The ith argument is invalid.
[out]WORK
          WORK is COMPLEX array, dimension (2*N).
     Workspace.
[out]RWORK
          RWORK is REAL array, dimension (N).
     Workspace.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.

Definition at line 129 of file cla_hercond_x.f.

131 *
132 * -- LAPACK computational routine --
133 * -- LAPACK is a software package provided by Univ. of Tennessee, --
134 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
135 *
136 * .. Scalar Arguments ..
137  CHARACTER UPLO
138  INTEGER N, LDA, LDAF, INFO
139 * ..
140 * .. Array Arguments ..
141  INTEGER IPIV( * )
142  COMPLEX A( LDA, * ), AF( LDAF, * ), WORK( * ), X( * )
143  REAL RWORK( * )
144 * ..
145 *
146 * =====================================================================
147 *
148 * .. Local Scalars ..
149  INTEGER KASE, I, J
150  REAL AINVNM, ANORM, TMP
151  LOGICAL UP, UPPER
152  COMPLEX ZDUM
153 * ..
154 * .. Local Arrays ..
155  INTEGER ISAVE( 3 )
156 * ..
157 * .. External Functions ..
158  LOGICAL LSAME
159  EXTERNAL lsame
160 * ..
161 * .. External Subroutines ..
162  EXTERNAL clacn2, chetrs, xerbla
163 * ..
164 * .. Intrinsic Functions ..
165  INTRINSIC abs, max
166 * ..
167 * .. Statement Functions ..
168  REAL CABS1
169 * ..
170 * .. Statement Function Definitions ..
171  cabs1( zdum ) = abs( real( zdum ) ) + abs( aimag( zdum ) )
172 * ..
173 * .. Executable Statements ..
174 *
175  cla_hercond_x = 0.0e+0
176 *
177  info = 0
178  upper = lsame( uplo, 'U' )
179  IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
180  info = -1
181  ELSE IF ( n.LT.0 ) THEN
182  info = -2
183  ELSE IF( lda.LT.max( 1, n ) ) THEN
184  info = -4
185  ELSE IF( ldaf.LT.max( 1, n ) ) THEN
186  info = -6
187  END IF
188  IF( info.NE.0 ) THEN
189  CALL xerbla( 'CLA_HERCOND_X', -info )
190  RETURN
191  END IF
192  up = .false.
193  IF ( lsame( uplo, 'U' ) ) up = .true.
194 *
195 * Compute norm of op(A)*op2(C).
196 *
197  anorm = 0.0
198  IF ( up ) THEN
199  DO i = 1, n
200  tmp = 0.0e+0
201  DO j = 1, i
202  tmp = tmp + cabs1( a( j, i ) * x( j ) )
203  END DO
204  DO j = i+1, n
205  tmp = tmp + cabs1( a( i, j ) * x( j ) )
206  END DO
207  rwork( i ) = tmp
208  anorm = max( anorm, tmp )
209  END DO
210  ELSE
211  DO i = 1, n
212  tmp = 0.0e+0
213  DO j = 1, i
214  tmp = tmp + cabs1( a( i, j ) * x( j ) )
215  END DO
216  DO j = i+1, n
217  tmp = tmp + cabs1( a( j, i ) * x( j ) )
218  END DO
219  rwork( i ) = tmp
220  anorm = max( anorm, tmp )
221  END DO
222  END IF
223 *
224 * Quick return if possible.
225 *
226  IF( n.EQ.0 ) THEN
227  cla_hercond_x = 1.0e+0
228  RETURN
229  ELSE IF( anorm .EQ. 0.0e+0 ) THEN
230  RETURN
231  END IF
232 *
233 * Estimate the norm of inv(op(A)).
234 *
235  ainvnm = 0.0e+0
236 *
237  kase = 0
238  10 CONTINUE
239  CALL clacn2( n, work( n+1 ), work, ainvnm, kase, isave )
240  IF( kase.NE.0 ) THEN
241  IF( kase.EQ.2 ) THEN
242 *
243 * Multiply by R.
244 *
245  DO i = 1, n
246  work( i ) = work( i ) * rwork( i )
247  END DO
248 *
249  IF ( up ) THEN
250  CALL chetrs( 'U', n, 1, af, ldaf, ipiv,
251  $ work, n, info )
252  ELSE
253  CALL chetrs( 'L', n, 1, af, ldaf, ipiv,
254  $ work, n, info )
255  ENDIF
256 *
257 * Multiply by inv(X).
258 *
259  DO i = 1, n
260  work( i ) = work( i ) / x( i )
261  END DO
262  ELSE
263 *
264 * Multiply by inv(X**H).
265 *
266  DO i = 1, n
267  work( i ) = work( i ) / x( i )
268  END DO
269 *
270  IF ( up ) THEN
271  CALL chetrs( 'U', n, 1, af, ldaf, ipiv,
272  $ work, n, info )
273  ELSE
274  CALL chetrs( 'L', n, 1, af, ldaf, ipiv,
275  $ work, n, info )
276  END IF
277 *
278 * Multiply by R.
279 *
280  DO i = 1, n
281  work( i ) = work( i ) * rwork( i )
282  END DO
283  END IF
284  GO TO 10
285  END IF
286 *
287 * Compute the estimate of the reciprocal condition number.
288 *
289  IF( ainvnm .NE. 0.0e+0 )
290  $ cla_hercond_x = 1.0e+0 / ainvnm
291 *
292  RETURN
293 *
294 * End of CLA_HERCOND_X
295 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine chetrs(UPLO, N, NRHS, A, LDA, IPIV, B, LDB, INFO)
CHETRS
Definition: chetrs.f:120
real function cla_hercond_x(UPLO, N, A, LDA, AF, LDAF, IPIV, X, INFO, WORK, RWORK)
CLA_HERCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian indefinite m...
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: clacn2.f:133
Here is the call graph for this function:
Here is the caller graph for this function: