boost_units_helpers.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. [auto_generated]
  3. libs/numeric/odeint/test/dummy_boost_units.hpp
  4. [begin_description]
  5. tba.
  6. [end_description]
  7. Copyright 2012 Karsten Ahnert
  8. Copyright 2012 Mario Mulansky
  9. Distributed under the Boost Software License, Version 1.0.
  10. (See accompanying file LICENSE_1_0.txt or
  11. copy at http://www.boost.org/LICENSE_1_0.txt)
  12. */
  13. #ifndef LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
  14. #define LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED
  15. #include <boost/units/systems/si/length.hpp>
  16. #include <boost/units/systems/si/time.hpp>
  17. #include <boost/units/systems/si/velocity.hpp>
  18. #include <boost/units/systems/si/acceleration.hpp>
  19. #include <boost/units/systems/si/io.hpp>
  20. #include <boost/fusion/container.hpp>
  21. typedef double value_type;
  22. typedef boost::units::quantity< boost::units::si::time , value_type > time_type;
  23. typedef boost::units::quantity< boost::units::si::length , value_type > length_type;
  24. typedef boost::units::quantity< boost::units::si::velocity , value_type > velocity_type;
  25. typedef boost::units::quantity< boost::units::si::acceleration , value_type > acceleration_type;
  26. struct oscillator_mom_func_units
  27. {
  28. template< class Coor , class MomDeriv >
  29. void operator()( const Coor &q , MomDeriv &dp ) const
  30. {
  31. const boost::units::quantity< boost::units::si::frequency , value_type > omega = 1.0 * boost::units::si::hertz;
  32. boost::fusion::at_c< 0 >( dp ) = - omega * omega * boost::fusion::at_c< 0 >( q );
  33. }
  34. };
  35. struct oscillator_coor_func_units
  36. {
  37. template< class Mom , class CoorDeriv >
  38. void operator()( const Mom &p , CoorDeriv &dq ) const
  39. {
  40. boost::fusion::at_c< 0 >( dq ) = boost::fusion::at_c< 0 >( p );
  41. }
  42. };
  43. #endif // LIBS_NUMERIC_ODEINT_TEST_DUMMY_BOOST_UNITS_HPP_DEFINED