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
CmplxQR.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 "CmplxQR.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<ComplexMatrix>;
39 
40 extern "C"
41 {
42  F77_RET_T
43  F77_FUNC (zgeqrf, ZGEQRF) (const octave_idx_type&, const octave_idx_type&,
44  Complex*, const octave_idx_type&, Complex*,
45  Complex*, const octave_idx_type&,
46  octave_idx_type&);
47 
48  F77_RET_T
49  F77_FUNC (zungqr, ZUNGQR) (const octave_idx_type&, const octave_idx_type&,
50  const octave_idx_type&, Complex*,
51  const octave_idx_type&, Complex*, Complex*,
52  const octave_idx_type&, octave_idx_type&);
53 
54 #ifdef HAVE_QRUPDATE
55 
56  F77_RET_T
57  F77_FUNC (zqr1up, ZQR1UP) (const octave_idx_type&, const octave_idx_type&,
58  const octave_idx_type&, Complex*,
59  const octave_idx_type&, Complex*,
60  const octave_idx_type&, Complex*,
61  Complex*, Complex*, double*);
62 
63  F77_RET_T
64  F77_FUNC (zqrinc, ZQRINC) (const octave_idx_type&, const octave_idx_type&,
65  const octave_idx_type&, Complex*,
66  const octave_idx_type&, Complex*,
67  const octave_idx_type&, const octave_idx_type&,
68  const Complex*, double*);
69 
70  F77_RET_T
71  F77_FUNC (zqrdec, ZQRDEC) (const octave_idx_type&, const octave_idx_type&,
72  const octave_idx_type&, Complex*,
73  const octave_idx_type&, Complex*,
74  const octave_idx_type&, const octave_idx_type&,
75  double*);
76 
77  F77_RET_T
78  F77_FUNC (zqrinr, ZQRINR) (const octave_idx_type&, const octave_idx_type&,
79  Complex*, const octave_idx_type&, Complex*,
80  const octave_idx_type&, const octave_idx_type&,
81  const Complex*, double*);
82 
83  F77_RET_T
84  F77_FUNC (zqrder, ZQRDER) (const octave_idx_type&, const octave_idx_type&,
85  Complex*, const octave_idx_type&, Complex*,
86  const octave_idx_type&, const octave_idx_type&,
87  Complex*, double*);
88 
89  F77_RET_T
90  F77_FUNC (zqrshc, ZQRSHC) (const octave_idx_type&, const octave_idx_type&,
91  const octave_idx_type&, Complex*,
92  const octave_idx_type&, Complex*,
93  const octave_idx_type&, const octave_idx_type&,
94  const octave_idx_type&, Complex*, double*);
95 
96 #endif
97 }
98 
100 {
101  init (a, qr_type);
102 }
103 
104 void
106 {
107  octave_idx_type m = a.rows ();
108  octave_idx_type n = a.cols ();
109 
110  octave_idx_type min_mn = m < n ? m : n;
111  OCTAVE_LOCAL_BUFFER (Complex, tau, min_mn);
112 
113  octave_idx_type info = 0;
114 
115  ComplexMatrix afact = a;
116  if (m > n && qr_type == qr_type_std)
117  afact.resize (m, m);
118 
119  if (m > 0)
120  {
121  // workspace query.
122  Complex clwork;
123  F77_XFCN (zgeqrf, ZGEQRF, (m, n, afact.fortran_vec (), m, tau,
124  &clwork, -1, info));
125 
126  // allocate buffer and do the job.
127  octave_idx_type lwork = clwork.real ();
128  lwork = std::max (lwork, static_cast<octave_idx_type> (1));
129  OCTAVE_LOCAL_BUFFER (Complex, work, lwork);
130  F77_XFCN (zgeqrf, ZGEQRF, (m, n, afact.fortran_vec (), m, tau,
131  work, lwork, info));
132  }
133 
134  form (n, afact, tau, qr_type);
135 }
136 
138  Complex *tau, qr_type_t qr_type)
139 {
140  octave_idx_type m = afact.rows ();
141  octave_idx_type min_mn = std::min (m, n);
142  octave_idx_type info;
143 
144  if (qr_type == qr_type_raw)
145  {
146  for (octave_idx_type j = 0; j < min_mn; j++)
147  {
148  octave_idx_type limit = j < min_mn - 1 ? j : min_mn - 1;
149  for (octave_idx_type i = limit + 1; i < m; i++)
150  afact.elem (i, j) *= tau[j];
151  }
152 
153  r = afact;
154  }
155  else
156  {
157  // Attempt to minimize copying.
158  if (m >= n)
159  {
160  // afact will become q.
161  q = afact;
162  octave_idx_type k = qr_type == qr_type_economy ? n : m;
163  r = ComplexMatrix (k, n);
164  for (octave_idx_type j = 0; j < n; j++)
165  {
166  octave_idx_type i = 0;
167  for (; i <= j; i++)
168  r.xelem (i, j) = afact.xelem (i, j);
169  for (; i < k; i++)
170  r.xelem (i, j) = 0;
171  }
172  afact = ComplexMatrix (); // optimize memory
173  }
174  else
175  {
176  // afact will become r.
177  q = ComplexMatrix (m, m);
178  for (octave_idx_type j = 0; j < m; j++)
179  for (octave_idx_type i = j + 1; i < m; i++)
180  {
181  q.xelem (i, j) = afact.xelem (i, j);
182  afact.xelem (i, j) = 0;
183  }
184  r = afact;
185  }
186 
187 
188  if (m > 0)
189  {
190  octave_idx_type k = q.columns ();
191  // workspace query.
192  Complex clwork;
193  F77_XFCN (zungqr, ZUNGQR, (m, k, min_mn, q.fortran_vec (), m, tau,
194  &clwork, -1, info));
195 
196  // allocate buffer and do the job.
197  octave_idx_type lwork = clwork.real ();
198  lwork = std::max (lwork, static_cast<octave_idx_type> (1));
199  OCTAVE_LOCAL_BUFFER (Complex, work, lwork);
200  F77_XFCN (zungqr, ZUNGQR, (m, k, min_mn, q.fortran_vec (), m, tau,
201  work, lwork, info));
202  }
203  }
204 }
205 
206 #ifdef HAVE_QRUPDATE
207 
208 void
210 {
211  octave_idx_type m = q.rows ();
212  octave_idx_type n = r.columns ();
213  octave_idx_type k = q.columns ();
214 
215  if (u.length () == m && v.length () == n)
216  {
217  ComplexColumnVector utmp = u;
218  ComplexColumnVector vtmp = v;
220  OCTAVE_LOCAL_BUFFER (double, rw, k);
221  F77_XFCN (zqr1up, ZQR1UP, (m, n, k, q.fortran_vec (),
222  m, r.fortran_vec (), k,
223  utmp.fortran_vec (), vtmp.fortran_vec (),
224  w, rw));
225  }
226  else
227  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
228 }
229 
230 void
232 {
233  octave_idx_type m = q.rows ();
234  octave_idx_type n = r.columns ();
235  octave_idx_type k = q.columns ();
236 
237  if (u.rows () == m && v.rows () == n && u.cols () == v.cols ())
238  {
240  OCTAVE_LOCAL_BUFFER (double, rw, k);
241  for (volatile octave_idx_type i = 0; i < u.cols (); i++)
242  {
243  ComplexColumnVector utmp = u.column (i);
244  ComplexColumnVector vtmp = v.column (i);
245  F77_XFCN (zqr1up, ZQR1UP, (m, n, k, q.fortran_vec (),
246  m, r.fortran_vec (), k,
247  utmp.fortran_vec (), vtmp.fortran_vec (),
248  w, rw));
249  }
250  }
251  else
252  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
253 }
254 
255 void
257 {
258  octave_idx_type m = q.rows ();
259  octave_idx_type n = r.columns ();
260  octave_idx_type k = q.columns ();
261 
262  if (u.length () != m)
263  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
264  else if (j < 0 || j > n)
265  (*current_liboctave_error_handler) ("qrinsert: index out of range");
266  else
267  {
268  if (k < m)
269  {
270  q.resize (m, k+1);
271  r.resize (k+1, n+1);
272  }
273  else
274  {
275  r.resize (k, n+1);
276  }
277 
278  ComplexColumnVector utmp = u;
279  OCTAVE_LOCAL_BUFFER (double, rw, k);
280  F77_XFCN (zqrinc, ZQRINC, (m, n, k, q.fortran_vec (), q.rows (),
281  r.fortran_vec (), r.rows (), j + 1,
282  utmp.data (), rw));
283  }
284 }
285 
286 void
288 {
289  octave_idx_type m = q.rows ();
290  octave_idx_type n = r.columns ();
291  octave_idx_type k = q.columns ();
292 
294  Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
295  octave_idx_type nj = js.length ();
296  bool dups = false;
297  for (octave_idx_type i = 0; i < nj - 1; i++)
298  dups = dups && js(i) == js(i+1);
299 
300  if (dups)
301  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
302  else if (u.length () != m || u.columns () != nj)
303  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
304  else if (nj > 0 && (js(0) < 0 || js(nj-1) > n))
305  (*current_liboctave_error_handler) ("qrinsert: index out of range");
306  else if (nj > 0)
307  {
308  octave_idx_type kmax = std::min (k + nj, m);
309  if (k < m)
310  {
311  q.resize (m, kmax);
312  r.resize (kmax, n + nj);
313  }
314  else
315  {
316  r.resize (k, n + nj);
317  }
318 
319  OCTAVE_LOCAL_BUFFER (double, rw, kmax);
320  for (volatile octave_idx_type i = 0; i < js.length (); i++)
321  {
322  octave_idx_type ii = i;
323  ComplexColumnVector utmp = u.column (jsi(i));
324  F77_XFCN (zqrinc, ZQRINC, (m, n + ii, std::min (kmax, k + ii),
325  q.fortran_vec (), q.rows (),
326  r.fortran_vec (), r.rows (), js(ii) + 1,
327  utmp.data (), rw));
328  }
329  }
330 }
331 
332 void
334 {
335  octave_idx_type m = q.rows ();
336  octave_idx_type k = r.rows ();
337  octave_idx_type n = r.columns ();
338 
339  if (j < 0 || j > n-1)
340  (*current_liboctave_error_handler) ("qrdelete: index out of range");
341  else
342  {
343  OCTAVE_LOCAL_BUFFER (double, rw, k);
344  F77_XFCN (zqrdec, ZQRDEC, (m, n, k, q.fortran_vec (), q.rows (),
345  r.fortran_vec (), r.rows (), j + 1, rw));
346 
347  if (k < m)
348  {
349  q.resize (m, k-1);
350  r.resize (k-1, n-1);
351  }
352  else
353  {
354  r.resize (k, n-1);
355  }
356  }
357 }
358 
359 void
361 {
362  octave_idx_type m = q.rows ();
363  octave_idx_type n = r.columns ();
364  octave_idx_type k = q.columns ();
365 
367  Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
368  octave_idx_type nj = js.length ();
369  bool dups = false;
370  for (octave_idx_type i = 0; i < nj - 1; i++)
371  dups = dups && js(i) == js(i+1);
372 
373  if (dups)
374  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
375  else if (nj > 0 && (js(0) > n-1 || js(nj-1) < 0))
376  (*current_liboctave_error_handler) ("qrinsert: index out of range");
377  else if (nj > 0)
378  {
379  OCTAVE_LOCAL_BUFFER (double, rw, k);
380  for (volatile octave_idx_type i = 0; i < js.length (); i++)
381  {
382  octave_idx_type ii = i;
383  F77_XFCN (zqrdec, ZQRDEC, (m, n - ii, k == m ? k : k - ii,
384  q.fortran_vec (), q.rows (),
385  r.fortran_vec (), r.rows (),
386  js(ii) + 1, rw));
387  }
388  if (k < m)
389  {
390  q.resize (m, k - nj);
391  r.resize (k - nj, n - nj);
392  }
393  else
394  {
395  r.resize (k, n - nj);
396  }
397 
398  }
399 }
400 
401 void
403 {
404  octave_idx_type m = r.rows ();
405  octave_idx_type n = r.columns ();
406  octave_idx_type k = std::min (m, n);
407 
408  if (! q.is_square () || u.length () != n)
409  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
410  else if (j < 0 || j > m)
411  (*current_liboctave_error_handler) ("qrinsert: index out of range");
412  else
413  {
414  q.resize (m + 1, m + 1);
415  r.resize (m + 1, n);
416  ComplexRowVector utmp = u;
417  OCTAVE_LOCAL_BUFFER (double, rw, k);
418  F77_XFCN (zqrinr, ZQRINR, (m, n, q.fortran_vec (), q.rows (),
419  r.fortran_vec (), r.rows (),
420  j + 1, utmp.fortran_vec (), rw));
421 
422  }
423 }
424 
425 void
427 {
428  octave_idx_type m = r.rows ();
429  octave_idx_type n = r.columns ();
430 
431  if (! q.is_square ())
432  (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
433  else if (j < 0 || j > m-1)
434  (*current_liboctave_error_handler) ("qrdelete: index out of range");
435  else
436  {
438  OCTAVE_LOCAL_BUFFER (double, rw, m);
439  F77_XFCN (zqrder, ZQRDER, (m, n, q.fortran_vec (), q.rows (),
440  r.fortran_vec (), r.rows (), j + 1,
441  w, rw));
442 
443  q.resize (m - 1, m - 1);
444  r.resize (m - 1, n);
445  }
446 }
447 
448 void
450 {
451  octave_idx_type m = q.rows ();
452  octave_idx_type k = r.rows ();
453  octave_idx_type n = r.columns ();
454 
455  if (i < 0 || i > n-1 || j < 0 || j > n-1)
456  (*current_liboctave_error_handler) ("qrshift: index out of range");
457  else
458  {
460  OCTAVE_LOCAL_BUFFER (double, rw, k);
461  F77_XFCN (zqrshc, ZQRSHC, (m, n, k,
462  q.fortran_vec (), q.rows (),
463  r.fortran_vec (), r.rows (),
464  i + 1, j + 1, w, rw));
465  }
466 }
467 
468 #else
469 
470 // Replacement update methods.
471 
472 void
474 {
475  warn_qrupdate_once ();
476 
477  octave_idx_type m = q.rows ();
478  octave_idx_type n = r.columns ();
479 
480  if (u.length () == m && v.length () == n)
481  {
482  init (q*r + ComplexMatrix (u) * ComplexMatrix (v).hermitian (),
483  get_type ());
484  }
485  else
486  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
487 }
488 
489 void
490 ComplexQR::update (const ComplexMatrix& u, const ComplexMatrix& v)
491 {
492  warn_qrupdate_once ();
493 
494  octave_idx_type m = q.rows ();
495  octave_idx_type n = r.columns ();
496 
497  if (u.rows () == m && v.rows () == n && u.cols () == v.cols ())
498  {
499  init (q*r + u * v.hermitian (), get_type ());
500  }
501  else
502  (*current_liboctave_error_handler) ("qrupdate: dimensions mismatch");
503 }
504 
505 static
506 ComplexMatrix insert_col (const ComplexMatrix& a, octave_idx_type i,
507  const ComplexColumnVector& x)
508 {
509  ComplexMatrix retval (a.rows (), a.columns () + 1);
510  retval.assign (idx_vector::colon, idx_vector (0, i),
511  a.index (idx_vector::colon, idx_vector (0, i)));
512  retval.assign (idx_vector::colon, idx_vector (i), x);
513  retval.assign (idx_vector::colon, idx_vector (i+1, retval.columns ()),
514  a.index (idx_vector::colon, idx_vector (i, a.columns ())));
515  return retval;
516 }
517 
518 static
519 ComplexMatrix insert_row (const ComplexMatrix& a, octave_idx_type i,
520  const ComplexRowVector& x)
521 {
522  ComplexMatrix retval (a.rows () + 1, a.columns ());
523  retval.assign (idx_vector (0, i), idx_vector::colon,
524  a.index (idx_vector (0, i), idx_vector::colon));
525  retval.assign (idx_vector (i), idx_vector::colon, x);
526  retval.assign (idx_vector (i+1, retval.rows ()), idx_vector::colon,
527  a.index (idx_vector (i, a.rows ()), idx_vector::colon));
528  return retval;
529 }
530 
531 static
532 ComplexMatrix delete_col (const ComplexMatrix& a, octave_idx_type i)
533 {
534  ComplexMatrix retval = a;
535  retval.delete_elements (1, idx_vector (i));
536  return retval;
537 }
538 
539 static
540 ComplexMatrix delete_row (const ComplexMatrix& a, octave_idx_type i)
541 {
542  ComplexMatrix retval = a;
543  retval.delete_elements (0, idx_vector (i));
544  return retval;
545 }
546 
547 static
548 ComplexMatrix shift_cols (const ComplexMatrix& a,
550 {
551  octave_idx_type n = a.columns ();
553  for (octave_idx_type k = 0; k < n; k++) p(k) = k;
554  if (i < j)
555  {
556  for (octave_idx_type k = i; k < j; k++) p(k) = k+1;
557  p(j) = i;
558  }
559  else if (j < i)
560  {
561  p(j) = i;
562  for (octave_idx_type k = j+1; k < i+1; k++) p(k) = k-1;
563  }
564 
565  return a.index (idx_vector::colon, idx_vector (p));
566 }
567 
568 void
570 {
571  warn_qrupdate_once ();
572 
573  octave_idx_type m = q.rows ();
574  octave_idx_type n = r.columns ();
575 
576  if (u.length () != m)
577  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
578  else if (j < 0 || j > n)
579  (*current_liboctave_error_handler) ("qrinsert: index out of range");
580  else
581  {
582  init (::insert_col (q*r, j, u), get_type ());
583  }
584 }
585 
586 void
588 {
589  warn_qrupdate_once ();
590 
591  octave_idx_type m = q.rows ();
592  octave_idx_type n = r.columns ();
593 
595  Array<octave_idx_type> js = j.sort (jsi, 0, ASCENDING);
596  octave_idx_type nj = js.length ();
597  bool dups = false;
598  for (octave_idx_type i = 0; i < nj - 1; i++)
599  dups = dups && js(i) == js(i+1);
600 
601  if (dups)
602  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
603  else if (u.length () != m || u.columns () != nj)
604  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
605  else if (nj > 0 && (js(0) < 0 || js(nj-1) > n))
606  (*current_liboctave_error_handler) ("qrinsert: index out of range");
607  else if (nj > 0)
608  {
609  ComplexMatrix a = q*r;
610  for (octave_idx_type i = 0; i < js.length (); i++)
611  a = ::insert_col (a, js(i), u.column (i));
612  init (a, get_type ());
613  }
614 }
615 
616 void
618 {
619  warn_qrupdate_once ();
620 
621  octave_idx_type n = r.columns ();
622 
623  if (j < 0 || j > n-1)
624  (*current_liboctave_error_handler) ("qrdelete: index out of range");
625  else
626  {
627  init (::delete_col (q*r, j), get_type ());
628  }
629 }
630 
631 void
633 {
634  warn_qrupdate_once ();
635 
636  octave_idx_type n = r.columns ();
637 
639  Array<octave_idx_type> js = j.sort (jsi, 0, DESCENDING);
640  octave_idx_type nj = js.length ();
641  bool dups = false;
642  for (octave_idx_type i = 0; i < nj - 1; i++)
643  dups = dups && js(i) == js(i+1);
644 
645  if (dups)
646  (*current_liboctave_error_handler) ("qrinsert: duplicate index detected");
647  else if (nj > 0 && (js(0) > n-1 || js(nj-1) < 0))
648  (*current_liboctave_error_handler) ("qrinsert: index out of range");
649  else if (nj > 0)
650  {
651  ComplexMatrix a = q*r;
652  for (octave_idx_type i = 0; i < js.length (); i++)
653  a = ::delete_col (a, js(i));
654  init (a, get_type ());
655  }
656 }
657 
658 void
660 {
661  warn_qrupdate_once ();
662 
663  octave_idx_type m = r.rows ();
664  octave_idx_type n = r.columns ();
665 
666  if (! q.is_square () || u.length () != n)
667  (*current_liboctave_error_handler) ("qrinsert: dimensions mismatch");
668  else if (j < 0 || j > m)
669  (*current_liboctave_error_handler) ("qrinsert: index out of range");
670  else
671  {
672  init (::insert_row (q*r, j, u), get_type ());
673  }
674 }
675 
676 void
678 {
679  warn_qrupdate_once ();
680 
681  octave_idx_type m = r.rows ();
682 
683  if (! q.is_square ())
684  (*current_liboctave_error_handler) ("qrdelete: dimensions mismatch");
685  else if (j < 0 || j > m-1)
686  (*current_liboctave_error_handler) ("qrdelete: index out of range");
687  else
688  {
689  init (::delete_row (q*r, j), get_type ());
690  }
691 }
692 
693 void
695 {
696  warn_qrupdate_once ();
697 
698  octave_idx_type n = r.columns ();
699 
700  if (i < 0 || i > n-1 || j < 0 || j > n-1)
701  (*current_liboctave_error_handler) ("qrshift: index out of range");
702  else
703  {
704  init (::shift_cols (q*r, i, j), get_type ());
705  }
706 }
707 
708 #endif
static const idx_vector colon
Definition: idx-vector.h:492
void delete_elements(const idx_vector &i)
Deleting elements.
Definition: Array.cc:1393
void shift_cols(octave_idx_type i, octave_idx_type j)
Definition: CmplxQR.cc:449
void update(const ComplexColumnVector &u, const ComplexColumnVector &v)
Definition: CmplxQR.cc:209
void delete_row(octave_idx_type j)
Definition: CmplxQR.cc:426
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
ComplexMatrix r
Definition: base-qr.h:74
ComplexMatrix hermitian(void) const
Definition: CMatrix.h:149
Array< T > sort(int dim=0, sortmode mode=ASCENDING) const
Definition: Array.cc:1766
ComplexQR(void)
Definition: CmplxQR.h:41
void form(octave_idx_type n, ComplexMatrix &afact, Complex *tau, qr_type_t qr_type)
Definition: CmplxQR.cc:137
F77_RET_T F77_FUNC(zgeqrf, ZGEQRF)(const octave_idx_type &
std::complex< double > w(std::complex< double > z, double relerr=0)
const T * data(void) const
Definition: Array.h:479
ComplexMatrix q
Definition: base-qr.h:73
qr_type_t
Definition: base-qr.h:30
bool is_square(void) const
Definition: Array.h:470
void insert_row(const ComplexRowVector &u, octave_idx_type j)
Definition: CmplxQR.cc:402
#define F77_RET_T
Definition: f77-fcn.h:264
void init(const ComplexMatrix &, qr_type_t=qr_type_std)
Definition: CmplxQR.cc:105
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 insert_col(const ComplexColumnVector &u, octave_idx_type j)
Definition: CmplxQR.cc:256
void resize(octave_idx_type nr, octave_idx_type nc, const Complex &rfv=Complex(0))
Definition: CMatrix.h:170
void delete_col(octave_idx_type j)
Definition: CmplxQR.cc:333
#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< double > Complex
Definition: oct-cmplx.h:29
const T * fortran_vec(void) const
Definition: Array.h:481
octave_idx_type cols(void) const
Definition: Array.h:321
ComplexColumnVector column(octave_idx_type i) const
Definition: CMatrix.cc:996
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