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