GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
schur.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-2017 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://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 #include "dMatrix.h"
31 #include "CMatrix.h"
32 #include "fMatrix.h"
33 #include "fCMatrix.h"
34 
35 namespace octave
36 {
37  namespace math
38  {
39  template <typename T> class schur;
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_idx_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 
69  : schur_mat (a.schur_mat), unitary_mat (a.unitary_mat)
70  { }
71 
72  schur& operator = (const schur& a)
73  {
74  if (this != &a)
75  {
76  schur_mat = a.schur_mat;
77  unitary_mat = a.unitary_mat;
78  }
79 
80  return *this;
81  }
82 
83  ~schur (void) { }
84 
85  T schur_matrix (void) const { return schur_mat; }
86 
87  T unitary_matrix (void) const { return unitary_mat; }
88 
89  protected:
90 
91  private:
92 
95 
97  init (const T& a, const std::string& ord, bool calc_unitary);
98  };
99 
100  template <typename RT, typename AT>
101  extern schur<RT>
102  rsf2csf (const AT& s, const AT& u);
103  }
104 }
105 
106 #endif
Octave interface to the compression and uncompression libraries.
Definition: aepbalance.cc:47
schur(const schur &a)
Definition: schur.h:67
T unitary_matrix(void) const
Definition: schur.h:87
u
Definition: lu.cc:138
s
Definition: file-io.cc:2682
T schur_matrix(void) const
Definition: schur.h:85
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:398
octave_idx_type init(const Matrix &a, const std::string &ord, bool calc_unitary)
Definition: schur.cc:73
schur(const T &a, const std::string &ord, octave_idx_type &info, bool calc_unitary=true)
Definition: schur.h:55
schur(const T &s, const T &u)
Definition: schur.h:65
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:854
schur(const T &a, const std::string &ord, bool calc_unitary=true)
Definition: schur.h:49