WDLSSolver.hpp 953 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * WDLSSolver.hpp
  3. *
  4. * Created on: Jan 8, 2009
  5. * Author: rubensmits
  6. */
  7. #ifndef WDLSSOLVER_HPP_
  8. #define WDLSSOLVER_HPP_
  9. #include "Solver.hpp"
  10. namespace iTaSC {
  11. class WDLSSolver: public iTaSC::Solver {
  12. private:
  13. e_matrix m_AWq,m_WyAWq,m_WyAWqt,m_U,m_V,m_WqV;
  14. e_vector m_S,m_temp,m_Wy_ydot;
  15. double m_lambda;
  16. double m_epsilon;
  17. double m_qmax;
  18. int m_ns;
  19. bool m_transpose;
  20. public:
  21. WDLSSolver();
  22. virtual ~WDLSSolver();
  23. virtual bool init(unsigned int nq, unsigned int nc, const std::vector<bool>& gc);
  24. virtual bool solve(const e_matrix& A, const e_vector& Wy, const e_vector& ydot, const e_matrix& Wq, e_vector& qdot, e_scalar& nlcoef);
  25. virtual void setParam(SolverParam param, double value)
  26. {
  27. switch (param) {
  28. case DLS_QMAX:
  29. m_qmax = value;
  30. break;
  31. case DLS_LAMBDA_MAX:
  32. m_lambda = value;
  33. break;
  34. case DLS_EPSILON:
  35. m_epsilon = value;
  36. break;
  37. }
  38. }
  39. };
  40. }
  41. #endif /* WDLSSOLVER_HPP_ */