00001
00002 #ifndef vnl_sparse_symmetric_eigensystem_h_
00003 #define vnl_sparse_symmetric_eigensystem_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vnl/vnl_sparse_matrix.h>
00019 #include <vcl_vector.h>
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 class vnl_sparse_symmetric_eigensystem
00030 {
00031 public:
00032 vnl_sparse_symmetric_eigensystem();
00033 ~vnl_sparse_symmetric_eigensystem();
00034
00035
00036
00037 int CalculateNPairs(vnl_sparse_matrix<double>& M, int n,
00038 bool smallest = true, long nfigures = 10);
00039
00040
00041
00042 vnl_vector<double> get_eigenvector(int i) const;
00043 double get_eigenvalue(int i) const;
00044
00045
00046 int CalculateProduct(int n, int m, const double* p, double* q);
00047 int SaveVectors(int n, int m, const double* q, int base);
00048 int RestoreVectors(int n, int m, double* q, int base);
00049
00050 protected:
00051 int nvalues;
00052 vnl_vector<double> * vectors;
00053 double * values;
00054
00055 vnl_sparse_matrix<double> * mat;
00056
00057 vcl_vector<double*> temp_store;
00058 };
00059
00060 #endif // vnl_sparse_symmetric_eigensystem_h_