
The modifications you suggested led to a set of questions.
b- Use the boost::math::constants instead of the gcc extensions.
I implemented this but it seems to add limitations on the types usable. They now require to have an overloaded istream extraction operator and a specialization of std::numeric_limits. Those two limitations are reasonable but I am not certain that we want to impose such conditions on the template types.
In my opinion, the requirement on numeric_limits<T> is fair. After all, it's easier on potential users to mandate limits rather than to require complicated implementations of the constants. Perhaps this is an issue for potential review. Are you sure about that requirement for istream extraction? I don't believe that is due to boost::math::constants, but rather originates from your own istream extraction code (but only if one choooses to use it). I have, for example, successfully used your code with my fixed-point type that does not have istream extraction. I simply extracted the results to std::cout manually. I have included my new test code in another message.
c- Use the template parameters in the function calls.
Christopher Kormanyos, could you indicate which compiler you are using ? I could not reproduce the bug you mentioned. <snip> template<typename T> inline complex<T> exp(const complex<T>& x) { return polar<T>(exp(x.real()), x.imag()); }
I use Microsoft Visual Studio 2010, SP1. Matthieu, I only get the error when using the proposed boost::multiprecision::cpp_dec_float type. I am beginning to understand this, but perhaps not fully. The reason for this seems not to be the type being used but rather that there also exists boost::math::polar<T>(const T&, const T&). And since your polar() function is also contained within the namespace boost::math, the compiler can not resolve which one to use when I include all those headers. You probably can not reproduce the error because you are not including <boost/math/complex/complex.hpp>. I suppose that's whay you do not get the potentially ambiguous function error. The error is this: 1> complex.cpp 1>C:\boost_1_49\boost/math/complex/complex.hpp(1271): error C2782: 'boost::math::complex<T> boost::math::polar(const T &,const T &)' : template parameter 'T' is ambiguous 1> C:\boost_1_49\boost/math/complex/complex.hpp(1035) : see declaration of 'boost::math::polar' 1> could be 'boost::multiprecision::cpp_dec_float_50' 1> or 'boost::multiprecision::detail::mp_exp<tag,Arg1,Arg2,Arg3>' 1> with 1> [ 1> tag=boost::multiprecision::detail::function, 1> Arg1=boost::multiprecision::detail::exp_funct<boost::multiprecision::backends::cpp_dec_float<50>>, 1> Arg2=boost::multiprecision::mp_number<boost::multiprecision::backends::cpp_dec_float<50>>, 1> Arg3=void 1> ] 1> complex.cpp(269) : see reference to function template instantiation 'boost::math::complex<T> boost::math::exp<boost::multiprecision::cpp_dec_float_50>(const boost::math::complex<T> &)' being compiled 1> with 1> [ 1> T=boost::multiprecision::cpp_dec_float_50 1> ]
I remain at your (and boost's) service to potentially moderate the review, if needed.
I don't know if it is up to me to decide but I am definitely interested. Regards, Matthieu
It's not really up to me either. I believe I can do it and we really need to make progress on this project. It would be my first boost review as well. Will someone who knows tell us how to proceed? Thanks for your efforts, Matthieu. I'm looking forward to potential progress with this project. Best regards, Chris.