subroutine bl3dcnd(n, k, E, D, F, pivot, est, isign, v, work, * anorm) c This version of bl3dcnd dated April 13, 2000. c c************************************************************************ c c this program computes the condition number of a block tri- c diagonal matrix of the form: c c D(1) E(1) O O O ............ O c F(1) D(2) E(2) O O ............ O c O F(2) D(3) E(3) O ............ O c .................................... c c O O ........F(n-1) D(n-1) E(n-1) c O O .............. F(n-1) D(n) c where each block, E(j), D(j), F(j) is k by k, and contain the c factors computed by bl3dfac. c c Pivoting is done only within the diagonal blocks. c The L matrix is NOT unit lower triangular, but the U matrix c is unit UPPER triangular, with the identity matrix on the c diagonal. c************************************************************************ c The estimation is done using dlacon from Lapack. See c N.J. Higham, "FORTRAN codes for estimating the one-norm of c a real or complex matrix, with applications to condition estimation", c ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988. c************************************************************************ c Input variables: integer n, k double precision E(k,k,n-1), D(k,k,n), F(k,k,n-1) integer pivot(k,n), isign(*) double precision est, v(*), work(*), anorm c Input: c k Integer, the size of the blocks. c n Integer, the number of blocks. c The blocks E,D,F contain the elements of the matrix after c factoring using bl3dfac. c E(k,k,n-1) Double precision, the sub-diagonal blocks. c D(k,k,n) Double precision, the diagonal blocks. c F(k,k,n-1) Double precision, the super-diagonal blocks. c isign: integer(n*k), workspace. c v: double precision(n*k), v = inv(matrix).w, cond(matrix) = c norm(v)/norm(w). c work: double precision(n*k), workspace. c anorm: double precision, norm of the unfactored matrix. c Output: c est: an estimate of the conditon number. c c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c ***** auxiliary programs ***** c c dlacon: from Lapack, the norm estimator, see reference above. cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc integer kase integer count, nk common /cndcnt/ count nk = n*k c c first, compute the norm of the matrix itself: c c then, do the factorization using crdcmp: c c c and then do the condition number estimation: c count = 0 kase = 0 55 call dlacon(nk,v,work,isign,est,kase) if (kase .ne. 0) then count = count+1 if ( kase .eq. 1 ) then call bl3dsol('N', n, k, E, D, F, pivot, 1, work) else if ( kase .eq. 2 ) then call bl3dsol('T', n, k, E, D, F, pivot, 1, work) endif goto 55 end if est = est*anorm return end