[metamath] Error and question about function calls

Hi, I was trying to test the trigonometric functions and add an exp function in the metamath library. I am not sure how to call them. Also line 58 of string_to_double.hpp needs to be changed to the following to compile in gcc: typedef typename pow_impl<unsigned_exponent>::template apply<T>::type positive_pow; Thanks, Chris

On 9/11/05, Chris Weed <chrisweed@gmail.com> wrote:
Hi, I was trying to test the trigonometric functions and add an exp function in the metamath library. I am not sure how to call them.
I have modified the sine_impl implementation in CVS, so now you can use: typedef sine_double<number> type; double result=type(); In metamath/double/sine.hpp I added: template<typename Angle> struct sine_double : detail::times_double_double<Angle,typename detail::sine_series<Angle,mpl::int_<0>,mpl::int_<13> >::type > { };
Also line 58 of string_to_double.hpp needs to be changed to the following to compile in gcc:
typedef typename pow_impl<unsigned_exponent>::template apply<T>::type positive_pow;
Great! changes applied to cvs. Regards, Peder
Thanks, Chris
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

On 9/12/05, Peder Holt <peder.holt@gmail.com> wrote:
On 9/11/05, Chris Weed <chrisweed@gmail.com> wrote:
Hi, I was trying to test the trigonometric functions and add an exp function in the metamath library. I am not sure how to call them.
I have modified the sine_impl implementation in CVS, so now you can use: typedef sine_double<number> type; double result=type();
In metamath/double/sine.hpp I added: template<typename Angle> struct sine_double : detail::times_double_double<Angle,typename detail::sine_series<Angle,mpl::int_<0>,mpl::int_<13> >::type > { };
Also line 58 of string_to_double.hpp needs to be changed to the following to compile in gcc:
typedef typename pow_impl<unsigned_exponent>::template apply<T>::type positive_pow;
Great! changes applied to cvs.
Regards, Peder
Hi, I have attached updated versions of sine.hpp, limits.hpp, times.hpp, I changed to get a sine example to compile in g++. Additionally, I have created a file for exp (exp.hpp). It might be better to have the integer version of exp just calculate something like pow(e,Arg) where e is a constant. Also, I am not sure how to test the *_impl<> versions of these functions. Chris

On 9/13/05, Chris Weed <chrisweed@gmail.com> wrote:
On 9/12/05, Peder Holt <peder.holt@gmail.com> wrote:
On 9/11/05, Chris Weed <chrisweed@gmail.com> wrote:
Hi, I was trying to test the trigonometric functions and add an exp function in the metamath library. I am not sure how to call them.
I have modified the sine_impl implementation in CVS, so now you can use: typedef sine_double<number> type; double result=type();
In metamath/double/sine.hpp I added: template<typename Angle> struct sine_double : detail::times_double_double<Angle,typename detail::sine_series<Angle,mpl::int_<0>,mpl::int_<13> >::type > { };
Also line 58 of string_to_double.hpp needs to be changed to the following to compile in gcc:
typedef typename pow_impl<unsigned_exponent>::template apply<T>::type positive_pow;
Great! changes applied to cvs.
Regards, Peder
Hi, I have attached updated versions of sine.hpp, limits.hpp, times.hpp, I changed to get a sine example to compile in g++. Additionally, I have created a file for exp (exp.hpp).
Great! I have added the exponential function to cvs (named it exponent for now, but should probably be renamed to exponential) I got a mismatch when comparing exp(pi) with the runtime equivalent: Compile time: 23.140692466808215 Runtime: 23.140692632779267 This might be because I included too few iterations (18) but needs investigation
It might be better to have the integer version of exp just calculate something like pow(e,Arg) where e is a constant.
Done.
Also, I am not sure how to test the *_impl<> versions of these functions.
Added boost/metamath/sine.hpp boost/metamath/exponent.hpp and boost/metamath/power.hpp that opens up for using the *_impl<> versions. Regards, Peder
Chris
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Chris Weed
-
Peder Holt