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
EIG.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_EIG_h)
24 #define octave_EIG_h 1
25 
26 #include "octave-config.h"
27 
28 #include <iosfwd>
29 
30 #include "dMatrix.h"
31 #include "CMatrix.h"
32 #include "CColVector.h"
33 
34 class
35 OCTAVE_API
36 EIG
37 {
38  friend class Matrix;
39  friend class ComplexMatrix;
40 
41 public:
42 
43  EIG (void) : lambda (), v (), w () { }
44 
45  EIG (const Matrix& 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 
52  EIG (const Matrix& a, octave_idx_type& info,
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  EIG (const Matrix& a, const Matrix& 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 
66  EIG (const Matrix& a, const Matrix& b, octave_idx_type& info,
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  EIG (const ComplexMatrix& 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 
87  EIG (const ComplexMatrix& a, const ComplexMatrix& b,
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 
94  EIG (const ComplexMatrix& a, const ComplexMatrix& b,
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  EIG (const EIG& a) : lambda (a.lambda), v (a.v), w (a.w) { }
103 
104  EIG& operator = (const EIG& a)
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  ~EIG (void) { }
116 
117  ComplexColumnVector eigenvalues (void) const { return lambda; }
118  ComplexMatrix right_eigenvectors (void) const { return v; }
119  ComplexMatrix left_eigenvectors (void) const { return w; }
120 
121  friend std::ostream& operator << (std::ostream& os, const EIG& a);
122 
123 private:
124 
128 
129  octave_idx_type init (const Matrix& a, bool calc_rev, bool calc_lev,
130  bool balance);
131 
132  octave_idx_type init (const Matrix& a, const Matrix& b,
133  bool calc_rev, bool calc_lev, bool force_qz);
134 
135  octave_idx_type init (const ComplexMatrix& a, bool calc_rev,
136  bool calc_lev, bool balance);
137 
138  octave_idx_type init (const ComplexMatrix& a, const ComplexMatrix& b,
139  bool calc_rev, bool calc_lev, bool force_qz);
140 
141  octave_idx_type symmetric_init (const Matrix& a, bool calc_rev,
142  bool calc_lev);
143 
144  octave_idx_type symmetric_init (const Matrix& a, const Matrix& b,
145  bool calc_rev, bool calc_lev);
146 
147  octave_idx_type hermitian_init (const ComplexMatrix& a,
148  bool calc_rev, bool calc_lev);
149 
150  octave_idx_type hermitian_init (const ComplexMatrix& a,
151  const ComplexMatrix& b,
152  bool calc_rev, bool calc_lev);
153 
154 };
155 
156 #endif
EIG(const ComplexMatrix &a, const ComplexMatrix &b, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: EIG.h:94
EIG(const EIG &a)
Definition: EIG.h:102
Definition: EIG.h:34
~EIG(void)
Definition: EIG.h:115
ComplexMatrix left_eigenvectors(void) const
Definition: EIG.h:119
EIG(const Matrix &a, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: EIG.h:45
ComplexColumnVector eigenvalues(void) const
Definition: EIG.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
EIG(void)
Definition: EIG.h:43
std::complex< double > w(std::complex< double > z, double relerr=0)
EIG(const ComplexMatrix &a, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: EIG.h:73
ComplexNDArray & operator=(const ComplexNDArray &a)
Definition: CNDArray.h:57
Definition: dMatrix.h:37
ComplexMatrix w
Definition: EIG.h:127
ComplexColumnVector lambda
Definition: EIG.h:125
EIG(const ComplexMatrix &a, const ComplexMatrix &b, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: EIG.h:87
EIG(const ComplexMatrix &a, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: EIG.h:80
template OCTAVE_API std::ostream & operator<<(std::ostream &, const Array< bool > &)
ComplexMatrix v
Definition: EIG.h:126
b
Definition: cellfun.cc:398
ComplexMatrix right_eigenvectors(void) const
Definition: EIG.h:118
EIG(const Matrix &a, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool balance=true)
Definition: EIG.h:52
EIG(const Matrix &a, const Matrix &b, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: EIG.h:59
EIG(const Matrix &a, const Matrix &b, octave_idx_type &info, bool calc_rev=true, bool calc_lev=true, bool force_qz=false)
Definition: EIG.h:66