UncontrolledObject.cpp 842 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /** \file itasc/UncontrolledObject.cpp
  2. * \ingroup itasc
  3. */
  4. /*
  5. * UncontrolledObject.cpp
  6. *
  7. * Created on: Jan 5, 2009
  8. * Author: rubensmits
  9. */
  10. #include "UncontrolledObject.hpp"
  11. namespace iTaSC{
  12. UncontrolledObject::UncontrolledObject():Object(UnControlled),
  13. m_nu(0), m_nf(0), m_xudot()
  14. {
  15. }
  16. UncontrolledObject::~UncontrolledObject()
  17. {
  18. }
  19. void UncontrolledObject::initialize(unsigned int _nu, unsigned int _nf)
  20. {
  21. assert (_nf >= 1);
  22. m_nu = _nu;
  23. m_nf = _nf;
  24. if (_nu > 0)
  25. m_xudot = e_zero_vector(_nu);
  26. // clear all Jacobian if any
  27. m_JuArray.clear();
  28. // reserve one more to have an zero matrix handy
  29. if (m_nu > 0)
  30. m_JuArray.resize(m_nf+1, e_zero_matrix(6,m_nu));
  31. }
  32. const e_matrix& UncontrolledObject::getJu(unsigned int frameIndex) const
  33. {
  34. assert (m_nu > 0);
  35. return m_JuArray[(frameIndex>m_nf)?m_nf:frameIndex];
  36. }
  37. }