[Couenne] Compile error with Visual C++
Pietro Belotti
petr.7b6 at gmail.com
Thu Jan 22 19:14:22 EST 2015
Thanks for pointing that out. Other parts of Couenne have a sqrt() of
an integer that work by using a simple C cast, i.e. sqrt ((double) n).
I'll do the same with this. Since releases are usually not touched,
I'll create 0.5.1, it should be ready shortly.
Pietro
On Fri, Jan 23, 2015 at 12:05 AM, victor.zverovich at gmail.com
<victor.zverovich at gmail.com> wrote:
> Couenne 0.5.0 fails to compile with Visual C++ 2010 giving the following
> error:
>
> Couenne\src\heuristics\CouenneFPcreateMILP.cpp(283): error C2668: 'sqrt' :
> ambiguous call to overloaded function [...]
> C:\Program Files (x86)\Microsoft Visual Studio
> 10.0\VC\include\math.h(589): could be 'long double sqrt(long double)'
> C:\Program Files (x86)\Microsoft Visual Studio
> 10.0\VC\include\math.h(541): or 'float sqrt(float)'
> C:\Program Files (x86)\Microsoft Visual Studio
> 10.0\VC\include\math.h(127): or 'double sqrt(double)'
> while trying to match the argument list '(int)'
>
> A trivial fix is to cast the argument to double:
>
> A [i * (n+1)] += fp -> multDistMILP () / sqrt
> (static_cast<double>(n));
>
> Best regards,
> Victor
>
>
>
> _______________________________________________
> Couenne mailing list
> Couenne at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/couenne
More information about the Couenne
mailing list