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