File: Filtered_kernel_d.h

package info (click to toggle)
cgal 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,912 kB
  • sloc: cpp: 810,858; ansic: 208,477; sh: 493; python: 411; makefile: 286; javascript: 174
file content (63 lines) | stat: -rw-r--r-- 2,315 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL: https://github.com/CGAL/cgal/blob/v6.1/Kernel_d/include/CGAL/Filtered_kernel_d.h $
// $Id: include/CGAL/Filtered_kernel_d.h b26b07a1242 $
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s)    : Samuel Hornus, Olivier Devillers

#ifndef CGAL_FILTERED_KERNEL_D_H
#define CGAL_FILTERED_KERNEL_D_H

#include <CGAL/Filtered_predicate.h>
#include <CGAL/Number_types/internal/Exact_type_selector.h>
#include <CGAL/Kernel_d/Cartesian_converter_d.h>
#include <CGAL/Cartesian_d.h>

namespace CGAL {

template<typename Kernel> // a dD kernel we want to filter
struct Filtered_kernel_d : public Cartesian_d<typename Kernel::FT>
{
    typedef typename Kernel::LA                        LA;
    typedef typename Kernel::RT                        RT; // Ring type
    typedef typename Kernel::FT                        FT; // Field type

    typedef Cartesian_d<FT>                        Base;
    typedef Filtered_kernel_d<Kernel>                Self;

    // an exact number type
    typedef typename internal::Exact_type_selector<RT>::Type        Exact_nt;

    // the corresponding exact kernel
    //typedef Linear_algebraCd< Exact_nt, boost::pool_allocator<Exact_nt> > Exact_linalg;
    typedef Linear_algebraCd< Exact_nt > Exact_linalg;
    typedef Cartesian_d<Exact_nt, Exact_linalg>                Exact_kernel;

    // the kernel used for filtered predicates
    typedef Interval_nt<false> IA;
    //typedef Linear_algebraCd<IA, boost::pool_allocator<IA> > Interval_linalg;
    typedef Linear_algebraCd<IA> Interval_linalg;
    typedef Cartesian_d<IA, Interval_linalg >        Approximate_kernel;

    // the converter
    typedef Cartesian_converter_d<Base, Exact_kernel>        C2E;
    typedef Cartesian_converter_d<Base, Approximate_kernel>        C2F;

    // we change the predicates.
#define CGAL_Kernel_pred(P, Pf) \
    typedef Filtered_predicate<typename Exact_kernel::P, typename Approximate_kernel::P, C2E, C2F> P; \
    P Pf() const { return P(); }

    // we don't touch the constructions.
#define CGAL_Kernel_cons(Y,Z)

#include <CGAL/Kernel_d/interface_macros_d.h>
};

} //namespace CGAL

#endif // CGAL_FILTERED_KERNEL_D_H