1 *> \brief \b DLACON estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vector products.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DLACON + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlacon.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlacon.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlacon.f">
21 * SUBROUTINE DLACON( N, V, X, ISGN, EST, KASE )
23 * .. Scalar Arguments ..
25 * DOUBLE PRECISION EST
27 * .. Array Arguments ..
29 * DOUBLE PRECISION V( * ), X( * )
38 *> DLACON estimates the 1-norm of a square, real matrix A.
39 *> Reverse communication is used for evaluating matrix-vector products.
48 *> The order of the matrix. N >= 1.
53 *> V is DOUBLE PRECISION array, dimension (N)
54 *> On the final return, V = A*W, where EST = norm(V)/norm(W)
55 *> (W is not returned).
60 *> X is DOUBLE PRECISION array, dimension (N)
61 *> On an intermediate return, X should be overwritten by
63 *> A**T * X, if KASE=2,
64 *> and DLACON must be re-called with all the other parameters
70 *> ISGN is INTEGER array, dimension (N)
75 *> EST is DOUBLE PRECISION
76 *> On entry with KASE = 1 or 2 and JUMP = 3, EST should be
77 *> unchanged from the previous call to DLACON.
78 *> On exit, EST is an estimate (a lower bound) for norm(A).
81 *> \param[in,out] KASE
84 *> On the initial call to DLACON, KASE should be 0.
85 *> On an intermediate return, KASE will be 1 or 2, indicating
86 *> whether X should be overwritten by A * X or A**T * X.
87 *> On the final return from DLACON, KASE will again be 0.
93 *> \author Univ. of Tennessee
94 *> \author Univ. of California Berkeley
95 *> \author Univ. of Colorado Denver
98 *> \date September 2012
100 *> \ingroup doubleOTHERauxiliary
102 *> \par Contributors:
105 *> Nick Higham, University of Manchester. \n
106 *> Originally named SONEST, dated March 16, 1988.
111 *> N.J. Higham, "FORTRAN codes for estimating the one-norm of
112 *> a real or complex matrix, with applications to condition estimation",
113 *> ACM Trans. Math. Soft., vol. 14, no. 4, pp. 381-396, December 1988.
115 * =====================================================================
116 SUBROUTINE DLACON( N, V, X, ISGN, EST, KASE )
118 * -- LAPACK auxiliary routine (version 3.4.2) --
119 * -- LAPACK is a software package provided by Univ. of Tennessee, --
120 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
123 * .. Scalar Arguments ..
127 * .. Array Arguments ..
129 DOUBLE PRECISION V( * ), X( * )
132 * =====================================================================
136 PARAMETER ( ITMAX = 5 )
137 DOUBLE PRECISION ZERO, ONE, TWO
138 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TWO = 2.0D+0 )
140 * .. Local Scalars ..
141 INTEGER I, ITER, J, JLAST, JUMP
142 DOUBLE PRECISION ALTSGN, ESTOLD, TEMP
144 * .. External Functions ..
146 DOUBLE PRECISION DASUM
147 EXTERNAL IDAMAX, DASUM
149 * .. External Subroutines ..
152 * .. Intrinsic Functions ..
153 INTRINSIC ABS, DBLE, NINT, SIGN
155 * .. Save statement ..
158 * .. Executable Statements ..
162 X( I ) = ONE / DBLE( N )
169 GO TO ( 20, 40, 70, 110, 140 )JUMP
171 * ................ ENTRY (JUMP = 1)
172 * FIRST ITERATION. X HAS BEEN OVERWRITTEN BY A*X.
181 EST = DASUM( N, X, 1 )
184 X( I ) = SIGN( ONE, X( I ) )
185 ISGN( I ) = NINT( X( I ) )
191 * ................ ENTRY (JUMP = 2)
192 * FIRST ITERATION. X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X.
195 J = IDAMAX( N, X, 1 )
198 * MAIN LOOP - ITERATIONS 2,3,...,ITMAX.
209 * ................ ENTRY (JUMP = 3)
210 * X HAS BEEN OVERWRITTEN BY A*X.
213 CALL DCOPY( N, X, 1, V, 1 )
215 EST = DASUM( N, V, 1 )
217 IF( NINT( SIGN( ONE, X( I ) ) ).NE.ISGN( I ) )
220 * REPEATED SIGN VECTOR DETECTED, HENCE ALGORITHM HAS CONVERGED.
229 X( I ) = SIGN( ONE, X( I ) )
230 ISGN( I ) = NINT( X( I ) )
236 * ................ ENTRY (JUMP = 4)
237 * X HAS BEEN OVERWRITTEN BY TRANSPOSE(A)*X.
241 J = IDAMAX( N, X, 1 )
242 IF( ( X( JLAST ).NE.ABS( X( J ) ) ) .AND. ( ITER.LT.ITMAX ) ) THEN
247 * ITERATION COMPLETE. FINAL STAGE.
252 X( I ) = ALTSGN*( ONE+DBLE( I-1 ) / DBLE( N-1 ) )
259 * ................ ENTRY (JUMP = 5)
260 * X HAS BEEN OVERWRITTEN BY A*X.
263 TEMP = TWO*( DASUM( N, X, 1 ) / DBLE( 3*N ) )
264 IF( TEMP.GT.EST ) THEN
265 CALL DCOPY( N, X, 1, V, 1 )