EigValues.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * @file EigValues.h
  3. * @brief Computing eigenvalues and eigenvectors
  4. * @author Michael Koch,Erik Rodner
  5. * @date 08/19/2008
  6. */
  7. #ifndef EigValuesINCLUDE
  8. #define EigValuesINCLUDE
  9. #include "GenericMatrix.h"
  10. namespace NICE
  11. {
  12. /** Computing eigenvalues and eigenvectors */
  13. class EigValues
  14. {
  15. protected:
  16. public:
  17. /**
  18. * @param data matrix interface that does allow matrix-vector multiplications
  19. * @param k number of eigenvalues/eigenvectors
  20. * @param eigenvectors output Eigenvectors as Matrix
  21. * @param eigenvalues output Eigenvalues as Vector
  22. */
  23. virtual void getEigenvalues ( const GenericMatrix & data,
  24. NICE::Vector & eigenvalues,
  25. NICE::Matrix & eigenvectors, uint k ) = 0;
  26. virtual ~EigValues ()
  27. {
  28. };
  29. };
  30. /** arnoldi iteration */
  31. class EVArnoldi : public EigValues
  32. {
  33. protected:
  34. uint maxiterations;
  35. double mindelta;
  36. bool verbose;
  37. public:
  38. EVArnoldi ( bool verbose = false, uint _maxiterations = 100, double _mindelta = 0.01 )
  39. : maxiterations ( _maxiterations ), mindelta ( _mindelta )
  40. {
  41. this->verbose = verbose;
  42. };
  43. /**
  44. * Arnoldi Iteration, to get k first eigenvectors and eigenvalues
  45. * @param data matrix interface that does allow matrix-vector multiplications
  46. * @param k number of eigenvalues/eigenvectors
  47. * @param eigenvectors output Eigenvectors as Matrix
  48. * @param eigenvalues output Eigenvalues as Vector
  49. */
  50. void getEigenvalues ( const GenericMatrix & data, NICE::Vector & eigenvalues,
  51. NICE::Matrix & eigenvectors, uint k );
  52. };
  53. } // namespace
  54. #endif