#ifndef TEST_MATH_FUNCTIONS_HPP #define TEST_MATH_FUNCTIONS_HPP #include #include #include #include namespace mathtest { using namespace boost; // to represent general functions of dimensions up to TEST_MATH_MAX_DIMENSION template struct function_tag { typedef dim dimension; }; typedef proto::terminal< function_tag< mpl::size_t<0> > > function_constant_proto_terminal; typedef function_constant_proto_terminal::type function_constant; // constant functions typedef proto::terminal< function_tag< mpl::size_t<1> > >::type function; // 1-variable functions #define BOOST_PP_LOCAL_LIMITS (0, TEST_MATH_MAX_DIMENSION) #define BOOST_PP_LOCAL_MACRO(n)\ BOOST_PP_CAT(\ BOOST_PP_CAT(\ BOOST_PP_CAT(\ typedef proto::terminal< function_tag< mpl::size_t<\ BOOST_PP_CAT(n,> > >::type function)\ ), n ), ;) ??=include BOOST_PP_LOCAL_ITERATE() // Numerical metafunction that returns the dimensionality of a mathtest::function_tag template struct dimension_of { typedef typename FunTag::dimension type; const static size_t value = type::value; }; } #endif // TEST_MATH_FUNCTIONS_HPP