GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
schur.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1994-2023 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 
44 template <typename T>
45 class
46 schur
47 {
48 public:
49 
50  schur (void) : m_schur_mat (), m_unitary_schur_mat () { }
51 
52  schur (const T& a, const std::string& ord, bool calc_unitary = true)
53  : m_schur_mat (), m_unitary_schur_mat ()
54  {
55  init (a, ord, calc_unitary);
56  }
57 
58  schur (const T& a, const std::string& ord, octave_f77_int_type& info,
59  bool calc_unitary = true)
60  : m_schur_mat (), m_unitary_schur_mat ()
61  {
62  info = init (a, ord, calc_unitary);
63  }
64 
65  // This one should really be protected or private but we need it in
66  // rsf2csf and I don't see how to make that function a friend of
67  // this class.
68  schur (const T& s, const T& u) : m_schur_mat (s), m_unitary_schur_mat (u)
69  { }
70 
71  schur (const schur& a)
72  : m_schur_mat (a.m_schur_mat),
73  m_unitary_schur_mat (a.m_unitary_schur_mat)
74  { }
75 
76  schur& operator = (const schur& a)
77  {
78  if (this != &a)
79  {
80  m_schur_mat = a.m_schur_mat;
81  m_unitary_schur_mat = a.m_unitary_schur_mat;
82  }
83 
84  return *this;
85  }
86 
87  ~schur (void) = default;
88 
89  T schur_matrix (void) const { return m_schur_mat; }
90 
91  T unitary_schur_matrix (void) const { return m_unitary_schur_mat; }
92 
93 protected:
94 
95 private:
96 
99 
100  OCTAVE_API octave_f77_int_type
101  init (const T& a, const std::string& ord, bool calc_unitary);
102 };
103 
104 template <typename RT, typename AT>
105 extern OCTAVE_API schur<RT>
106 rsf2csf (const AT& s, const AT& u);
107 
110 
111 #endif
OCTAVE_END_NAMESPACE(octave)
Definition: schur.h:47
T unitary_schur_matrix(void) const
Definition: schur.h:91
schur(const schur &a)
Definition: schur.h:71
~schur(void)=default
T m_schur_mat
Definition: schur.h:97
T schur_matrix(void) const
Definition: schur.h:89
schur(const T &s, const T &u)
Definition: schur.h:68
schur(const T &a, const std::string &ord, octave_f77_int_type &info, bool calc_unitary=true)
Definition: schur.h:58
schur(void)
Definition: schur.h:50
OCTAVE_API octave_f77_int_type init(const T &a, const std::string &ord, bool calc_unitary)
schur(const T &a, const std::string &ord, bool calc_unitary=true)
Definition: schur.h:52
T m_unitary_schur_mat
Definition: schur.h:98
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define OCTAVE_API
Definition: main.in.cc:55
OCTAVE_API schur< RT > rsf2csf(const AT &s, const AT &u)