GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fCmplxQR.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2015 John W. Eaton
4 Copyright (C) 2008-2009 Jaroslav Hajek
5 Copyright (C) 2009 VZLU Prague
6 
7 This file is part of Octave.
8 
9 Octave is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published by the
11 Free Software Foundation; either version 3 of the License, or (at your
12 option) any later version.
13 
14 Octave is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Octave; see the file COPYING. If not, see
21 <http://www.gnu.org/licenses/>.
22 
23 */
24 
25 #ifdef HAVE_CONFIG_H
26 #include <config.h>
27 #endif
28 
29 #include "fCmplxQR.h"
30 #include "f77-fcn.h"
31 #include "lo-error.h"
32 #include "Range.h"
33 #include "idx-vector.h"
34 #include "oct-locbuf.h"
35 
36 #include "base-qr.cc"
37 
38 template class base_qr<FloatComplexMatrix>;
39 
40 extern "C"
41 {
42  F77_RET_T
43  F77_FUNC (cgeqrf, CGEQRF) (const octave_idx_type&, const octave_idx_type&,
44  FloatComplex*, const octave_idx_type&,
45  FloatComplex*, FloatComplex*,
46  const octave_idx_type&, octave_idx_type&);
47 
48  F77_RET_T
49  F77_FUNC (cungqr, CUNGQR) (const octave_idx_type&, const octave_idx_type&,
50  const octave_idx_type&, FloatComplex*,
51  const octave_idx_type&, FloatComplex*,
52  FloatComplex*, const octave_idx_type&,
53  octave_idx_type&);
54 
55 #ifdef HAVE_QRUPDATE
56 
57  F77_RET_T
58  F77_FUNC (cqr1up, CQR1UP) (const octave_idx_type&, const octave_idx_type&,
59  const octave_idx_type&, FloatComplex*,
60  const octave_idx_type&, FloatComplex*,
61  const octave_idx_type&, FloatComplex*,
62  FloatComplex*, FloatComplex*, float*);
63 
64  F77_RET_T
65  F77_FUNC (cqrinc, CQRINC) (const octave_idx_type&, const octave_idx_type&,
66  const octave_idx_type&, FloatComplex*,
67  const octave_idx_type&, FloatComplex*,
68  const octave_idx_type&,const octave_idx_type&,
69  const FloatComplex*, float*);
70 
71  F77_RET_T
72  F77_FUNC (cqrdec, CQRDEC) (const octave_idx_type&, const octave_idx_type&,
73  const octave_idx_type&, FloatComplex*,
74  const octave_idx_type&, FloatComplex*,
75  const octave_idx_type&, const octave_idx_type&,
76  float*);
77 
78  F77_RET_T
79  F77_FUNC (cqrinr, CQRINR) (const octave_idx_type&, const octave_idx_type&,
80  FloatComplex*, const octave_idx_type&,
81  FloatComplex*, const octave_idx_type&,
82  const octave_idx_type&, const FloatComplex*,
83  float*);
84 
85  F77_RET_T
86  F77_FUNC (cqrder, CQRDER) (const octave_idx_type&, const octave_idx_type&,
87  FloatComplex*, const octave_idx_type&,
88  FloatComplex*, const octave_idx_type&,
89  const octave_idx_type&, FloatComplex*, float*);
90 
91  F77_RET_T
92  F77_FUNC (cqrshc, CQRSHC) (const octave_idx_type&, const octave_idx_type&,
93  const octave_idx_type&, FloatComplex*,
94  const octave_idx_type&, FloatComplex*,
95  const octave_idx_type&, const octave_idx_type&,
96  const octave_idx_type&, FloatComplex*,
97  float*);
98 
99 #endif
100 }
101 
103 {
104  init (a, qr_type);
105 }
106 
107 void
109 {
110  octave_idx_type m = a.rows ();
111  octave_idx_type n = a.cols ();
112 
113  octave_idx_type min_mn = m < n ? m : n;
114  OCTAVE_LOCAL_BUFFER (FloatComplex, tau, min_mn);
115 
116  octave_idx_type info = 0;
117 
118  FloatComplexMatrix afact = a;
119  if (m > n && qr_type == qr_type_std)
120  afact.resize (m, m);
121 
122  if (m > 0)
123  {
124  // workspace query.
125  FloatComplex clwork;
126  F77_XFCN (cgeqrf, CGEQRF, (m, n, afact.fortran_vec (), m, tau,
127  &clwork, -1, info));
128 
129  // allocate buffer and do the job.
130  octave_idx_type lwork = clwork.real ();
131  lwork = std::max (lwork, static_cast<octave_idx_type> (1));
132  OCTAVE_LOCAL_BUFFER (FloatComplex, work, lwork);
133  F77_XFCN (cgeqrf, CGEQRF, (m, n, afact.fortran_vec (), m, tau,
134  work, lwork, info));
135  }
136 
137  form (n, afact, tau, qr_type);
138 }
139 
141  FloatComplex *tau, qr_type_t qr_type)
142 {
143  octave_idx_type m = afact.rows ();
144  octave_idx_type min_mn = std::min (m, n);
145  octave_idx_type info;
146 
147  if (qr_type == qr_type_raw)
148  {
149  for (octave_idx_type j = 0; j < min_mn; j++)
150  {
151  octave_idx_type limit = j < min_mn - 1 ? j : min_mn - 1;
152  for (octave_idx_type i = limit + 1; i < m; i++)
153  afact.elem (i, j) *= tau[j];
154  }
155 
156  r = afact;
157  }
158  else
159  {
160  // Attempt to minimize copying.
161  if (m >= n)
162  {
163  // afact will become q.
164  q = afact;
165  octave_idx_type k = qr_type == qr_type_economy ? n : m;
166  r = FloatComplexMatrix (k, n);
167  for (octave_idx_type j = 0; j < n; j++)
168  {
169  octave_idx_type i = 0;
170  for (; i <= j; i++)
171  r.xelem (i, j) = afact.xelem (i, j);
172  for (; i < k; i++)
173  r.xelem (i, j) = 0;
174  }
175  afact = FloatComplexMatrix (); // optimize memory
176  }
177  else
178  {
179  // afact will become r.
180  q = FloatComplexMatrix (m, m);
181  for (octave_idx_type j = 0; j < m; j++)
182  for (octave_idx_type i = j + 1; i < m; i++)
183  {
184  q.xelem (i, j) = afact.xelem (i, j);
185  afact.xelem (i, j) = 0;
186  }
187  r = afact;
188  }
189 
190 
191  if (m > 0)
192  {
193  octave_idx_type k = q.columns ();
194  // workspace query.
195  FloatComplex clwork;
196  F77_XFCN (cungqr, CUNGQR, (m, k, min_mn, q.fortran_vec (), m, tau,
197  &clwork, -1, info));
198 
199  // allocate buffer and do the job.
200  octave_idx_type lwork = clwork.real ();
201  lwork = std::max (lwork, static_cast<octave_idx_type> (1));
202  OCTAVE_LOCAL_BUFFER (FloatComplex, work, lwork);
203  F77_XFCN (cungqr, CUNGQR, (m, k, min_mn, q.fortran_vec (), m, tau,
204  work, lwork, info));
205  }
206  }
207 }
208 
209 #ifdef HAVE_QRUPDATE
210 
211 void
213  const FloatComplexColumnVector& v)
214 {
215  octave_idx_type m = q.rows ();
216  octave_idx_type n = r.columns ();
217  octave_idx_type k = q.columns ();
218 
219  if (u.length () == m && v.length () == n)
220  {
221  FloatComplexColumnVector utmp = u;
222  FloatComplexColumnVector vtmp = v;
224  OCTAVE_LOCAL_BUFFER (float, rw, k);
225  F77_XFCN (cqr1up, CQR1UP, (m, n, k, q.fortran_vec (),
226  m, r.fortran_vec (), k,
227  utmp.fortran_vec (), vtmp.fortran_vec (),
228  w, rw));
229  }
230  else
231  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
232 }
233 
234 void
236  const FloatComplexMatrix& v)
237 {
238  octave_idx_type m = q.rows ();
239  octave_idx_type n = r.columns ();
240  octave_idx_type k = q.columns ();
241 
242  if (u.rows () == m && v.rows () == n && u.cols () == v.cols ())
243  {
245  OCTAVE_LOCAL_BUFFER (float, rw, k);
246  for (volatile octave_idx_type i = 0; i < u.cols (); i++)
247  {
248  FloatComplexColumnVector utmp = u.column (i);
249  FloatComplexColumnVector vtmp = v.column (i);
250  F77_XFCN (cqr1up, CQR1UP, (m, n, k, q.fortran_vec (),
251  m, r.fortran_vec (), k,
252  utmp.fortran_vec (), vtmp.fortran_vec (),
253  w, rw));
254  }
255  }
256  else
257  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
258 }
259 
260 void
262  octave_idx_type j)
263 {
264  octave_idx_type m = q.rows ();
265  octave_idx_type n = r.columns ();
266  octave_idx_type k = q.columns ();
267 
268  if (u.length () != m)
269  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
270  else if (j < 0 || j > n)
271  (*current_liboctave_error_handler) ("qrinsert: index out of range");
272  else
273  {
274  if (k < m)
275  {
276  q.resize (m, k+1);
277  r.resize (k+1, n+1);
278  }
279  else
280  {
281  r.resize (k, n+1);
282  }
283 
284  FloatComplexColumnVector utmp = u;
285  OCTAVE_LOCAL_BUFFER (float, rw, k);
286  F77_XFCN (cqrinc, CQRINC, (m, n, k, q.fortran_vec (), q.rows (),
287  r.fortran_vec (), r.rows (), j + 1,
288  utmp.data (), rw));
289  }
290 }
291 
292 void
294  const Array<octave_idx_type>& j)
295 {
296  octave_idx_type m = q.rows ();
297  octave_idx_type n = r.columns ();
298  octave_idx_type k = q.columns ();
299 
301  Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
302  octave_idx_type nj = js.length ();
303  bool dups = false;
304  for (octave_idx_type i = 0; i < nj - 1; i++)
305  dups = dups && js(i) == js(i+1);
306 
307  if (dups)
308  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
309  else if (u.length () != m || u.columns () != nj)
310  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
311  else if (nj > 0 && (js(0) < 0 || js(nj-1) > n))
312  (*current_liboctave_error_handler) ("qrinsert: index out of range");
313  else if (nj > 0)
314  {
315  octave_idx_type kmax = std::min (k + nj, m);
316  if (k < m)
317  {
318  q.resize (m, kmax);
319  r.resize (kmax, n + nj);
320  }
321  else
322  {
323  r.resize (k, n + nj);
324  }
325 
326  OCTAVE_LOCAL_BUFFER (float, rw, kmax);
327  for (volatile octave_idx_type i = 0; i < js.length (); i++)
328  {
329  octave_idx_type ii = i;
330  F77_XFCN (cqrinc, CQRINC, (m, n + ii, std::min (kmax, k + ii),
331  q.fortran_vec (), q.rows (),
332  r.fortran_vec (), r.rows (), js(ii) + 1,
333  u.column (jsi(i)).data (), rw));
334  }
335  }
336 }
337 
338 void
340 {
341  octave_idx_type m = q.rows ();
342  octave_idx_type k = r.rows ();
343  octave_idx_type n = r.columns ();
344 
345  if (j < 0 || j > n-1)
346  (*current_liboctave_error_handler) ("qrdelete: index out of range");
347  else
348  {
349  OCTAVE_LOCAL_BUFFER (float, rw, k);
350  F77_XFCN (cqrdec, CQRDEC, (m, n, k, q.fortran_vec (), q.rows (),
351  r.fortran_vec (), r.rows (), j + 1, rw));
352 
353  if (k < m)
354  {
355  q.resize (m, k-1);
356  r.resize (k-1, n-1);
357  }
358  else
359  {
360  r.resize (k, n-1);
361  }
362  }
363 }
364 
365 void
367 {
368  octave_idx_type m = q.rows ();
369  octave_idx_type n = r.columns ();
370  octave_idx_type k = q.columns ();
371 
373  Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
374  octave_idx_type nj = js.length ();
375  bool dups = false;
376  for (octave_idx_type i = 0; i < nj - 1; i++)
377  dups = dups && js(i) == js(i+1);
378 
379  if (dups)
380  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
381  else if (nj > 0 && (js(0) > n-1 || js(nj-1) < 0))
382  (*current_liboctave_error_handler) ("qrinsert: index out of range");
383  else if (nj > 0)
384  {
385  OCTAVE_LOCAL_BUFFER (float, rw, k);
386  for (volatile octave_idx_type i = 0; i < js.length (); i++)
387  {
388  octave_idx_type ii = i;
389  F77_XFCN (cqrdec, CQRDEC, (m, n - ii, k == m ? k : k - ii,
390  q.fortran_vec (), q.rows (),
391  r.fortran_vec (), r.rows (),
392  js(ii) + 1, rw));
393  }
394  if (k < m)
395  {
396  q.resize (m, k - nj);
397  r.resize (k - nj, n - nj);
398  }
399  else
400  {
401  r.resize (k, n - nj);
402  }
403 
404  }
405 }
406 
407 void
409 {
410  octave_idx_type m = r.rows ();
411  octave_idx_type n = r.columns ();
412  octave_idx_type k = std::min (m, n);
413 
414  if (! q.is_square () || u.length () != n)
415  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
416  else if (j < 0 || j > m)
417  (*current_liboctave_error_handler) ("qrinsert: index out of range");
418  else
419  {
420  q.resize (m + 1, m + 1);
421  r.resize (m + 1, n);
422  FloatComplexRowVector utmp = u;
423  OCTAVE_LOCAL_BUFFER (float, rw, k);
424  F77_XFCN (cqrinr, CQRINR, (m, n, q.fortran_vec (), q.rows (),
425  r.fortran_vec (), r.rows (),
426  j + 1, utmp.fortran_vec (), rw));
427 
428  }
429 }
430 
431 void
433 {
434  octave_idx_type m = r.rows ();
435  octave_idx_type n = r.columns ();
436 
437  if (! q.is_square ())
438  (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
439  else if (j < 0 || j > m-1)
440  (*current_liboctave_error_handler) ("qrdelete: index out of range");
441  else
442  {
444  OCTAVE_LOCAL_BUFFER (float, rw, m);
445  F77_XFCN (cqrder, CQRDER, (m, n, q.fortran_vec (), q.rows (),
446  r.fortran_vec (), r.rows (), j + 1,
447  w, rw));
448 
449  q.resize (m - 1, m - 1);
450  r.resize (m - 1, n);
451  }
452 }
453 
454 void
456 {
457  octave_idx_type m = q.rows ();
458  octave_idx_type k = r.rows ();
459  octave_idx_type n = r.columns ();
460 
461  if (i < 0 || i > n-1 || j < 0 || j > n-1)
462  (*current_liboctave_error_handler) ("qrshift: index out of range");
463  else
464  {
466  OCTAVE_LOCAL_BUFFER (float, rw, k);
467  F77_XFCN (cqrshc, CQRSHC, (m, n, k,
468  q.fortran_vec (), q.rows (),
469  r.fortran_vec (), r.rows (),
470  i + 1, j + 1, w, rw));
471  }
472 }
473 
474 #else
475 
476 // Replacement update methods.
477 
478 void
480  const FloatComplexColumnVector& v)
481 {
482  warn_qrupdate_once ();
483 
484  octave_idx_type m = q.rows ();
485  octave_idx_type n = r.columns ();
486 
487  if (u.length () == m && v.length () == n)
488  {
490  get_type ());
491  }
492  else
493  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
494 }
495 
496 void
498  const FloatComplexMatrix& v)
499 {
500  warn_qrupdate_once ();
501 
502  octave_idx_type m = q.rows ();
503  octave_idx_type n = r.columns ();
504 
505  if (u.rows () == m && v.rows () == n && u.cols () == v.cols ())
506  {
507  init (q*r + u * v.hermitian (), get_type ());
508  }
509  else
510  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
511 }
512 
513 static
516 {
517  FloatComplexMatrix retval (a.rows (), a.columns () + 1);
518  retval.assign (idx_vector::colon, idx_vector (0, i),
519  a.index (idx_vector::colon, idx_vector (0, i)));
520  retval.assign (idx_vector::colon, idx_vector (i), x);
521  retval.assign (idx_vector::colon, idx_vector (i+1, retval.columns ()),
522  a.index (idx_vector::colon, idx_vector (i, a.columns ())));
523  return retval;
524 }
525 
526 static
528  const FloatComplexRowVector& x)
529 {
530  FloatComplexMatrix retval (a.rows () + 1, a.columns ());
531  retval.assign (idx_vector (0, i), idx_vector::colon,
532  a.index (idx_vector (0, i), idx_vector::colon));
533  retval.assign (idx_vector (i), idx_vector::colon, x);
534  retval.assign (idx_vector (i+1, retval.rows ()), idx_vector::colon,
535  a.index (idx_vector (i, a.rows ()), idx_vector::colon));
536  return retval;
537 }
538 
539 static
541 {
542  FloatComplexMatrix retval = a;
543  retval.delete_elements (1, idx_vector (i));
544  return retval;
545 }
546 
547 static
549 {
550  FloatComplexMatrix retval = a;
551  retval.delete_elements (0, idx_vector (i));
552  return retval;
553 }
554 
555 static
556 FloatComplexMatrix shift_cols (const FloatComplexMatrix& a,
558 {
559  octave_idx_type n = a.columns ();
561  for (octave_idx_type k = 0; k < n; k++) p(k) = k;
562  if (i < j)
563  {
564  for (octave_idx_type k = i; k < j; k++) p(k) = k+1;
565  p(j) = i;
566  }
567  else if (j < i)
568  {
569  p(j) = i;
570  for (octave_idx_type k = j+1; k < i+1; k++) p(k) = k-1;
571  }
572 
573  return a.index (idx_vector::colon, idx_vector (p));
574 }
575 
576 void
578  octave_idx_type j)
579 {
580  warn_qrupdate_once ();
581 
582  octave_idx_type m = q.rows ();
583  octave_idx_type n = r.columns ();
584 
585  if (u.length () != m)
586  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
587  else if (j < 0 || j > n)
588  (*current_liboctave_error_handler) ("qrinsert: index out of range");
589  else
590  {
591  init (::insert_col (q*r, j, u), get_type ());
592  }
593 }
594 
595 void
597  const Array<octave_idx_type>& j)
598 {
599  warn_qrupdate_once ();
600 
601  octave_idx_type m = q.rows ();
602  octave_idx_type n = r.columns ();
603 
605  Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
606  octave_idx_type nj = js.length ();
607  bool dups = false;
608  for (octave_idx_type i = 0; i < nj - 1; i++)
609  dups = dups && js(i) == js(i+1);
610 
611  if (dups)
612  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
613  else if (u.length () != m || u.columns () != nj)
614  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
615  else if (nj > 0 && (js(0) < 0 || js(nj-1) > n))
616  (*current_liboctave_error_handler) ("qrinsert: index out of range");
617  else if (nj > 0)
618  {
619  FloatComplexMatrix a = q*r;
620  for (octave_idx_type i = 0; i < js.length (); i++)
621  a = ::insert_col (a, js(i), u.column (i));
622  init (a, get_type ());
623  }
624 }
625 
626 void
628 {
629  warn_qrupdate_once ();
630 
631  octave_idx_type n = r.columns ();
632 
633  if (j < 0 || j > n-1)
634  (*current_liboctave_error_handler) ("qrdelete: index out of range");
635  else
636  {
637  init (::delete_col (q*r, j), get_type ());
638  }
639 }
640 
641 void
643 {
644  warn_qrupdate_once ();
645 
646  octave_idx_type n = r.columns ();
647 
649  Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
650  octave_idx_type nj = js.length ();
651  bool dups = false;
652  for (octave_idx_type i = 0; i < nj - 1; i++)
653  dups = dups && js(i) == js(i+1);
654 
655  if (dups)
656  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
657  else if (nj > 0 && (js(0) > n-1 || js(nj-1) < 0))
658  (*current_liboctave_error_handler) ("qrinsert: index out of range");
659  else if (nj > 0)
660  {
661  FloatComplexMatrix a = q*r;
662  for (octave_idx_type i = 0; i < js.length (); i++)
663  a = ::delete_col (a, js(i));
664  init (a, get_type ());
665  }
666 }
667 
668 void
670 {
671  warn_qrupdate_once ();
672 
673  octave_idx_type m = r.rows ();
674  octave_idx_type n = r.columns ();
675 
676  if (! q.is_square () || u.length () != n)
677  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
678  else if (j < 0 || j > m)
679  (*current_liboctave_error_handler) ("qrinsert: index out of range");
680  else
681  {
682  init (::insert_row (q*r, j, u), get_type ());
683  }
684 }
685 
686 void
688 {
689  warn_qrupdate_once ();
690 
691  octave_idx_type m = r.rows ();
692 
693  if (! q.is_square ())
694  (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
695  else if (j < 0 || j > m-1)
696  (*current_liboctave_error_handler) ("qrdelete: index out of range");
697  else
698  {
699  init (::delete_row (q*r, j), get_type ());
700  }
701 }
702 
703 void
705 {
706  warn_qrupdate_once ();
707 
708  octave_idx_type n = r.columns ();
709 
710  if (i < 0 || i > n-1 || j < 0 || j > n-1)
711  (*current_liboctave_error_handler) ("qrshift: index out of range");
712  else
713  {
714  init (::shift_cols (q*r, i, j), get_type ());
715  }
716 }
717 
718 #endif
void resize(octave_idx_type nr, octave_idx_type nc, const FloatComplex &rfv=FloatComplex(0))
Definition: fCMatrix.h:175
FloatComplexMatrix hermitian(void) const
Definition: fCMatrix.h:154
static const idx_vector colon
Definition: idx-vector.h:492
void delete_elements(const idx_vector &i)
Deleting elements.
Definition: Array.cc:1393
T & elem(octave_idx_type n)
Definition: Array.h:380
qr_type_t get_type(void) const
#define F77_XFCN(f, F, args)
Definition: f77-fcn.h:51
octave_idx_type rows(void) const
Definition: Array.h:313
liboctave_error_handler current_liboctave_error_handler
Definition: lo-error.c:38
FloatComplexMatrix r
Definition: base-qr.h:74
FloatComplexColumnVector column(octave_idx_type i) const
Definition: fCMatrix.cc:1002
ComplexMatrix hermitian(void) const
Definition: CMatrix.h:149
Array< T > sort(int dim=0, sortmode mode=ASCENDING) const
Definition: Array.cc:1766
std::complex< double > w(std::complex< double > z, double relerr=0)
F77_RET_T F77_FUNC(cgeqrf, CGEQRF)(const octave_idx_type &
const T * data(void) const
Definition: Array.h:479
FloatComplexMatrix q
Definition: base-qr.h:73
void shift_cols(octave_idx_type i, octave_idx_type j)
Definition: fCmplxQR.cc:455
qr_type_t
Definition: base-qr.h:30
bool is_square(void) const
Definition: Array.h:470
void delete_col(octave_idx_type j)
Definition: fCmplxQR.cc:339
void insert_col(const FloatComplexColumnVector &u, octave_idx_type j)
Definition: fCmplxQR.cc:261
#define F77_RET_T
Definition: f77-fcn.h:264
FloatComplexQR(void)
Definition: fCmplxQR.h:42
T & xelem(octave_idx_type n)
Definition: Array.h:353
charNDArray max(char d, const charNDArray &m)
Definition: chNDArray.cc:233
octave_idx_type length(void) const
Number of elements in the array.
Definition: Array.h:267
void delete_row(octave_idx_type j)
Definition: fCmplxQR.cc:432
void insert_row(const FloatComplexRowVector &u, octave_idx_type j)
Definition: fCmplxQR.cc:408
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
Definition: oct-locbuf.h:197
void assign(const idx_vector &i, const Array< T > &rhs, const T &rfv)
Indexed assignment (always with resize & fill).
Definition: Array.cc:1140
std::complex< float > FloatComplex
Definition: oct-cmplx.h:30
void init(const FloatComplexMatrix &, qr_type_t=qr_type_std)
Definition: fCmplxQR.cc:108
const T * fortran_vec(void) const
Definition: Array.h:481
octave_idx_type cols(void) const
Definition: Array.h:321
void form(octave_idx_type n, FloatComplexMatrix &afact, FloatComplex *tau, qr_type_t qr_type)
Definition: fCmplxQR.cc:140
octave_idx_type columns(void) const
Definition: Array.h:322
Array< T > index(const idx_vector &i) const
Indexing without resizing.
Definition: Array.cc:716
F77_RET_T const double * x
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:210
void update(const FloatComplexColumnVector &u, const FloatComplexColumnVector &v)
Definition: fCmplxQR.cc:212