GNU Octave  6.2.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-2021 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 
40 namespace octave
41 {
42  namespace math
43  {
44  template <typename T>
45  class
46  schur
47  {
48  public:
49 
50  schur (void) : schur_mat (), unitary_mat () { }
51 
52  schur (const T& a, const std::string& ord, bool calc_unitary = true)
53  : schur_mat (), unitary_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  : schur_mat (), unitary_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) : schur_mat (s), unitary_mat (u) { }
69 
70  schur (const schur& a)
71  : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat)
72  { }
73 
74  schur& operator = (const schur& a)
75  {
76  if (this != &a)
77  {
78  schur_mat = a.schur_mat;
79  unitary_mat = a.unitary_mat;
80  }
81 
82  return *this;
83  }
84 
85  ~schur (void) = default;
86 
87  T schur_matrix (void) const { return schur_mat; }
88 
89  T unitary_matrix (void) const { return unitary_mat; }
90 
91  protected:
92 
93  private:
94 
97 
98  octave_f77_int_type
99  init (const T& a, const std::string& ord, bool calc_unitary);
100  };
101 
102  template <typename RT, typename AT>
103  extern schur<RT>
104  rsf2csf (const AT& s, const AT& u);
105  }
106 }
107 
108 #endif
schur(const T &a, const std::string &ord, bool calc_unitary=true)
Definition: schur.h:52
T unitary_matrix(void) const
Definition: schur.h:89
~schur(void)=default
T schur_matrix(void) const
Definition: schur.h:87
schur(const schur &a)
Definition: schur.h:70
octave_f77_int_type init(const T &a, const std::string &ord, bool calc_unitary)
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< RT > rsf2csf(const AT &s, const AT &u)