GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
qr.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1994-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_qr_h)
27#define octave_qr_h 1
28
29#include "octave-config.h"
30
31#include "Array-fwd.h"
32
33namespace octave
34{
35 namespace math
36 {
37 template <typename T>
38 class
39 qr
40 {
41 public:
42
43 typedef typename T::element_type ELT_T;
44 typedef typename T::row_vector_type RV_T;
45 typedef typename T::column_vector_type CV_T;
46
47 enum type
48 {
51 economy
52 };
53
54 qr (void) : m_q (), m_r () { }
55
56 qr (const T& a, type qr_type = qr::std)
57 : m_q (), m_r ()
58 {
59 init (a, qr_type);
60 }
61
62 OCTAVE_API qr (const T& m_q, const T& m_r);
63
64 qr (const qr& a) : m_q (a.m_q), m_r (a.m_r) { }
65
66 qr& operator = (const qr& a)
67 {
68 if (this != &a)
69 {
70 m_q = a.m_q;
71 m_r = a.m_r;
72 }
73
74 return *this;
75 }
76
77 virtual ~qr (void) = default;
78
79 T Q (void) const { return m_q; }
80
81 T R (void) const { return m_r; }
82
83 OCTAVE_API type get_type (void) const;
84
85 OCTAVE_API bool regular (void) const;
86
87 OCTAVE_API void init (const T& a, type qr_type);
88
89 OCTAVE_API void update (const CV_T& u, const CV_T& v);
90
91 OCTAVE_API void update (const T& u, const T& v);
92
94
95 OCTAVE_API void insert_col (const T& u, const Array<octave_idx_type>& j);
96
98
100
102
104
106
107 protected:
108
111
112 OCTAVE_API void
113 form (octave_idx_type n, T& afact, ELT_T *tau, type qr_type);
114 };
115
116 extern OCTAVE_API void warn_qrupdate_once (void);
117 }
118}
119
120#endif
T R(void) const
Definition: qr.h:81
OCTAVE_API void update(const CV_T &u, const CV_T &v)
OCTAVE_API void delete_col(octave_idx_type j)
OCTAVE_API void update(const T &u, const T &v)
T::element_type ELT_T
Definition: qr.h:43
OCTAVE_API void insert_col(const T &u, const Array< octave_idx_type > &j)
qr(void)
Definition: qr.h:54
T Q(void) const
Definition: qr.h:79
qr(const qr &a)
Definition: qr.h:64
OCTAVE_API void shift_cols(octave_idx_type i, octave_idx_type j)
T::column_vector_type CV_T
Definition: qr.h:45
OCTAVE_API void form(octave_idx_type n, T &afact, ELT_T *tau, type qr_type)
OCTAVE_API void insert_row(const RV_T &u, octave_idx_type j)
OCTAVE_API void delete_col(const Array< octave_idx_type > &j)
OCTAVE_API void delete_row(octave_idx_type j)
virtual ~qr(void)=default
OCTAVE_API void insert_col(const CV_T &u, octave_idx_type j)
OCTAVE_API void init(const T &a, type qr_type)
T::row_vector_type RV_T
Definition: qr.h:44
qr(const T &a, type qr_type=qr::std)
Definition: qr.h:56
static math::qr< T >::type qr_type(int nargout, bool economy)
Definition: qr.cc:74
#define OCTAVE_API
Definition: main.in.cc:55
OCTAVE_API void warn_qrupdate_once(void)