GNU Octave  4.2.1
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
qr.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2017 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 #if ! defined (octave_qr_h)
26 #define octave_qr_h 1
27 
28 #include "octave-config.h"
29 
30 #include "Array.h"
31 
32 namespace octave
33 {
34  namespace math
35  {
36  template <typename T>
37  class
38  qr
39  {
40  public:
41 
42  typedef typename T::element_type ELT_T;
43  typedef typename T::row_vector_type RV_T;
44  typedef typename T::column_vector_type CV_T;
45 
46  enum type
47  {
48  std,
49  raw,
50  economy
51  };
52 
53  qr (void) : q (), r () { }
54 
55  qr (const T& a, type qr_type = qr::std)
56  : q (), r ()
57  {
58  init (a, qr_type);
59  }
60 
61  qr (const T& q, const T& r);
62 
63  qr (const qr& a) : q (a.q), r (a.r) { }
64 
65  qr& operator = (const qr& a)
66  {
67  if (this != &a)
68  {
69  q = a.q;
70  r = a.r;
71  }
72 
73  return *this;
74  }
75 
76  virtual ~qr (void) { }
77 
78  T Q (void) const { return q; }
79 
80  T R (void) const { return r; }
81 
82  type get_type (void) const;
83 
84  bool regular (void) const;
85 
86  void init (const T& a, type qr_type);
87 
88  void update (const CV_T& u, const CV_T& v);
89 
90  void update (const T& u, const T& v);
91 
92  void insert_col (const CV_T& u, octave_idx_type j);
93 
94  void insert_col (const T& u, const Array<octave_idx_type>& j);
95 
96  void delete_col (octave_idx_type j);
97 
98  void delete_col (const Array<octave_idx_type>& j);
99 
100  void insert_row (const RV_T& u, octave_idx_type j);
101 
102  void delete_row (octave_idx_type j);
103 
104  void shift_cols (octave_idx_type i, octave_idx_type j);
105 
106  protected:
107 
108  T q;
109  T r;
110 
111  void form (octave_idx_type n, T& afact, ELT_T *tau, type qr_type);
112  };
113 
114  extern void warn_qrupdate_once (void);
115  }
116 }
117 
118 #endif
qr(void)
Definition: qr.h:53
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
T Q(void) const
Definition: qr.h:78
static octave::math::qr< T >::type qr_type(int nargin, int nargout)
Definition: qr.cc:51
OCTAVE_EXPORT octave_value_list while another program execution is suspended until the graphics object the function returns immediately In the second form
Definition: graphics.cc:11575
qr(const T &a, type qr_type=qr::std)
Definition: qr.h:55
u
Definition: lu.cc:138
void warn_qrupdate_once(void)
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:398
T::column_vector_type CV_T
Definition: qr.h:44
qr(const qr &a)
Definition: qr.h:63
idx type
Definition: ov.cc:3129
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
T::row_vector_type RV_T
Definition: qr.h:43
virtual ~qr(void)
Definition: qr.h:76
T::element_type ELT_T
Definition: qr.h:42
T R(void) const
Definition: qr.h:80