GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
fEIG.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_fEIG_h)
27 #define octave_fEIG_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 
33 #include "mx-fwd.h"
34 
35 #include "fCColVector.h"
36 #include "fCMatrix.h"
37 
38 class
41 {
42  friend class FloatMatrix;
43  friend class FloatComplexMatrix;
44 
45 public:
46 
47  FloatEIG (void) : m_lambda (), m_v (), m_w () { }
48 
49  FloatEIG (const FloatMatrix& a, bool calc_rev = true,
50  bool calc_lev = true, bool balance = true)
51  : m_lambda (), m_v (), m_w ()
52  {
53  init (a, calc_rev, calc_lev, balance);
54  }
55 
57  bool calc_rev = true, bool calc_lev = true, bool balance = true)
58  : m_lambda (), m_v (), m_w ()
59  {
60  info = init (a, calc_rev, calc_lev, balance);
61  }
62 
63  FloatEIG (const FloatMatrix& a, const FloatMatrix& b,
64  bool calc_rev = true, bool calc_lev = true, bool force_qz = false)
65  : m_lambda (), m_v (), m_w ()
66  {
67  init (a, b, calc_rev, calc_lev, force_qz);
68  }
69 
70  FloatEIG (const FloatMatrix& a, const FloatMatrix& b, octave_idx_type& info,
71  bool calc_rev = true, bool calc_lev = true, bool force_qz = false)
72  : m_lambda (), m_v (), m_w ()
73  {
74  info = init (a, b, calc_rev, calc_lev, force_qz);
75  }
76 
77  FloatEIG (const FloatComplexMatrix& a, bool calc_rev = true,
78  bool calc_lev = true, bool balance = true)
79  : m_lambda (), m_v (), m_w ()
80  {
81  init (a, calc_rev, calc_lev, balance);
82  }
83 
85  bool calc_rev = true, bool calc_lev = true, bool balance = true)
86  : m_lambda (), m_v (), m_w ()
87  {
88  info = init (a, calc_rev, calc_lev, balance);
89  }
90 
92  bool calc_rev = true, bool calc_lev = true, bool force_qz = false)
93  : m_lambda (), m_v (), m_w ()
94  {
95  init (a, b, calc_rev, calc_lev, force_qz);
96  }
97 
99  octave_idx_type& info, bool calc_rev = true, bool calc_lev = true,
100  bool force_qz = false)
101  : m_lambda (), m_v (), m_w ()
102  {
103  info = init (a, b, calc_rev, calc_lev, force_qz);
104  }
105 
106  FloatEIG (const FloatEIG& a) : m_lambda (a.m_lambda), m_v (a.m_v), m_w (a.m_w) { }
107 
109  {
110  if (this != &a)
111  {
112  m_lambda = a.m_lambda;
113  m_v = a.m_v;
114  m_w = a.m_w;
115  }
116  return *this;
117  }
118 
119  ~FloatEIG (void) = default;
120 
121  FloatComplexColumnVector eigenvalues (void) const { return m_lambda; }
122  FloatComplexMatrix right_eigenvectors (void) const { return m_v; }
123  FloatComplexMatrix left_eigenvectors (void) const { return m_w; }
124 
125  friend std::ostream& operator << (std::ostream& os, const FloatEIG& a);
126 
127 private:
128 
132 
133  octave_idx_type init (const FloatMatrix& a, bool calc_rev, bool calc_lev,
134  bool balance);
135 
136  octave_idx_type init (const FloatMatrix& a, const FloatMatrix& b,
137  bool calc_rev, bool calc_lev, bool force_qz);
138 
139  octave_idx_type init (const FloatComplexMatrix& a, bool calc_rev,
140  bool calc_lev, bool balance);
141 
142  octave_idx_type init (const FloatComplexMatrix& a,
143  const FloatComplexMatrix& b,
144  bool calc_rev, bool calc_lev, bool force_qz);
145 
146  octave_idx_type symmetric_init (const FloatMatrix& a, bool calc_rev,
147  bool calc_lev);
148 
149  octave_idx_type symmetric_init (const FloatMatrix& a, const FloatMatrix& b,
150  bool calc_rev, bool calc_lev);
151 
152  octave_idx_type hermitian_init (const FloatComplexMatrix& a,
153  bool calc_rev, bool calc_lev);
154 
155  octave_idx_type hermitian_init (const FloatComplexMatrix& a,
156  const FloatComplexMatrix& b,
157  bool calc_rev, bool calc_lev);
158 
159 };
160 
161 #endif
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
FloatComplexMatrix & operator=(const FloatComplexMatrix &a)=default
Definition: fEIG.h:41
FloatEIG(const FloatEIG &a)
Definition: fEIG.h:106
FloatComplexColumnVector m_lambda
Definition: fEIG.h:129
FloatComplexColumnVector eigenvalues(void) const
Definition: fEIG.h:121
FloatEIG(const FloatMatrix &a, const FloatMatrix &b, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: fEIG.h:63
FloatEIG(const FloatComplexMatrix &a, const FloatComplexMatrix &b, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: fEIG.h:91
FloatComplexMatrix left_eigenvectors(void) const
Definition: fEIG.h:123
FloatComplexMatrix right_eigenvectors(void) const
Definition: fEIG.h:122
FloatEIG(void)
Definition: fEIG.h:47
FloatEIG(const FloatComplexMatrix &a, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: fEIG.h:84
FloatEIG(const FloatMatrix &a, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: fEIG.h:56
FloatComplexMatrix m_v
Definition: fEIG.h:130
FloatComplexMatrix m_w
Definition: fEIG.h:131
FloatEIG(const FloatMatrix &a, const FloatMatrix &b, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: fEIG.h:70
FloatEIG(const FloatComplexMatrix &a, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: fEIG.h:77
FloatEIG(const FloatMatrix &a, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: fEIG.h:49
~FloatEIG(void)=default
FloatEIG(const FloatComplexMatrix &a, const FloatComplexMatrix &b, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: fEIG.h:98
#define OCTAVE_API
Definition: main.in.cc:55