GNU Octave 11.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
schur.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_schur_h)
27#define octave_schur_h 1
28
29#include "octave-config.h"
30
31#include <string>
32
33// FIXME: Don't really need these for compiling schur.h, but it messes
34// up compilation in liboctave/array if these are not present.
35#include "CMatrix.h"
36#include "dMatrix.h"
37#include "fCMatrix.h"
38#include "fMatrix.h"
39
42
43template <typename T>
44class schur
45{
46public:
47
48 schur () : m_schur_mat (), m_unitary_schur_mat () { }
49
50 schur (const T& a, const std::string& ord, bool calc_unitary = true)
51 : m_schur_mat (), m_unitary_schur_mat ()
52 {
53 init (a, ord, calc_unitary);
54 }
55
56 schur (const T& a, const std::string& ord, octave_f77_int_type& info,
57 bool calc_unitary = true)
58 : m_schur_mat (), m_unitary_schur_mat ()
59 {
60 info = init (a, ord, calc_unitary);
61 }
62
63 // This one should really be protected or private but we need it in
64 // rsf2csf and I don't see how to make that function a friend of
65 // this class.
66 schur (const T& s, const T& u) : m_schur_mat (s), m_unitary_schur_mat (u)
67 { }
68
69 schur (const schur& a)
70 : m_schur_mat (a.m_schur_mat),
71 m_unitary_schur_mat (a.m_unitary_schur_mat)
72 { }
73
75 {
76 if (this != &a)
77 {
78 m_schur_mat = a.m_schur_mat;
79 m_unitary_schur_mat = a.m_unitary_schur_mat;
80 }
81
82 return *this;
83 }
84
85 ~schur () = default;
86
87 T schur_matrix () const { return m_schur_mat; }
88
89 T unitary_schur_matrix () const { return m_unitary_schur_mat; }
90
91protected:
92
93private:
94
95 T m_schur_mat;
96 T m_unitary_schur_mat;
97
98 OCTAVE_API octave_f77_int_type
99 init (const T& a, const std::string& ord, bool calc_unitary);
100};
101
102template <typename RT, typename AT>
104rsf2csf (const AT& s, const AT& u);
105
106OCTAVE_END_NAMESPACE(math)
107OCTAVE_END_NAMESPACE(octave)
108
109#endif
Definition schur.h:45
T unitary_schur_matrix() const
Definition schur.h:89
schur()
Definition schur.h:48
schur(const schur &a)
Definition schur.h:69
T schur_matrix() const
Definition schur.h:87
schur(const T &s, const T &u)
Definition schur.h:66
schur(const T &a, const std::string &ord, octave_f77_int_type &info, bool calc_unitary=true)
Definition schur.h:56
schur(const T &a, const std::string &ord, bool calc_unitary=true)
Definition schur.h:50
~schur()=default
schur & operator=(const schur &a)
Definition schur.h:74
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition main.in.cc:55
schur< RT > rsf2csf(const AT &s, const AT &u)