GNU Octave  4.4.1
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-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_schur_h)
24 #define octave_schur_h 1
25 
26 #include "octave-config.h"
27 
28 #include <string>
29 
30 // FIXME: Don't really need these for compiling schur.h, but it messes
31 // up compilation in liboctave/array if these are not present.
32 #include "CMatrix.h"
33 #include "dMatrix.h"
34 #include "fCMatrix.h"
35 #include "fMatrix.h"
36 
37 namespace octave
38 {
39  namespace math
40  {
41  template <typename T>
42  class
43  schur
44  {
45  public:
46 
47  schur (void) : schur_mat (), unitary_mat () { }
48 
49  schur (const T& a, const std::string& ord, bool calc_unitary = true)
50  : schur_mat (), unitary_mat ()
51  {
52  init (a, ord, calc_unitary);
53  }
54 
55  schur (const T& a, const std::string& ord, octave_f77_int_type& info,
56  bool calc_unitary = true)
57  : schur_mat (), unitary_mat ()
58  {
59  info = init (a, ord, calc_unitary);
60  }
61 
62  // This one should really be protected or private but we need it in
63  // rsf2csf and I don't see how to make that function a friend of
64  // this class.
65  schur (const T& s, const T& u) : schur_mat (s), unitary_mat (u) { }
66 
67  schur (const schur& a)
68  : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat)
69  { }
70 
71  schur& operator = (const schur& a)
72  {
73  if (this != &a)
74  {
75  schur_mat = a.schur_mat;
76  unitary_mat = a.unitary_mat;
77  }
78 
79  return *this;
80  }
81 
82  ~schur (void) = default;
83 
84  T schur_matrix (void) const { return schur_mat; }
85 
86  T unitary_matrix (void) const { return unitary_mat; }
87 
88  protected:
89 
90  private:
91 
94 
95  octave_f77_int_type
96  init (const T& a, const std::string& ord, bool calc_unitary);
97  };
98 
99  template <typename RT, typename AT>
100  extern schur<RT>
101  rsf2csf (const AT& s, const AT& u);
102  }
103 }
104 
105 #endif
schur(const T &s, const T &u)
Definition: schur.h:65
u
Definition: lu.cc:138
s
Definition: file-io.cc:2729
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
schur(const T &a, const std::string &ord, bool calc_unitary=true)
Definition: schur.h:49
T schur_matrix(void) const
Definition: schur.h:84
T unitary_matrix(void) const
Definition: schur.h:86
schur(const schur &a)
Definition: schur.h:67
schur(const T &a, const std::string &ord, octave_f77_int_type &info, bool calc_unitary=true)
Definition: schur.h:55
schur< RT > rsf2csf(const AT &s, const AT &u)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888