mirror of https://github.com/CGAL/cgal
- Fix protect macro
- Extend operators till 10 arguments.
This commit is contained in:
parent
edc635d52f
commit
08ea450d0d
|
|
@ -21,8 +21,8 @@
|
||||||
//
|
//
|
||||||
// Author(s) : Sylvain Pion
|
// Author(s) : Sylvain Pion
|
||||||
|
|
||||||
#ifndef CGAL_FILTER_PREDICATE_H
|
#ifndef CGAL_FILTERED_PREDICATE_H
|
||||||
#define CGAL_FILTER_PREDICATE_H
|
#define CGAL_FILTERED_PREDICATE_H
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
#include <CGAL/basic.h>
|
||||||
#include <CGAL/Interval_nt.h>
|
#include <CGAL/Interval_nt.h>
|
||||||
|
|
@ -244,7 +244,87 @@ public:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Idem for more than 7 arguments. Do it on demand.
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7, class A8>
|
||||||
|
result_type
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const
|
||||||
|
#ifndef CGAL_CFG_OUTOFLINE_TEMPLATE_MEMBER_DEFINITION_BUG
|
||||||
|
;
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(__PRETTY_FUNCTION__));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4),
|
||||||
|
c2a(a5), c2a(a6), c2a(a7), c2a(a8) );
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(__PRETTY_FUNCTION__));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4),
|
||||||
|
c2e(a5), c2e(a6), c2e(a7), c2e(a8) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7, class A8, class A9>
|
||||||
|
result_type
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8,
|
||||||
|
const A9 &a9) const
|
||||||
|
#ifndef CGAL_CFG_OUTOFLINE_TEMPLATE_MEMBER_DEFINITION_BUG
|
||||||
|
;
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(__PRETTY_FUNCTION__));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4),
|
||||||
|
c2a(a5), c2a(a6), c2a(a7), c2a(a8), c2a(a9) );
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(__PRETTY_FUNCTION__));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4),
|
||||||
|
c2e(a5), c2e(a6), c2e(a7), c2e(a8), c2e(a9) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7, class A8, class A9, class A10>
|
||||||
|
result_type
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8,
|
||||||
|
const A9 &a9, const A10 &a10) const
|
||||||
|
#ifndef CGAL_CFG_OUTOFLINE_TEMPLATE_MEMBER_DEFINITION_BUG
|
||||||
|
;
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(__PRETTY_FUNCTION__));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4),
|
||||||
|
c2a(a5), c2a(a6), c2a(a7), c2a(a8), c2a(a9), c2a(a10) );
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(__PRETTY_FUNCTION__));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4),
|
||||||
|
c2e(a5), c2e(a6), c2e(a7), c2e(a8), c2e(a9), c2e(a10) );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Idem for more than 10 arguments. Do it on demand.
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef CGAL_CFG_OUTOFLINE_TEMPLATE_MEMBER_DEFINITION_BUG
|
#ifndef CGAL_CFG_OUTOFLINE_TEMPLATE_MEMBER_DEFINITION_BUG
|
||||||
|
|
@ -369,8 +449,106 @@ Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6));
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class EP, class AP, class C2E, class C2A, bool Protection>
|
||||||
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7>
|
||||||
|
typename Filtered_predicate<EP,AP,C2E,C2A,Protection>::result_type
|
||||||
|
Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7) const
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6),
|
||||||
|
c2a(a7));
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class EP, class AP, class C2E, class C2A, bool Protection>
|
||||||
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7, class A8>
|
||||||
|
typename Filtered_predicate<EP,AP,C2E,C2A,Protection>::result_type
|
||||||
|
Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8) const
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6),
|
||||||
|
c2a(a7), c2a(a8));
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7),
|
||||||
|
c2e(a8));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class EP, class AP, class C2E, class C2A, bool Protection>
|
||||||
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7, class A8, class A9>
|
||||||
|
typename Filtered_predicate<EP,AP,C2E,C2A,Protection>::result_type
|
||||||
|
Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8,
|
||||||
|
const A9 &a9) const
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6),
|
||||||
|
c2a(a7), c2a(a8), c2a(a9));
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7),
|
||||||
|
c2e(a8), c2e(a9));
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class EP, class AP, class C2E, class C2A, bool Protection>
|
||||||
|
template <class A1, class A2, class A3, class A4, class A5, class A6,
|
||||||
|
class A7, class A8, class A9, class A10>
|
||||||
|
typename Filtered_predicate<EP,AP,C2E,C2A,Protection>::result_type
|
||||||
|
Filtered_predicate<EP,AP,C2E,C2A,Protection>::
|
||||||
|
operator()(const A1 &a1, const A2 &a2, const A3 &a3, const A4 &a4,
|
||||||
|
const A5 &a5, const A6 &a6, const A7 &a7, const A8 &a8,
|
||||||
|
const A9 &a9, const A10 &a10) const
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CGAL_PROFILER(std::string("calls to : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<Protection> P;
|
||||||
|
Ares res = ap(c2a(a1), c2a(a2), c2a(a3), c2a(a4), c2a(a5), c2a(a6),
|
||||||
|
c2a(a7), c2a(a8), c2a(a9), c2a(a10));
|
||||||
|
if (! is_indeterminate(res))
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
catch (Interval_nt_advanced::unsafe_comparison) {}
|
||||||
|
CGAL_PROFILER(std::string("failures of : ") + std::string(CGAL_PRETTY_FUNCTION));
|
||||||
|
Protect_FPU_rounding<!Protection> P(CGAL_FE_TONEAREST);
|
||||||
|
return ep(c2e(a1), c2e(a2), c2e(a3), c2e(a4), c2e(a5), c2e(a6), c2e(a7),
|
||||||
|
c2e(a8), c2e(a9), c2e(a10));
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CGAL_END_NAMESPACE
|
CGAL_END_NAMESPACE
|
||||||
|
|
||||||
#endif // CGAL_FILTER_PREDICATE_H
|
#endif // CGAL_FILTERED_PREDICATE_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue