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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
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 |
|
34 EIG |
462
|
35 { |
|
36 friend class Matrix; |
|
37 friend class ComplexMatrix; |
|
38 |
|
39 public: |
|
40 |
1867
|
41 EIG (void) |
|
42 : lambda (), v () { } |
462
|
43 |
4725
|
44 EIG (const Matrix& a, bool calc_eigenvectors = true) |
|
45 { init (a, calc_eigenvectors); } |
1867
|
46 |
5275
|
47 EIG (const Matrix& a, octave_idx_type& info, bool calc_eigenvectors = true) |
4725
|
48 { info = init (a, calc_eigenvectors); } |
1528
|
49 |
4725
|
50 EIG (const ComplexMatrix& a, bool calc_eigenvectors = true) |
|
51 { init (a, calc_eigenvectors); } |
1867
|
52 |
5275
|
53 EIG (const ComplexMatrix& a, octave_idx_type& info, bool calc_eigenvectors = true) |
4725
|
54 { info = init (a, calc_eigenvectors); } |
462
|
55 |
1528
|
56 EIG (const EIG& a) |
1867
|
57 : lambda (a.lambda), v (a.v) { } |
462
|
58 |
1528
|
59 EIG& operator = (const EIG& a) |
|
60 { |
1867
|
61 if (this != &a) |
|
62 { |
|
63 lambda = a.lambda; |
|
64 v = a.v; |
|
65 } |
1528
|
66 return *this; |
|
67 } |
|
68 |
1934
|
69 ~EIG (void) { } |
|
70 |
1528
|
71 ComplexColumnVector eigenvalues (void) const { return lambda; } |
|
72 |
|
73 ComplexMatrix eigenvectors (void) const { return v; } |
462
|
74 |
3504
|
75 friend std::ostream& operator << (std::ostream& os, const EIG& a); |
462
|
76 |
|
77 private: |
|
78 |
1867
|
79 ComplexColumnVector lambda; |
|
80 ComplexMatrix v; |
|
81 |
5275
|
82 octave_idx_type init (const Matrix& a, bool calc_eigenvectors); |
|
83 octave_idx_type init (const ComplexMatrix& a, bool calc_eigenvectors); |
2815
|
84 |
5275
|
85 octave_idx_type symmetric_init (const Matrix& a, bool calc_eigenvectors); |
|
86 octave_idx_type hermitian_init (const ComplexMatrix& a, bool calc_eigenvectors); |
462
|
87 }; |
|
88 |
|
89 #endif |
|
90 |
|
91 /* |
|
92 ;;; Local Variables: *** |
|
93 ;;; mode: C++ *** |
|
94 ;;; End: *** |
|
95 */ |