Debian Codegraph @

Modules/ThirdParty/VNL/src/vxl/v3p/netlib/lapack/double/dgeqr2.c

raw symbols SCIP
1 /* lapack/double/dgeqr2.f -- translated by f2c (version 20050501).
2 You must link the resulting object file with libf2c:
3 on Microsoft Windows system, link with libf2c.lib;
4 on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 or, if you install libf2c.a in a standard place, with -lf2c -lm
6 -- in that order, at the end of the command line, as in
7 cc *.o -lf2c -lm
8 Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9
10 http://www.netlib.org/f2c/libf2c.zip
11 */
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 #include "v3p_netlib.h"cxx . . $ `<file>/Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib.h`/
17
18 /* Table of constant values */
19
20 static integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! c__1cxx . . $ c__1. = 1;
21
22 /*< SUBROUTINE DGEQR2( M, N, A, LDA, TAU, WORK, INFO ) >*/
23 /* Subroutine */ int dgeqr2_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:47:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *m, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *n, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *a, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *
24 lda, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *tau, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *work, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *info)
25 {
26 /* System generated locals */
27 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! a_dim1, a_offset, i__1, i__2, i__3;
28
29 /* Local variables */
30 integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! i__, k;
31 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! aii;
32 extern /* Subroutine */ int dlarf_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:88:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
33 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
34 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!), dlarfg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:90:9`!(integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *,
35 doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *, doublerealcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:57:9`! *), xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!(char *, integercxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:63:9`! *,
36 ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!);
37
38
39 /* -- LAPACK routine (version 3.0) -- */
40 /* Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., */
41 /* Courant Institute, Argonne National Lab, and Rice University */
42 /* February 29, 1992 */
43
44 /* .. Scalar Arguments .. */
45 /*< INTEGER INFO, LDA, M, N >*/
46 /* .. */
47 /* .. Array Arguments .. */
48 /*< DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * ) >*/
49 /* .. */
50
51 /* Purpose */
52 /* ======= */
53
54 /* DGEQR2 computes a QR factorization of a real m by n matrix A: */
55 /* A = Q * R. */
56
57 /* Arguments */
58 /* ========= */
59
60 /* M (input) INTEGER */
61 /* The number of rows of the matrix A. M >= 0. */
62
63 /* N (input) INTEGER */
64 /* The number of columns of the matrix A. N >= 0. */
65
66 /* A (input/output) DOUBLE PRECISION array, dimension (LDA,N) */
67 /* On entry, the m by n matrix A. */
68 /* On exit, the elements on and above the diagonal of the array */
69 /* contain the min(m,n) by n upper trapezoidal matrix R (R is */
70 /* upper triangular if m >= n); the elements below the diagonal, */
71 /* with the array TAU, represent the orthogonal matrix Q as a */
72 /* product of elementary reflectors (see Further Details). */
73
74 /* LDA (input) INTEGER */
75 /* The leading dimension of the array A. LDA >= max(1,M). */
76
77 /* TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) */
78 /* The scalar factors of the elementary reflectors (see Further */
79 /* Details). */
80
81 /* WORK (workspace) DOUBLE PRECISION array, dimension (N) */
82
83 /* INFO (output) INTEGER */
84 /* = 0: successful exit */
85 /* < 0: if INFO = -i, the i-th argument had an illegal value */
86
87 /* Further Details */
88 /* =============== */
89
90 /* The matrix Q is represented as a product of elementary reflectors */
91
92 /* Q = H(1) H(2) . . . H(k), where k = min(m,n). */
93
94 /* Each H(i) has the form */
95
96 /* H(i) = I - tau * v * v' */
97
98 /* where tau is a real scalar, and v is a real vector with */
99 /* v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), */
100 /* and tau in TAU(i). */
101
102 /* ===================================================================== */
103
104 /* .. Parameters .. */
105 /*< DOUBLE PRECISION ONE >*/
106 /*< PARAMETER ( ONE = 1.0D+0 ) >*/
107 /* .. */
108 /* .. Local Scalars .. */
109 /*< INTEGER I, K >*/
110 /*< DOUBLE PRECISION AII >*/
111 /* .. */
112 /* .. External Subroutines .. */
113 /*< EXTERNAL DLARF, DLARFG, XERBLA >*/
114 /* .. */
115 /* .. Intrinsic Functions .. */
116 /*< INTRINSIC MAX, MIN >*/
117 /* .. */
118 /* .. Executable Statements .. */
119
120 /* Test the input arguments */
121
122 /*< INFO = 0 >*/
123 /* Parameter adjustments */
124 a_dim1 = *lda;
125 a_offset = 1 + a_dim1;
126 a -= a_offset;
127 --tau;
128 --work;
129
130 /* Function Body */
131 *info = 0;
132 /*< IF( M.LT.0 ) THEN >*/
133 if (*m < 0) {
134 /*< INFO = -1 >*/
135 *info = -1;
136 /*< ELSE IF( N.LT.0 ) THEN >*/
137 } else if (*n < 0) {
138 /*< INFO = -2 >*/
139 *info = -2;
140 /*< ELSE IF( LDA.LT.MAX( 1, M ) ) THEN >*/
141 } else if (*lda < maxcxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:160:9`!(1,*m)) {
142 /*< INFO = -4 >*/
143 *info = -4;
144 /*< END IF >*/
145 }
146 /*< IF( INFO.NE.0 ) THEN >*/
147 if (*info != 0) {
148 /*< CALL XERBLA( 'DGEQR2', -INFO ) >*/
149 i__1 = -(*info);
150 xerbla_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:303:9`!("DGEQR2", &i__1, (ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)6);
151 /*< RETURN >*/
152 return 0;
153 /*< END IF >*/
154 }
155
156 /*< K = MIN( M, N ) >*/
157 k = mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(*m,*n);
158
159 /*< DO 10 I = 1, K >*/
160 i__1 = k;
161 for (i__ = 1; i__ <= i__1; ++i__) {
162
163 /* Generate elementary reflector H(i) to annihilate A(i+1:m,i) */
164
165 /*< >*/
166 i__2 = *m - i__ + 1;
167 /* Computing MIN */
168 i__3 = i__ + 1;
169 dlarfg_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:90:9`!(&i__2, &a[i__ + i__ * a_dim1], &a[mincxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_original.h:159:9`!(i__3,*m) + i__ * a_dim1]
170 , &c__1cxx . . $ c__1., &tau[i__]);
171 /*< IF( I.LT.N ) THEN >*/
172 if (i__ < *n) {
173
174 /* Apply H(i) to A(i:m,i+1:n) from the left */
175
176 /*< AII = A( I, I ) >*/
177 aii = a[i__ + i__ * a_dim1];
178 /*< A( I, I ) = ONE >*/
179 a[i__ + i__ * a_dim1] = 1.;
180 /*< >*/
181 i__2 = *m - i__ + 1;
182 i__3 = *n - i__;
183 dlarf_cxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_netlib_mangle.h:88:9`!("Left", &i__2, &i__3, &a[i__ + i__ * a_dim1], &c__1cxx . . $ c__1., &tau[
184 i__], &a[i__ + (i__ + 1) * a_dim1], lda, &work[1], (
185 ftnlencxx . . $ `Modules/ThirdParty/VNL/src/vxl/v3p/netlib/v3p_f2c_mangle.h:60:9`!)4);
186 /*< A( I, I ) = AII >*/
187 a[i__ + i__ * a_dim1] = aii;
188 /*< END IF >*/
189 }
190 /*< 10 CONTINUE >*/
191 /* L10: */
192 }
193 /*< RETURN >*/
194 return 0;
195
196 /* End of DGEQR2 */
197
198 /*< END >*/
199 } /* dgeqr2_ */
200
201 #ifdef __cplusplus
202 }
203 #endif