GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
qr.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 1994-2026 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
35
36template <typename T>
37class qr
38{
39public:
40
41 typedef typename T::element_type ELT_T;
42 typedef typename T::row_vector_type RV_T;
43 typedef typename T::column_vector_type CV_T;
44
45 enum type
46 {
50 };
51
52 qr () : m_q (), m_r () { }
53
54 qr (const T& a, type qr_type = qr::std)
55 : m_q (), m_r ()
56 {
57 init (a, qr_type);
58 }
59
60 OCTAVE_API qr (const T& m_q, const T& m_r);
61
62 qr (const qr& a) : m_q (a.m_q), m_r (a.m_r) { }
63
64 qr& operator = (const qr& a)
65 {
66 if (this != &a)
67 {
68 m_q = a.m_q;
69 m_r = a.m_r;
70 }
71
72 return *this;
73 }
74
75 virtual ~qr () = default;
76
77 T Q () const { return m_q; }
78
79 T R () const { return m_r; }
80
81 OCTAVE_API type get_type () const;
82
83 OCTAVE_API bool regular () const;
84
85 OCTAVE_API void init (const T& a, type qr_type);
86
87 OCTAVE_API void update (const CV_T& u, const CV_T& v);
88
89 OCTAVE_API void update (const T& u, const T& v);
90
92
93 OCTAVE_API void insert_col (const T& u, const Array<octave_idx_type>& j);
94
96
98
100
102
104
105protected:
106
109
110 OCTAVE_API void
111 form (octave_idx_type n, T& afact, ELT_T *tau, type qr_type);
112};
113
115
116OCTAVE_END_NAMESPACE(math)
117OCTAVE_END_NAMESPACE(octave)
118
119#endif
N Dimensional Array with copy-on-write semantics.
Definition Array-base.h:130
Definition qr.h:38
void update(const T &u, const T &v)
void insert_row(const RV_T &u, octave_idx_type j)
T::element_type ELT_T
Definition qr.h:41
void insert_col(const T &u, const Array< octave_idx_type > &j)
void delete_row(octave_idx_type j)
virtual ~qr()=default
qr()
Definition qr.h:52
T::row_vector_type RV_T
Definition qr.h:42
void delete_col(octave_idx_type j)
void update(const CV_T &u, const CV_T &v)
type
Definition qr.h:46
@ economy
Definition qr.h:49
@ std
Definition qr.h:47
@ raw
Definition qr.h:48
T Q() const
Definition qr.h:77
bool regular() const
Definition qr.cc:88
void form(octave_idx_type n, T &afact, ELT_T *tau, type qr_type)
qr & operator=(const qr &a)
Definition qr.h:64
void insert_col(const CV_T &u, octave_idx_type j)
void delete_col(const Array< octave_idx_type > &j)
type get_type() const
Definition qr.cc:72
void shift_cols(octave_idx_type i, octave_idx_type j)
T m_r
Definition qr.h:108
void init(const T &a, type qr_type)
T m_q
Definition qr.h:107
qr(const qr &a)
Definition qr.h:62
T::column_vector_type CV_T
Definition qr.h:43
T R() const
Definition qr.h:79
qr(const T &a, type qr_type=qr::std)
Definition qr.h:54
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55
void warn_qrupdate_once()