00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined (octave_EIG_h)
00024 #define octave_EIG_h 1
00025
00026 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00027 #pragma interface
00028 #endif
00029
00030 #include <iostream>
00031
00032 #include "dMatrix.h"
00033 #include "CMatrix.h"
00034 #include "CColVector.h"
00035
00036 class
00037 EIG
00038 {
00039 friend class Matrix;
00040 friend class ComplexMatrix;
00041
00042 public:
00043
00044 EIG (void)
00045 : lambda (), v () { }
00046
00047 EIG (const Matrix& a, bool calc_eigenvectors = true)
00048 { init (a, calc_eigenvectors); }
00049
00050 EIG (const Matrix& a, int& info, bool calc_eigenvectors = true)
00051 { info = init (a, calc_eigenvectors); }
00052
00053 EIG (const ComplexMatrix& a, bool calc_eigenvectors = true)
00054 { init (a, calc_eigenvectors); }
00055
00056 EIG (const ComplexMatrix& a, int& info, bool calc_eigenvectors = true)
00057 { info = init (a, calc_eigenvectors); }
00058
00059 EIG (const EIG& a)
00060 : lambda (a.lambda), v (a.v) { }
00061
00062 EIG& operator = (const EIG& a)
00063 {
00064 if (this != &a)
00065 {
00066 lambda = a.lambda;
00067 v = a.v;
00068 }
00069 return *this;
00070 }
00071
00072 ~EIG (void) { }
00073
00074 ComplexColumnVector eigenvalues (void) const { return lambda; }
00075
00076 ComplexMatrix eigenvectors (void) const { return v; }
00077
00078 friend std::ostream& operator << (std::ostream& os, const EIG& a);
00079
00080 private:
00081
00082 ComplexColumnVector lambda;
00083 ComplexMatrix v;
00084
00085 int init (const Matrix& a, bool calc_eigenvectors);
00086 int init (const ComplexMatrix& a, bool calc_eigenvectors);
00087
00088 int symmetric_init (const Matrix& a, bool calc_eigenvectors);
00089 int hermitian_init (const ComplexMatrix& a, bool calc_eigenvectors);
00090 };
00091
00092 #endif
00093
00094
00095
00096
00097
00098