462
|
1 // -*- C++ -*- |
|
2 /* |
|
3 |
1867
|
4 Copyright (C) 1996 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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
462
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (octave_EIG_h) |
|
25 #define octave_EIG_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
462
|
31 class ostream; |
|
32 |
|
33 #include "dMatrix.h" |
|
34 #include "CMatrix.h" |
|
35 #include "CColVector.h" |
|
36 |
1867
|
37 class |
|
38 EIG |
462
|
39 { |
|
40 friend class Matrix; |
|
41 friend class ComplexMatrix; |
|
42 |
|
43 public: |
|
44 |
1867
|
45 EIG (void) |
|
46 : lambda (), v () { } |
462
|
47 |
1528
|
48 EIG (const Matrix& a) { init (a); } |
1867
|
49 |
1528
|
50 EIG (const Matrix& a, int& info) { info = init (a); } |
|
51 |
|
52 EIG (const ComplexMatrix& a) { init (a); } |
1867
|
53 |
1528
|
54 EIG (const ComplexMatrix& a, int& info) { info = init (a); } |
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 |
|
75 friend ostream& operator << (ostream& os, const EIG& a); |
|
76 |
|
77 private: |
|
78 |
1867
|
79 ComplexColumnVector lambda; |
|
80 ComplexMatrix v; |
|
81 |
462
|
82 int init (const Matrix& a); |
|
83 int init (const ComplexMatrix& a); |
|
84 }; |
|
85 |
|
86 #endif |
|
87 |
|
88 /* |
|
89 ;;; Local Variables: *** |
|
90 ;;; mode: C++ *** |
|
91 ;;; page-delimiter: "^/\\*" *** |
|
92 ;;; End: *** |
|
93 */ |