EigValuesTRLAN.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef EIGVALUESTRLANINCLUDE
  2. #define EIGVALUESTRLANINCLUDE
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <math.h>
  6. #include <vector>
  7. #include <string.h>
  8. #include "EigValues.h"
  9. namespace NICE {
  10. /** real symmetric eigenproblem, the eigenpairs returned by the method solve are ordered increasingly
  11. * (needs the TRLAN library, is not thread-safe!)
  12. */
  13. class EigValuesTRLAN : public EigValues {
  14. private:
  15. int magnitude;
  16. int restarting_scheme;
  17. double tolerance;
  18. int max_mult;
  19. int mult_flops;
  20. bool verbose;
  21. public:
  22. /**
  23. * @brief Init the TRLAN lanczos routine with the following parameters
  24. *
  25. * @param magnitude Specifies the nature of the EigValuesTRLAN, find eigenpair with respect to the k largest (magnitude>0)
  26. * @param restarting_scheme restarting scheme of TRLAN
  27. * @param tolerance stop criterion (abs. resudual |A*x-lambda*x|?)
  28. * @param max_mult maximum number of matrix-vector multiplications to perform
  29. * @param mult_flops number of flops per matrix multiplication (used for statistics calculation)
  30. */
  31. EigValuesTRLAN ( int magnitude = 1,
  32. int restarting_scheme = 1,
  33. double tolerance = 1e-8,
  34. int max_mult = -1,
  35. int mult_flops = -1 );
  36. /** destructor */
  37. ~EigValuesTRLAN() {};
  38. /**
  39. * @param data matrix interface that does allow matrix-vector multiplications
  40. * @param k number of eigenvalues/eigenvectors
  41. * @param eigenvectors output Eigenvectors as Matrix
  42. * @param eigenvalues output Eigenvalues as Vector
  43. */
  44. virtual void getEigenvalues ( const GenericMatrix &data, NICE::Vector & eigenvalues, NICE::Matrix & eigenvectors, uint k );
  45. };
  46. } // namespace
  47. #endif