comparison liboctave/dbleQRP.cc @ 1251:97eac19837dc

[project @ 1995-04-11 15:58:32 by jwe]
author jwe
date Tue, 11 Apr 1995 15:58:32 +0000
parents b6360f2d4fa6
children bb67a902760b
comparison
equal deleted inserted replaced
1250:5cca5ae20299 1251:97eac19837dc
32 #include "lo-error.h" 32 #include "lo-error.h"
33 #include "f77-uscore.h" 33 #include "f77-uscore.h"
34 34
35 extern "C" 35 extern "C"
36 { 36 {
37 int F77_FCN (dgeqpf) (const int*, const int*, double*, const int*, 37 int F77_FCN (dgeqpf) (const int&, const int&, double*, const int&,
38 int*, double*, double*, int*); 38 int*, double*, double*, int&);
39 39
40 int F77_FCN (dorgqr) (const int*, const int*, const int*, double*, 40 int F77_FCN (dorgqr) (const int&, const int&, const int&, double*,
41 const int*, double*, double*, const int*, int*); 41 const int&, double*, double*, const int&, int&);
42 } 42 }
43 43
44 // It would be best to share some of this code with QR class... 44 // It would be best to share some of this code with QR class...
45 45
46 QRP::QRP (const Matrix& a, QR::type qr_type) 46 QRP::QRP (const Matrix& a, QR::type qr_type)
77 // here...) 77 // here...)
78 78
79 for (int i = 0; i < n; i++) 79 for (int i = 0; i < n; i++)
80 jpvt[i] = 0; 80 jpvt[i] = 0;
81 81
82 F77_FCN (dgeqpf) (&m, &n, tmp_data, &m, jpvt, tau, work, &info); 82 F77_FCN (dgeqpf) (m, n, tmp_data, m, jpvt, tau, work, info);
83 83
84 // Form Permutation matrix (if economy is requested, return the 84 // Form Permutation matrix (if economy is requested, return the
85 // indices only!) 85 // indices only!)
86 86
87 if (qr_type == QR::economy && m > n) 87 if (qr_type == QR::economy && m > n)
120 } 120 }
121 121
122 lwork = 32*m; 122 lwork = 32*m;
123 work = new double[lwork]; 123 work = new double[lwork];
124 124
125 F77_FCN (dorgqr) (&m, &m, &min_mn, tmp_data, &m, tau, work, 125 F77_FCN (dorgqr) (m, m, min_mn, tmp_data, m, tau, work, lwork, info);
126 &lwork, &info);
127 126
128 q = Matrix (tmp_data, m, m); 127 q = Matrix (tmp_data, m, m);
129 q.resize (m, n2); 128 q.resize (m, n2);
130 129
131 delete [] tau; 130 delete [] tau;