CholeskyRobust.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /**
  2. * @file CholeskyRobust.h
  3. * @author Erik Rodner
  4. * @date 01/06/2010
  5. */
  6. #ifndef _NICE_OBJREC_CHOLESKYROBUSTINCLUDE
  7. #define _NICE_OBJREC_CHOLESKYROBUSTINCLUDE
  8. #include <limits>
  9. #include "core/vector/MatrixT.h"
  10. namespace OBJREC {
  11. /** @class CholeskyRobust
  12. * robust cholesky decomposition by adding some noise
  13. *
  14. * @author Erik Rodner
  15. */
  16. class CholeskyRobust
  17. {
  18. protected:
  19. const bool m_verbose;
  20. const double m_noiseStep;
  21. const double m_minMatrixLogDeterminant;
  22. const bool m_useCuda;
  23. double m_logDetMatrix;
  24. public:
  25. CholeskyRobust ( bool verbose = true, double noiseStep = 1e-8, double minMatrixLogDeterminant = - std::numeric_limits<double>::max(), bool useCuda = true );
  26. CholeskyRobust ( const CholeskyRobust & src );
  27. virtual ~CholeskyRobust ();
  28. virtual double robustChol ( const NICE::Matrix & A, NICE::Matrix & cholA );
  29. virtual double robustCholInv ( const NICE::Matrix & A, NICE::Matrix & invA );
  30. double getLastLogDet () const { return m_logDetMatrix; };
  31. virtual CholeskyRobust *clone(void) const;
  32. };
  33. }
  34. #endif