Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Kernel traits to distinguish kernel capability?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Kernel traits to distinguish kernel capability?


Chronological Thread 
  • From: ax487 <>
  • To:
  • Subject: Re: [cgal-discuss] Kernel traits to distinguish kernel capability?
  • Date: Tue, 03 Sep 2013 22:16:52 +0200

On 03.09.2013 17:48, Sebastien Loriot (GeometryFactory) wrote:
> You can check whether Kernel::FT is a floating point.
>
> http://www.boost.org/doc/libs/1_54_0/libs/type_traits/doc/html/boost_typetraits/reference/is_floating_point.html
>
>
> Sebastien.
>
> On 09/03/2013 04:26 PM, ax487 wrote:
>> Hello all,
>>
>> I am currently trying to make my algorithms work with different types of
>> kernels: Up to now I have only been working using a kernel providing
>> exact construction, now I am trying to write a correct implementation of
>> my algorithm on a kernel that only provides exact predicates and uses
>> floating point based construction. Clearly this requires some additional
>> work. I would like to avoid that additional work on kernels providing
>> exact construction. To this end I need a method to tell if a given
>> kernel provides exact construction. I am currently working using
>> #ifdef's, but instead I would like use templates in my classes and
>> functions. What I need is something like a static function
>> `Kernel::provides_exact_construction()' which I could call in a method
>> like `template<class Kernel> void calculate(...)'. I did not find
>> anything like that in the documentation so far, is there a method to
>> obtain the information from CGAL?
>>
>> ax487
>>
>
>

Well, I just added the following:

template <class Kernel>
struct provides_exact_constructions
{
public:
static const bool value = !(std::is_floating_point<typename
Kernel::RT>::value);
};

But shouldn't there be a more systematic approach? What if I need to
know whether or not the kernel provides exact predicates (which the
Cartesian<double> kernel for example does not)?



Archive powered by MHonArc 2.6.18.

Top of Page