I'm attempting to following the http://www.boost.org/doc/libs/1_53_0_beta1/libs/polygon/doc/voronoi_advanced...
to compile boost::polygon::voronoi using 64 bit integer input. I'm using the boost::multiprecision library to do so.
Using boost version 1.53 and Microsoft Visual Studio 2012.
The error message is:
1>d:\workspace\movingboundary\boost_1_53_0\boost\polygon\detail\voronoi_robust_fpt.hpp(60): error C2665: 'sqrt' : none of the 3 overloads could convert all the argument types
1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\math.h(588): could be 'long double sqrt(long double)'
1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\math.h(540): or 'float sqrt(float)'
1> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\math.h(127): or 'double sqrt(double)'
1> while trying to match the argument list '(const boost::multiprecision::detail::expression)'
1> with
1> [
1> tag=boost::multiprecision::detail::multiplies,
1> Arg1=boost::multiprecision::detail::expression>,boost::multiprecision::number>,void,void>,boost::multiprecision::detail::expression>,boost::multiprecision::number>,void,void>,void,void>,boost::multiprecision::detail::expression>,boost::multiprecision::number>,void,void>,boost::multiprecision::detail::expression>,boost::multiprecision::number>,void,void>,void,void>,void,void>,
1> Arg2=boost::multiprecision::detail::expression>,boost::multiprecision::number>,void,void>,boost::multiprecision::detail::expression>,boost::multiprecision::number>,void,void>,void,void>,
1> Arg3=void,
1> Arg4=void
== reference line is
template <typename T>
T get_sqrt(const T& that) {
return (std::sqrt)(that); //<-- line 60
}
== code ==
#pragma warning (disable: 4996 4267)
#include <cmath>
#include
#include
#include
#include <limits>
#include
#include <iostream>
using namespace boost::polygon;
namespace vcellVoronoiImpl {
typedef boost::multiprecision::number> floatingType;
struct FloatingConverter {
template <typename T>
floatingType operator( )(T x) const {
return static_cast<floatingType>(x);
}
};
struct compareFloatingType {
enum Result {
LESS = -1,
EQUAL = 0,
MORE = 1
};
Result operator()(floatingType a, floatingType b, unsigned int maxUlps) const {
if (a > b) {
return a - b <= maxUlps ? EQUAL : LESS;
}
return b - a <= maxUlps ? EQUAL : MORE;
}
};
struct voronoi_ctype_traits {
typedef boost::int64_t int_type;
typedef boost::multiprecision::int128_t int_x2_type;
typedef boost::multiprecision::uint128_t uint_x2_type;
typedef boost::multiprecision::int512_t big_int_type;
typedef floatingType fpt_type;
typedef floatingType efpt_type;
typedef compareFloatingType ulp_cmp_type;
typedef FloatingConverter to_fpt_converter_type;
typedef FloatingConverter to_efpt_converter_type;
};
struct vcell_vd_traits{
typedef voronoi_ctype_traits::fpt_type coordinate_type;
typedef voronoi_cell cell_type;
typedef voronoi_vertex vertex_type;
typedef voronoi_edge edge_type;
typedef struct {
public:
enum { ULPS = 128 };
bool operator()(const vertex_type &v1, const vertex_type &v2) const {
return (ulp_cmp(v1.x(), v2.x(), ULPS) == compareFloatingType::EQUAL &&
ulp_cmp(v1.y(), v2.y(), ULPS) == compareFloatingType::EQUAL);
}
private:
compareFloatingType ulp_cmp;
} vertex_equality_predicate_type;
};
}
using namespace vcellVoronoiImpl;
TEST(highv,build) {
voronoi_builder vb;
voronoi_diagramboost::int64_t,vcell_vd_traits vd;
vb.construct(&vd);
}
Gerard Weatherby
Appllication Architect
Virtual Cell, Center for Cell Analysis and Modeling (CCAM)
University of Connecticut Health Center
860-679-2065