20 #ifndef IMG_PHYSICS_UNITS_HH
21 #define IMG_PHYSICS_UNITS_HH
23 #include <boost/mpl/vector_c.hpp>
24 #include<boost/mpl/placeholders.hpp>
25 #include <boost/mpl/plus.hpp>
26 #include <boost/mpl/transform.hpp>
29 namespace ost {
namespace img {
namespace physics{
33 namespace mpl = boost::mpl;
49 template <
class Dimensions>
69 template <
class D1,
class D2>
70 struct multiply_dimensions: mpl::transform<D1,D2,mpl::plus<mpl::placeholders::_1,mpl::placeholders::_2> >
73 template <
class D1,
class D2>
76 template <
class D1,
class D2>
77 struct divide_dimensions: mpl::transform<D1,D2,mpl::minus<mpl::placeholders::_1,mpl::placeholders::_2> >
80 template <
class D1,
class D2>
quantity(const quantity< D2 > &rhs)
mpl::vector_c< int, 0, 1,-2, 0, 0, 0, 0 > acceleration_dimension
mpl::vector_c< int, 1, 1,-2, 0, 0, 0, 0 > force_dimension
mpl::vector_c< int, 0, 0, 0, 0, 0, 0, 1 > amount_dimension
mpl::vector_c< int, 0, 0, 0, 0, 0, 0, 0 > scalar_dimension
quantity< D > operator-(quantity< D > x, quantity< D > y)
quantity< D > operator+(quantity< D > x, quantity< D > y)
mpl::vector_c< int, 1, 1,-1, 0, 0, 0, 0 > momentum_dimension
mpl::vector_c< int, 0, 1,-1, 0, 0, 0, 0 > velocity_dimension
quantity< typename multiply_dimensions< D1, D2 >::type > operator*(quantity< D1 > x, quantity< D2 > y)
mpl::vector_c< int, 0, 0, 1, 0, 0, 0, 0 > time_dimension
quantity< typename divide_dimensions< D1, D2 >::type > operator/(quantity< D1 > x, quantity< D2 > y)
mpl::vector_c< int, 0, 0, 0, 0, 0, 1, 0 > intensity_dimension
mpl::vector_c< int, 0, 0, 0, 1, 0, 0, 0 > charge_dimension
mpl::vector_c< int, 0, 1, 0, 0, 0, 0, 0 > length_dimension
mpl::vector_c< int, 0, 0, 0, 0, 1, 0, 0 > temperature_dimension
mpl::vector_c< int, 1, 0, 0, 0, 0, 0, 0 > mass_dimension
detail::quantity< detail::intensity_dimension > Intensity
detail::quantity< detail::time_dimension > Time
detail::quantity< detail::length_dimension > Length
detail::quantity< detail::temperature_dimension > Temperature
detail::quantity< detail::force_dimension > Force
detail::quantity< detail::charge_dimension > Charge
detail::quantity< detail::mass_dimension > Mass
detail::quantity< detail::velocity_dimension > Velocity
detail::quantity< detail::amount_dimension > Amount
detail::quantity< detail::momentum_dimension > Momentum