GNU Octave 10.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-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_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
41
43
44template <typename T>
45class schur
46{
47public:
48
49 schur () : m_schur_mat (), m_unitary_schur_mat () { }
50
51 schur (const T& a, const std::string& ord, bool calc_unitary = true)
52 : m_schur_mat (), m_unitary_schur_mat ()
53 {
54 init (a, ord, calc_unitary);
55 }
56
57 schur (const T& a, const std::string& ord, octave_f77_int_type& info,
58 bool calc_unitary = true)
59 : m_schur_mat (), m_unitary_schur_mat ()
60 {
61 info = init (a, ord, calc_unitary);
62 }
63
64 // This one should really be protected or private but we need it in
65 // rsf2csf and I don't see how to make that function a friend of
66 // this class.
67 schur (const T& s, const T& u) : m_schur_mat (s), m_unitary_schur_mat (u)
68 { }
69
70 schur (const schur& a)
71 : m_schur_mat (a.m_schur_mat),
72 m_unitary_schur_mat (a.m_unitary_schur_mat)
73 { }
74
76 {
77 if (this != &a)
78 {
79 m_schur_mat = a.m_schur_mat;
80 m_unitary_schur_mat = a.m_unitary_schur_mat;
81 }
82
83 return *this;
84 }
85
86 ~schur () = default;
87
88 T schur_matrix () const { return m_schur_mat; }
89
90 T unitary_schur_matrix () const { return m_unitary_schur_mat; }
91
92protected:
93
94private:
95
96 T m_schur_mat;
97 T m_unitary_schur_mat;
98
99 OCTAVE_API octave_f77_int_type
100 init (const T& a, const std::string& ord, bool calc_unitary);
101};
102
103template <typename RT, typename AT>
105rsf2csf (const AT& s, const AT& u);
106
107OCTAVE_END_NAMESPACE(math)
108OCTAVE_END_NAMESPACE(octave)
109
110#endif
Definition schur.h:46
T unitary_schur_matrix() const
Definition schur.h:90
schur()
Definition schur.h:49
schur(const schur &a)
Definition schur.h:70
T schur_matrix() const
Definition schur.h:88
schur(const T &s, const T &u)
Definition schur.h:67
schur(const T &a, const std::string &ord, octave_f77_int_type &info, bool calc_unitary=true)
Definition schur.h:57
schur(const T &a, const std::string &ord, bool calc_unitary=true)
Definition schur.h:51
~schur()=default
schur & operator=(const schur &a)
Definition schur.h:75
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)