462
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1994, 1995, 1996, 1997, 2000, 2002, 2004, 2005, 2006, |
|
4 2007 John W. Eaton |
462
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
462
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
462
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_EIG_h) |
|
25 #define octave_EIG_h 1 |
|
26 |
3503
|
27 #include <iostream> |
462
|
28 |
|
29 #include "dMatrix.h" |
|
30 #include "CMatrix.h" |
|
31 #include "CColVector.h" |
|
32 |
1867
|
33 class |
6108
|
34 OCTAVE_API |
1867
|
35 EIG |
462
|
36 { |
|
37 friend class Matrix; |
|
38 friend class ComplexMatrix; |
|
39 |
|
40 public: |
|
41 |
1867
|
42 EIG (void) |
|
43 : lambda (), v () { } |
462
|
44 |
4725
|
45 EIG (const Matrix& a, bool calc_eigenvectors = true) |
|
46 { init (a, calc_eigenvectors); } |
1867
|
47 |
5275
|
48 EIG (const Matrix& a, octave_idx_type& info, bool calc_eigenvectors = true) |
4725
|
49 { info = init (a, calc_eigenvectors); } |
1528
|
50 |
4725
|
51 EIG (const ComplexMatrix& a, bool calc_eigenvectors = true) |
|
52 { init (a, calc_eigenvectors); } |
1867
|
53 |
5275
|
54 EIG (const ComplexMatrix& a, octave_idx_type& info, bool calc_eigenvectors = true) |
4725
|
55 { info = init (a, calc_eigenvectors); } |
462
|
56 |
1528
|
57 EIG (const EIG& a) |
1867
|
58 : lambda (a.lambda), v (a.v) { } |
462
|
59 |
1528
|
60 EIG& operator = (const EIG& a) |
|
61 { |
1867
|
62 if (this != &a) |
|
63 { |
|
64 lambda = a.lambda; |
|
65 v = a.v; |
|
66 } |
1528
|
67 return *this; |
|
68 } |
|
69 |
1934
|
70 ~EIG (void) { } |
|
71 |
1528
|
72 ComplexColumnVector eigenvalues (void) const { return lambda; } |
|
73 |
|
74 ComplexMatrix eigenvectors (void) const { return v; } |
462
|
75 |
3504
|
76 friend std::ostream& operator << (std::ostream& os, const EIG& a); |
462
|
77 |
|
78 private: |
|
79 |
1867
|
80 ComplexColumnVector lambda; |
|
81 ComplexMatrix v; |
|
82 |
5275
|
83 octave_idx_type init (const Matrix& a, bool calc_eigenvectors); |
|
84 octave_idx_type init (const ComplexMatrix& a, bool calc_eigenvectors); |
2815
|
85 |
5275
|
86 octave_idx_type symmetric_init (const Matrix& a, bool calc_eigenvectors); |
|
87 octave_idx_type hermitian_init (const ComplexMatrix& a, bool calc_eigenvectors); |
462
|
88 }; |
|
89 |
|
90 #endif |
|
91 |
|
92 /* |
|
93 ;;; Local Variables: *** |
|
94 ;;; mode: C++ *** |
|
95 ;;; End: *** |
|
96 */ |