Merge pull request #4847 from maxGimeno/CGAL-4.14-Fixes-maxGimeno

Fixes for 4.14
This commit is contained in:
Laurent Rineau 2020-07-21 15:21:02 +02:00
commit 2d63265d51
12 changed files with 85 additions and 18 deletions

View File

@ -164,7 +164,7 @@ public:
double maxVal = ( core_abs(val) + maxAbs / x.maxAbs) / xxx + DBL_MIN;
return filteredFp(val, maxVal, 1 + core_max(ind, x.ind + 1));
} else
return filteredFp( std::nan(""), getDoubleInfty(), 1);
return filteredFp( std::strtod("NAN", (char**)NULL), getDoubleInfty(), 1);
}
/// square root
filteredFp sqrt () const {

View File

@ -16,6 +16,10 @@ if(NOT POLICY CMP0064)
# Add a fake function to avoid CMake errors
function(cgal_add_compilation_test)
endfunction()
# Add a fake function to avoid CMake errors
function(cgal_setup_test_properties)
endfunction()
# Then return, to exit the file
return()

View File

@ -555,7 +555,7 @@ using std::max;
#endif
// Macro to specify [[no_unique_address]] if supported
#if __has_cpp_attribute(no_unique_address)
#if CGAL_CXX11 && __has_cpp_attribute(no_unique_address)
# define CGAL_NO_UNIQUE_ADDRESS [[no_unique_address]]
#else
# define CGAL_NO_UNIQUE_ADDRESS

View File

@ -88,6 +88,15 @@ public:
: p1(pp1), p2(pp2), cmp(c)
{ }
template <typename F>
struct result;
template <typename F, typename A1>
struct result<F(A1)> {
typedef typename Pairify<typename CGAL::cpp11::result_of<P1(const A1&)>::type,
typename CGAL::cpp11::result_of<P2(const A1&)>::type>::result_type type;
};
template <class A1>
typename Pairify<typename CGAL::cpp11::result_of<P1(const A1&)>::type,
typename CGAL::cpp11::result_of<P2(const A1&)>::type>::result_type
@ -113,6 +122,12 @@ public:
return Pairify<result_type_1, result_type_2>()(res1, res2);
}
template <typename F, typename A1, typename A2>
struct result<F(A1, A2)> {
typedef typename Pairify<typename CGAL::cpp11::result_of<P1(const A1&, const A2&)>::type,
typename CGAL::cpp11::result_of<P2(const A1&, const A2&)>::type>::result_type type;
};
template <class A1, class A2>
typename Pairify<typename CGAL::cpp11::result_of<P1(const A1&, const A2&)>::type,
typename CGAL::cpp11::result_of<P2(const A1&, const A2&)>::type>::result_type
@ -140,6 +155,12 @@ public:
return Pairify<result_type_1, result_type_2>()(res1, res2);
}
template <typename F, typename A1, typename A2, typename A3>
struct result<F(A1, A2, A3)> {
typedef typename Pairify<typename CGAL::cpp11::result_of<P1(const A1&, const A2&, const A3&)>::type,
typename CGAL::cpp11::result_of<P2(const A1&, const A2&, const A3&)>::type>::result_type type;
};
template <class A1, class A2, class A3>
typename Pairify<typename CGAL::cpp11::result_of<P1(
const A1&, const A2&, const A3&)>::type,
@ -171,6 +192,16 @@ public:
return Pairify<result_type_1, result_type_2>()(res1, res2);
}
template <typename F, typename A1, typename A2, typename A3, typename A4>
struct result<F(A1, A2, A3, A4)> {
typedef
typename Pairify<typename CGAL::cpp11::result_of<P1(
const A1&, const A2&, const A3&, const A4&)>::type,
typename CGAL::cpp11::result_of<P2(
const A1&, const A2&, const A3&, const A4&)>::type>::result_type
type;
};
template <class A1, class A2, class A3, class A4>
typename Pairify<typename CGAL::cpp11::result_of<P1(
const A1&, const A2&, const A3&, const A4&)>::type,
@ -207,6 +238,16 @@ public:
return Pairify<result_type_1, result_type_2>()(res1, res2);
}
template <typename F, typename A1, typename A2, typename A3, typename A4, typename A5>
struct result<F(A1, A2, A3, A4, A5)> {
typedef
typename Pairify<typename CGAL::cpp11::result_of<P1(
const A1&, const A2&, const A3&, const A4&, const A5&)>::type,
typename CGAL::cpp11::result_of<P2(
const A1&, const A2&, const A3&, const A4&, const A5&)>::type>::result_type
type;
};
template <class A1, class A2, class A3, class A4, class A5>
typename Pairify<typename CGAL::cpp11::result_of<P1(
const A1&, const A2&, const A3&, const A4&, const A5&)>::type,

View File

