GNU Octave  3.8.0
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-2013 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 <iosfwd>
27 
28 #include "dMatrix.h"
29 #include "CMatrix.h"
30 #include "CColVector.h"
31 
32 class
33 OCTAVE_API
34 EIG
35 {
36  friend class Matrix;
37  friend class ComplexMatrix;
38 
39 public:
40 
41  EIG (void) : lambda (), v () { }
42 
43  EIG (const Matrix& a, bool calc_eigenvectors = true)
44  : lambda (), v ()
45  {
46  init (a, calc_eigenvectors);
47  }
48 
49  EIG (const Matrix& a, octave_idx_type& info, bool calc_eigenvectors = true)
50  : lambda (), v ()
51  {
52  info = init (a, calc_eigenvectors);
53  }
54 
55  EIG (const Matrix& a, const Matrix& b, bool calc_eigenvectors = true)
56  : lambda (), v ()
57  {
58  init (a, b, calc_eigenvectors);
59  }
60 
61  EIG (const Matrix& a, const Matrix& b, octave_idx_type& info,
62  bool calc_eigenvectors = true)
63  : lambda (), v ()
64  {
65  info = init (a, b, calc_eigenvectors);
66  }
67 
68  EIG (const ComplexMatrix& a, bool calc_eigenvectors = true)
69  : lambda (), v ()
70  {
71  init (a, calc_eigenvectors);
72  }
73 
74  EIG (const ComplexMatrix& a, octave_idx_type& info,
75  bool calc_eigenvectors = true)
76  : lambda (), v ()
77  {
78  info = init (a, calc_eigenvectors);
79  }
80 
81  EIG (const ComplexMatrix& a, const ComplexMatrix& b,
82  bool calc_eigenvectors = true)
83  : lambda (), v ()
84  {
85  init (a, b, calc_eigenvectors);
86  }
87 
88  EIG (const ComplexMatrix& a, const ComplexMatrix& b,
89  octave_idx_type& info, bool calc_eigenvectors = true)
90  : lambda (), v ()
91  {
92  info = init (a, b, calc_eigenvectors);
93  }
94 
95  EIG (const EIG& a)
96  : lambda (a.lambda), v (a.v) { }
97 
98  EIG& operator = (const EIG& a)
99  {
100  if (this != &a)
101  {
102  lambda = a.lambda;
103  v = a.v;
104  }
105  return *this;
106  }
107 
108  ~EIG (void) { }
109 
110  ComplexColumnVector eigenvalues (void) const { return lambda; }
111 
112  ComplexMatrix eigenvectors (void) const { return v; }
113 
114  friend std::ostream& operator << (std::ostream& os, const EIG& a);
115 
116 private:
117 
120 
121  octave_idx_type init (const Matrix& a, bool calc_eigenvectors);
122 
123  octave_idx_type init (const Matrix& a, const Matrix& b,
124  bool calc_eigenvectors);
125 
126  octave_idx_type init (const ComplexMatrix& a, bool calc_eigenvectors);
127 
128  octave_idx_type init (const ComplexMatrix& a, const ComplexMatrix& b,
129  bool calc_eigenvectors);
130 
131  octave_idx_type symmetric_init (const Matrix& a, bool calc_eigenvectors);
132 
133  octave_idx_type symmetric_init (const Matrix& a, const Matrix& b,
134  bool calc_eigenvectors);
135 
136  octave_idx_type hermitian_init (const ComplexMatrix& a,
137  bool calc_eigenvectors);
138 
139  octave_idx_type hermitian_init (const ComplexMatrix& a,
140  const ComplexMatrix& b,
141  bool calc_eigenvectors);
142 
143 };
144 
145 #endif