3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DORBDB5 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dorbdb5.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dorbdb5.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dorbdb5.f">
21 * SUBROUTINE DORBDB5( M1, M2, N, X1, INCX1, X2, INCX2, Q1, LDQ1, Q2,
22 * LDQ2, WORK, LWORK, INFO )
24 * .. Scalar Arguments ..
25 * INTEGER INCX1, INCX2, INFO, LDQ1, LDQ2, LWORK, M1, M2,
28 * .. Array Arguments ..
29 * DOUBLE PRECISION Q1(LDQ1,*), Q2(LDQ2,*), WORK(*), X1(*), X2(*)
38 *> DORBDB5 orthogonalizes the column vector
41 *> with respect to the columns of
44 *> The columns of Q must be orthonormal.
46 *> If the projection is zero according to Kahan's "twice is enough"
47 *> criterion, then some other vector from the orthogonal complement
48 *> is returned. This vector is chosen in an arbitrary but deterministic
59 *> The dimension of X1 and the number of rows in Q1. 0 <= M1.
65 *> The dimension of X2 and the number of rows in Q2. 0 <= M2.
71 *> The number of columns in Q1 and Q2. 0 <= N.
76 *> X1 is DOUBLE PRECISION array, dimension (M1)
77 *> On entry, the top part of the vector to be orthogonalized.
78 *> On exit, the top part of the projected vector.
84 *> Increment for entries of X1.
89 *> X2 is DOUBLE PRECISION array, dimension (M2)
90 *> On entry, the bottom part of the vector to be
91 *> orthogonalized. On exit, the bottom part of the projected
98 *> Increment for entries of X2.
103 *> Q1 is DOUBLE PRECISION array, dimension (LDQ1, N)
104 *> The top part of the orthonormal basis matrix.
110 *> The leading dimension of Q1. LDQ1 >= M1.
115 *> Q2 is DOUBLE PRECISION array, dimension (LDQ2, N)
116 *> The bottom part of the orthonormal basis matrix.
122 *> The leading dimension of Q2. LDQ2 >= M2.
127 *> WORK is DOUBLE PRECISION array, dimension (LWORK)
133 *> The dimension of the array WORK. LWORK >= N.
139 *> = 0: successful exit.
140 *> < 0: if INFO = -i, the i-th argument had an illegal value.
146 *> \author Univ. of Tennessee
147 *> \author Univ. of California Berkeley
148 *> \author Univ. of Colorado Denver
153 *> \ingroup doubleOTHERcomputational
155 * =====================================================================
156 SUBROUTINE DORBDB5( M1, M2, N, X1, INCX1, X2, INCX2, Q1, LDQ1, Q2,
157 $ LDQ2, WORK, LWORK, INFO )
159 * -- LAPACK computational routine (version 3.5.0) --
160 * -- LAPACK is a software package provided by Univ. of Tennessee, --
161 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
164 * .. Scalar Arguments ..
165 INTEGER INCX1, INCX2, INFO, LDQ1, LDQ2, LWORK, M1, M2,
168 * .. Array Arguments ..
169 DOUBLE PRECISION Q1(LDQ1,*), Q2(LDQ2,*), WORK(*), X1(*), X2(*)
172 * =====================================================================
175 DOUBLE PRECISION ONE, ZERO
176 PARAMETER ( ONE = 1.0D0, ZERO = 0.0D0 )
178 * .. Local Scalars ..
179 INTEGER CHILDINFO, I, J
181 * .. External Subroutines ..
182 EXTERNAL DORBDB6, XERBLA
184 * .. External Functions ..
185 DOUBLE PRECISION DNRM2
188 * .. Intrinsic Function ..
191 * .. Executable Statements ..
193 * Test input arguments
198 ELSE IF( M2 .LT. 0 ) THEN
200 ELSE IF( N .LT. 0 ) THEN
202 ELSE IF( INCX1 .LT. 1 ) THEN
204 ELSE IF( INCX2 .LT. 1 ) THEN
206 ELSE IF( LDQ1 .LT. MAX( 1, M1 ) ) THEN
208 ELSE IF( LDQ2 .LT. MAX( 1, M2 ) ) THEN
210 ELSE IF( LWORK .LT. N ) THEN
214 IF( INFO .NE. 0 ) THEN
215 CALL XERBLA( 'DORBDB5', -INFO )
219 * Project X onto the orthogonal complement of Q
221 CALL DORBDB6( M1, M2, N, X1, INCX1, X2, INCX2, Q1, LDQ1, Q2, LDQ2,
222 $ WORK, LWORK, CHILDINFO )
224 * If the projection is nonzero, then return
226 IF( DNRM2(M1,X1,INCX1) .NE. ZERO
227 $ .OR. DNRM2(M2,X2,INCX2) .NE. ZERO ) THEN
231 * Project each standard basis vector e_1,...,e_M1 in turn, stopping
232 * when a nonzero projection is found
242 CALL DORBDB6( M1, M2, N, X1, INCX1, X2, INCX2, Q1, LDQ1, Q2,
243 $ LDQ2, WORK, LWORK, CHILDINFO )
244 IF( DNRM2(M1,X1,INCX1) .NE. ZERO
245 $ .OR. DNRM2(M2,X2,INCX2) .NE. ZERO ) THEN
250 * Project each standard basis vector e_(M1+1),...,e_(M1+M2) in turn,
251 * stopping when a nonzero projection is found
261 CALL DORBDB6( M1, M2, N, X1, INCX1, X2, INCX2, Q1, LDQ1, Q2,
262 $ LDQ2, WORK, LWORK, CHILDINFO )
263 IF( DNRM2(M1,X1,INCX1) .NE. ZERO
264 $ .OR. DNRM2(M2,X2,INCX2) .NE. ZERO ) THEN