GNU Octave 10.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-2025 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
34
36
37template <typename T>
38class qr
39{
40public:
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 {
51 };
52
53 qr () : m_q (), m_r () { }
54
55 qr (const T& a, type qr_type = qr::std)
56 : m_q (), m_r ()
57 {
58 init (a, qr_type);
59 }
60
61 OCTAVE_API qr (const T& m_q, const T& m_r);
62
63 qr (const qr& a) : m_q (a.m_q), m_r (a.m_r) { }
64
65 qr& operator = (const qr& a)
66 {
67 if (this != &a)
68 {
69 m_q = a.m_q;
70 m_r = a.m_r;
71 }
72
73 return *this;
74 }
75
76 virtual ~qr () = default;
77
78 T Q () const { return m_q; }
79
80 T R () const { return m_r; }
81
82 OCTAVE_API type get_type () const;
83
84 OCTAVE_API bool regular () const;
85
86 OCTAVE_API void init (const T& a, type qr_type);
87
88 OCTAVE_API void update (const CV_T& u, const CV_T& v);
89
90 OCTAVE_API void update (const T& u, const T& v);
91
93
94 OCTAVE_API void insert_col (const T& u, const Array<octave_idx_type>& j);
95
97
99
101
103
105
106protected:
107
110
111 OCTAVE_API void
112 form (octave_idx_type n, T& afact, ELT_T *tau, type qr_type);
113};
114
116
117OCTAVE_END_NAMESPACE(math)
118OCTAVE_END_NAMESPACE(octave)
119
120#endif
N Dimensional Array with copy-on-write semantics.
Definition Array.h:130
Definition qr.h:39
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:42
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:53
T::row_vector_type RV_T
Definition qr.h:43
void delete_col(octave_idx_type j)
void update(const CV_T &u, const CV_T &v)
type
Definition qr.h:47
@ economy
Definition qr.h:50
@ std
Definition qr.h:48
@ raw
Definition qr.h:49
T Q() const
Definition qr.h:78
bool regular() const
Definition qr.cc:89
void form(octave_idx_type n, T &afact, ELT_T *tau, type qr_type)
qr & operator=(const qr &a)
Definition qr.h:65
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:73
void shift_cols(octave_idx_type i, octave_idx_type j)
T m_r
Definition qr.h:109
void init(const T &a, type qr_type)
T m_q
Definition qr.h:108
qr(const qr &a)
Definition qr.h:63
T::column_vector_type CV_T
Definition qr.h:44
T R() const
Definition qr.h:80
qr(const T &a, type qr_type=qr::std)
Definition qr.h:55
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55
void warn_qrupdate_once()