@ -32,22 +32,28 @@ namespace CGAL {
// It would be nicer to write the table in the other direction: Orientation_of_points_tag is good up to 6, Side_of_oriented_sphere_tag up to 5, etc.
template<class> struct Functors_without_division { typedef typeset<> type; };
template<> struct Functors_without_division<Dimension_tag<1> > {
typedef typeset<Orientation_of_points_tag, Side_of_oriented_sphere_tag> type;
typedef typeset<Orientation_of_points_tag>
::add<Side_of_oriented_sphere_tag>::type type;
};
template<> struct Functors_without_division<Dimension_tag<2> > {
typedef typeset<Orientation_of_points_tag, Side_of_oriented_sphere_tag> type;
typedef typeset<Orientation_of_points_tag>
::add<Side_of_oriented_sphere_tag>::type type;
};
template<> struct Functors_without_division<Dimension_tag<3> > {
typedef typeset<Orientation_of_points_tag, Side_of_oriented_sphere_tag> type;
typedef typeset<Orientation_of_points_tag>
::add<Side_of_oriented_sphere_tag >::type type;
};
template<> struct Functors_without_division<Dimension_tag<4> > {
typedef typeset<Orientation_of_points_tag, Side_of_oriented_sphere_tag> type;
typedef typeset<Orientation_of_points_tag>
::add<Side_of_oriented_sphere_tag>::type type;
};
template<> struct Functors_without_division<Dimension_tag<5> > {
typedef typeset<Orientation_of_points_tag, Side_of_oriented_sphere_tag> type;
typedef typeset<Orientation_of_points_tag>
::add<Side_of_oriented_sphere_tag>::type type;
};
template<> struct Functors_without_division<Dimension_tag<6> > {
typedef typeset<Orientation_of_points_tag, Side_of_oriented_sphere_tag> type;
typedef typeset<Orientation_of_points_tag>
::add<Side_of_oriented_sphere_tag>::type type;
};
// FIXME:
@ -60,8 +66,8 @@ struct Cartesian_filter_K : public Base_
CGAL_NO_UNIQUE_ADDRESS Store_kernel<AK_> sak;
CGAL_NO_UNIQUE_ADDRESS Store_kernel<EK_> sek;
constexpr Cartesian_filter_K(){}
constexpr Cartesian_filter_K(int d):Base_(d){}
CGAL_CONSTEXPR Cartesian_filter_K(){}
CGAL_CONSTEXPR Cartesian_filter_K(int d):Base_(d){}
//FIXME: or do we want an instance of AK and EK belonging to this kernel,
//instead of a reference to external ones?
CGAL_CONSTEXPR Cartesian_filter_K(AK_ const&a,EK_ const&b):Base_(),sak(a),sek(b){}

View File

@ -1,5 +1,5 @@
#include <CGAL/CORE/Expr.h>
using NT = CORE::Expr;
typedef CORE::Expr NT;
int main() {

View File

@ -122,6 +122,7 @@ template <class Circulator>
class Construct_circulator_2
{
public:
typedef Circulator result_type;
Circulator operator()(Circulator p1) const { return p1; }
};

View File

@ -49,6 +49,14 @@ public:
using Base::operator();
template<typename F>
struct result : Base::template result<F> {};
template<typename F>
struct result<F(Point_3)> {
typedef const Point_3& type;
};
const Point_3& operator()(const Point_3& p) const { return p; }
};

View File

@ -58,6 +58,14 @@ public:
using Base::operator(); // for K::Weighted_point_3 to Point_3
template<typename F>
struct result : Base::template result<F> {};
template<typename F>
struct result<F(Weighted_point_3)> {
typedef Point_3 type;
};
Point_3 operator()(const Weighted_point_3& wp) const {
return std::make_pair(operator()(wp.first), wp.second /* offset */);
}

View File

@ -799,7 +799,7 @@ public:
{
Property_map<T> pm;
bool added = false;
std::tie (pm, added) = m_base.template add<T> (name, t);
boost::tie (pm, added) = m_base.template add<T> (name, t);
return std::make_pair (pm, added);
}
@ -820,7 +820,7 @@ public:
{
Property_map<T> pm;
bool okay = false;
std::tie (pm, okay) = m_base.template get<T>(name);
boost::tie (pm, okay) = m_base.template get<T>(name);
return std::make_pair (pm, okay);
}
@ -864,7 +864,7 @@ public:
std::pair<Vector_map, bool> add_normal_map (const Vector& default_value = CGAL::NULL_VECTOR)
{
bool out = false;
std::tie (m_normals, out) = this->add_property_map<Vector> ("normal", default_value);
boost::tie (m_normals, out) = this->add_property_map<Vector> ("normal", default_value);
return std::make_pair (m_normals, out);
}
/*!

View File

@ -144,14 +144,14 @@ public:
void inc_size() {
++m_size;
#if CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE
if(m_size > (m_approximate_size * precision_of_approximate_size_plus_1))
if(m_size > (m_approximate_size * 1.10))
refresh_approximate_size();
#endif // CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE
}
void dec_size() {
--m_size;
#if CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE
if((m_size * precision_of_approximate_size_plus_1) < m_approximate_size)
if((m_size * 1.10) < m_approximate_size)
refresh_approximate_size();
#endif // CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE
}
@ -192,7 +192,6 @@ protected:
#if CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE
// `m_size` plus or minus `precision_of_approximate_size - 1`
static constexpr double precision_of_approximate_size_plus_1 = 1.10;
size_type m_approximate_size;
std::atomic<size_type> m_atomic_approximate_size;
void refresh_approximate_size() {

View File

@ -555,7 +555,7 @@ protected:
public:
template<typename P> // Point or Point_3
typename boost::result_of<const Construct_point_3(const P&)>::type
typename boost::result_of<Construct_point_3(P)>::type
construct_point(const P& p) const
{
return geom_traits().construct_point_3_object()(p);