462
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
462
|
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 2, or (at your option) any |
|
10 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, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
462
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_EIG_h) |
|
24 #define octave_EIG_h 1 |
|
25 |
4192
|
26 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION) |
1296
|
27 #pragma interface |
|
28 #endif |
|
29 |
3503
|
30 #include <iostream> |
462
|
31 |
|
32 #include "dMatrix.h" |
|
33 #include "CMatrix.h" |
|
34 #include "CColVector.h" |
|
35 |
1867
|
36 class |
|
37 EIG |
462
|
38 { |
|
39 friend class Matrix; |
|
40 friend class ComplexMatrix; |
|
41 |
|
42 public: |
|
43 |
1867
|
44 EIG (void) |
|
45 : lambda (), v () { } |
462
|
46 |
4725
|
47 EIG (const Matrix& a, bool calc_eigenvectors = true) |
|
48 { init (a, calc_eigenvectors); } |
1867
|
49 |
4725
|
50 EIG (const Matrix& a, int& info, bool calc_eigenvectors = true) |
|
51 { info = init (a, calc_eigenvectors); } |
1528
|
52 |
4725
|
53 EIG (const ComplexMatrix& a, bool calc_eigenvectors = true) |
|
54 { init (a, calc_eigenvectors); } |
1867
|
55 |
4725
|
56 EIG (const ComplexMatrix& a, int& info, bool calc_eigenvectors = true) |
|
57 { info = init (a, calc_eigenvectors); } |
462
|
58 |
1528
|
59 EIG (const EIG& a) |
1867
|
60 : lambda (a.lambda), v (a.v) { } |
462
|
61 |
1528
|
62 EIG& operator = (const EIG& a) |
|
63 { |
1867
|
64 if (this != &a) |
|
65 { |
|
66 lambda = a.lambda; |
|
67 v = a.v; |
|
68 } |
1528
|
69 return *this; |
|
70 } |
|
71 |
1934
|
72 ~EIG (void) { } |
|
73 |
1528
|
74 ComplexColumnVector eigenvalues (void) const { return lambda; } |
|
75 |
|
76 ComplexMatrix eigenvectors (void) const { return v; } |
462
|
77 |
3504
|
78 friend std::ostream& operator << (std::ostream& os, const EIG& a); |
462
|
79 |
|
80 private: |
|
81 |
1867
|
82 ComplexColumnVector lambda; |
|
83 ComplexMatrix v; |
|
84 |
4725
|
85 int init (const Matrix& a, bool calc_eigenvectors); |
|
86 int init (const ComplexMatrix& a, bool calc_eigenvectors); |
2815
|
87 |
4725
|
88 int symmetric_init (const Matrix& a, bool calc_eigenvectors); |
|
89 int hermitian_init (const ComplexMatrix& a, bool calc_eigenvectors); |
462
|
90 }; |
|
91 |
|
92 #endif |
|
93 |
|
94 /* |
|
95 ;;; Local Variables: *** |
|
96 ;;; mode: C++ *** |
|
97 ;;; End: *** |
|
98 */ |