GNU Octave  6.2.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-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_fEIG_h)
27 #define octave_fEIG_h 1
28 
29 #include "octave-config.h"
30 
31 #include <iosfwd>
32 
33 #include "fCColVector.h"
34 #include "fCMatrix.h"
35 
36 class FloatMatrix;
37 
38 class
39 OCTAVE_API
41 {
42  friend class FloatMatrix;
43  friend class FloatComplexMatrix;
44 
45 public:
46 
47  FloatEIG (void) : lambda (), v (), w () { }
48 
49  FloatEIG (const FloatMatrix& a, bool calc_rev = true,
50  bool calc_lev = true, bool balance = true)
51  : lambda (), v (), 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  : lambda (), v (), 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  : lambda (), v (), 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  : lambda (), v (), 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  : lambda (), v (), 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  : lambda (), v (), 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  : lambda (), v (), 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  : lambda (), v (), w ()
102  {
103  info = init (a, b, calc_rev, calc_lev, force_qz);
104  }
105 
106  FloatEIG (const FloatEIG& a) : lambda (a.lambda), v (a.v), w (a.w) { }
107 
109  {
110  if (this != &a)
111  {
112  lambda = a.lambda;
113  v = a.v;
114  w = a.w;
115  }
116  return *this;
117  }
118 
119  ~FloatEIG (void) = default;
120 
121  FloatComplexColumnVector eigenvalues (void) const { return lambda; }
122  FloatComplexMatrix right_eigenvectors (void) const { return v; }
123  FloatComplexMatrix left_eigenvectors (void) const { return 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
FloatComplexMatrix v
Definition: fEIG.h:130
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 w
Definition: fEIG.h:131
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
FloatComplexColumnVector lambda
Definition: fEIG.h:129
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
std::complex< double > w(std::complex< double > z, double relerr=0)