LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ dtpcon()

subroutine dtpcon ( character  NORM,
character  UPLO,
character  DIAG,
integer  N,
double precision, dimension( * )  AP,
double precision  RCOND,
double precision, dimension( * )  WORK,
integer, dimension( * )  IWORK,
integer  INFO 
)

DTPCON

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

Purpose:
 DTPCON estimates the reciprocal of the condition number of a packed
 triangular matrix A, in either the 1-norm or the infinity-norm.

 The norm of A is computed and an estimate is obtained for
 norm(inv(A)), then the reciprocal of the condition number is
 computed as
    RCOND = 1 / ( norm(A) * norm(inv(A)) ).
Parameters
[in]NORM
          NORM is CHARACTER*1
          Specifies whether the 1-norm condition number or the
          infinity-norm condition number is required:
          = '1' or 'O':  1-norm;
          = 'I':         Infinity-norm.
[in]UPLO
          UPLO is CHARACTER*1
          = 'U':  A is upper triangular;
          = 'L':  A is lower triangular.
[in]DIAG
          DIAG is CHARACTER*1
          = 'N':  A is non-unit triangular;
          = 'U':  A is unit triangular.
[in]N
          N is INTEGER
          The order of the matrix A.  N >= 0.
[in]AP
          AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
          The upper or lower triangular matrix A, packed columnwise in
          a linear array.  The j-th column of A is stored in the array
          AP as follows:
          if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
          if UPLO = 'L', AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.
          If DIAG = 'U', the diagonal elements of A are not referenced
          and are assumed to be 1.
[out]RCOND
          RCOND is DOUBLE PRECISION
          The reciprocal of the condition number of the matrix A,
          computed as RCOND = 1/(norm(A) * norm(inv(A))).
[out]WORK
          WORK is DOUBLE PRECISION array, dimension (3*N)
[out]IWORK
          IWORK is INTEGER array, dimension (N)
[out]INFO
          INFO is INTEGER
          = 0:  successful exit
          < 0:  if INFO = -i, the i-th argument had an illegal value
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
December 2016

Definition at line 132 of file dtpcon.f.

132 *
133 * -- LAPACK computational routine (version 3.7.0) --
134 * -- LAPACK is a software package provided by Univ. of Tennessee, --
135 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
136 * December 2016
137 *
138 * .. Scalar Arguments ..
139  CHARACTER diag, norm, uplo
140  INTEGER info, n
141  DOUBLE PRECISION rcond
142 * ..
143 * .. Array Arguments ..
144  INTEGER iwork( * )
145  DOUBLE PRECISION ap( * ), work( * )
146 * ..
147 *
148 * =====================================================================
149 *
150 * .. Parameters ..
151  DOUBLE PRECISION one, zero
152  parameter( one = 1.0d+0, zero = 0.0d+0 )
153 * ..
154 * .. Local Scalars ..
155  LOGICAL nounit, onenrm, upper
156  CHARACTER normin
157  INTEGER ix, kase, kase1
158  DOUBLE PRECISION ainvnm, anorm, scale, smlnum, xnorm
159 * ..
160 * .. Local Arrays ..
161  INTEGER isave( 3 )
162 * ..
163 * .. External Functions ..
164  LOGICAL lsame
165  INTEGER idamax
166  DOUBLE PRECISION dlamch, dlantp
167  EXTERNAL lsame, idamax, dlamch, dlantp
168 * ..
169 * .. External Subroutines ..
170  EXTERNAL dlacn2, dlatps, drscl, xerbla
171 * ..
172 * .. Intrinsic Functions ..
173  INTRINSIC abs, dble, max
174 * ..
175 * .. Executable Statements ..
176 *
177 * Test the input parameters.
178 *
179  info = 0
180  upper = lsame( uplo, 'U' )
181  onenrm = norm.EQ.'1' .OR. lsame( norm, 'O' )
182  nounit = lsame( diag, 'N' )
183 *
184  IF( .NOT.onenrm .AND. .NOT.lsame( norm, 'I' ) ) THEN
185  info = -1
186  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
187  info = -2
188  ELSE IF( .NOT.nounit .AND. .NOT.lsame( diag, 'U' ) ) THEN
189  info = -3
190  ELSE IF( n.LT.0 ) THEN
191  info = -4
192  END IF
193  IF( info.NE.0 ) THEN
194  CALL xerbla( 'DTPCON', -info )
195  RETURN
196  END IF
197 *
198 * Quick return if possible
199 *
200  IF( n.EQ.0 ) THEN
201  rcond = one
202  RETURN
203  END IF
204 *
205  rcond = zero
206  smlnum = dlamch( 'Safe minimum' )*dble( max( 1, n ) )
207 *
208 * Compute the norm of the triangular matrix A.
209 *
210  anorm = dlantp( norm, uplo, diag, n, ap, work )
211 *
212 * Continue only if ANORM > 0.
213 *
214  IF( anorm.GT.zero ) THEN
215 *
216 * Estimate the norm of the inverse of A.
217 *
218  ainvnm = zero
219  normin = 'N'
220  IF( onenrm ) THEN
221  kase1 = 1
222  ELSE
223  kase1 = 2
224  END IF
225  kase = 0
226  10 CONTINUE
227  CALL dlacn2( n, work( n+1 ), work, iwork, ainvnm, kase, isave )
228  IF( kase.NE.0 ) THEN
229  IF( kase.EQ.kase1 ) THEN
230 *
231 * Multiply by inv(A).
232 *
233  CALL dlatps( uplo, 'No transpose', diag, normin, n, ap,
234  $ work, scale, work( 2*n+1 ), info )
235  ELSE
236 *
237 * Multiply by inv(A**T).
238 *
239  CALL dlatps( uplo, 'Transpose', diag, normin, n, ap,
240  $ work, scale, work( 2*n+1 ), info )
241  END IF
242  normin = 'Y'
243 *
244 * Multiply by 1/SCALE if doing so will not cause overflow.
245 *
246  IF( scale.NE.one ) THEN
247  ix = idamax( n, work, 1 )
248  xnorm = abs( work( ix ) )
249  IF( scale.LT.xnorm*smlnum .OR. scale.EQ.zero )
250  $ GO TO 20
251  CALL drscl( n, scale, work, 1 )
252  END IF
253  GO TO 10
254  END IF
255 *
256 * Compute the estimate of the reciprocal condition number.
257 *
258  IF( ainvnm.NE.zero )
259  $ rcond = ( one / anorm ) / ainvnm
260  END IF
261 *
262  20 CONTINUE
263  RETURN
264 *
265 * End of DTPCON
266 *
double precision function dlamch(CMACH)
DLAMCH
Definition: dlamch.f:65
integer function idamax(N, DX, INCX)
IDAMAX
Definition: idamax.f:73
subroutine dlatps(UPLO, TRANS, DIAG, NORMIN, N, AP, X, SCALE, CNORM, INFO)
DLATPS solves a triangular system of equations with the matrix held in packed storage.
Definition: dlatps.f:231
subroutine dlacn2(N, V, X, ISGN, EST, KASE, ISAVE)
DLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...
Definition: dlacn2.f:138
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
double precision function dlantp(NORM, UPLO, DIAG, N, AP, WORK)
DLANTP returns the value of the 1-norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a triangular matrix supplied in packed form.
Definition: dlantp.f:126
subroutine drscl(N, SA, SX, INCX)
DRSCL multiplies a vector by the reciprocal of a real scalar.
Definition: drscl.f:86
Here is the call graph for this function:
Here is the caller graph for this function: