Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:16

0001 #ifndef DROP_CGAL // in case we do not have the code for CGAL
0002 #ifndef __FASTJET_TRIANGULATION__
0003 #define __FASTJET_TRIANGULATION__
0004 
0005 //FJSTARTHEADER
0006 // $Id$
0007 //
0008 // Copyright (c) 2005-2021, Matteo Cacciari, Gavin P. Salam and Gregory Soyez
0009 //
0010 //----------------------------------------------------------------------
0011 // This file is part of FastJet.
0012 //
0013 //  FastJet is free software; you can redistribute it and/or modify
0014 //  it under the terms of the GNU General Public License as published by
0015 //  the Free Software Foundation; either version 2 of the License, or
0016 //  (at your option) any later version.
0017 //
0018 //  The algorithms that underlie FastJet have required considerable
0019 //  development. They are described in the original FastJet paper,
0020 //  hep-ph/0512210 and in the manual, arXiv:1111.6097. If you use
0021 //  FastJet as part of work towards a scientific publication, please
0022 //  quote the version you use and include a citation to the manual and
0023 //  optionally also to hep-ph/0512210.
0024 //
0025 //  FastJet is distributed in the hope that it will be useful,
0026 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
0027 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0028 //  GNU General Public License for more details.
0029 //
0030 //  You should have received a copy of the GNU General Public License
0031 //  along with FastJet. If not, see <http://www.gnu.org/licenses/>.
0032 //----------------------------------------------------------------------
0033 //FJENDHEADER
0034 
0035 
0036 // file: examples/Triangulation_2/Voronoi.C
0037 #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
0038 #include <CGAL/Delaunay_triangulation_2.h>
0039 #include <CGAL/Triangulation_hierarchy_2.h>
0040 #include <CGAL/Triangulation_vertex_base_with_info_2.h>
0041 #include "fastjet/internal/base.hh"
0042 
0043 FASTJET_BEGIN_NAMESPACE      // defined in fastjet/internal/base.hh
0044 
0045 /// \if internal_doc
0046 /// @ingroup internal
0047 /// \struct K
0048 /// the basic geometrical kernel that lies at the base of all CGAL
0049 /// operations
0050 /// \endif
0051 #ifdef CGAL_SIMPLE_KERNEL
0052 struct K : CGAL::Simple_cartesian<double> {};
0053 #else
0054 struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
0055 #endif // CGAL_SIMPLE_KERNEL
0056 
0057 // our extras to help us navigate, find distance, etc.
0058 const int INFINITE_VERTEX=-1;
0059 const int NEW_VERTEX=-2;
0060 const double HUGE_DOUBLE=1e300;
0061 
0062 /// \if internal_doc
0063 /// @ingroup internal
0064 /// \struct InitialisedInt
0065 /// A class to provide an "int" with an initial value.
0066 /// \endif
0067 class InitialisedInt {
0068  private:
0069   int _val;
0070  public:
0071   inline InitialisedInt () {_val=NEW_VERTEX;};
0072   inline InitialisedInt& operator= (int value) {_val = value; return *this;};
0073   inline int val() const {return _val;};
0074 };
0075 
0076 
0077 // We can have triangulations with and without hierarchies -- those with 
0078 // are able to guarantee N ln N time for the construction of a large
0079 // triangulation, whereas those without go as N^{3/2} for points
0080 // sufficiently uniformly distributed in a plane.
0081 //
0082 //#define NOHIERARCHY
0083 #ifdef NOHIERARCHY
0084 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vb;
0085 typedef CGAL::Triangulation_face_base_2<K> Fb;
0086 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
0087 typedef CGAL::Delaunay_triangulation_2<K,Tds>  Triangulation;
0088 #else
0089 typedef CGAL::Triangulation_vertex_base_with_info_2<InitialisedInt,K> Vbb;
0090 typedef CGAL::Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
0091 typedef CGAL::Triangulation_face_base_2<K> Fb;
0092 typedef CGAL::Triangulation_data_structure_2<Vb,Fb> Tds;
0093 typedef CGAL::Delaunay_triangulation_2<K,Tds>  Dt;
0094 typedef CGAL::Triangulation_hierarchy_2<Dt> Triangulation;
0095 #endif
0096 
0097 typedef Triangulation::Vertex_handle  Vertex_handle;
0098 typedef Triangulation::Point          Point; /// CGAL Point structure
0099 typedef Triangulation::Vertex_circulator Vertex_circulator;
0100 typedef Triangulation::Face_circulator Face_circulator;
0101 typedef Triangulation::Face_handle Face_handle;
0102 
0103 
0104 
0105 FASTJET_END_NAMESPACE
0106 
0107 #endif // __FASTJET_TRIANGULATION__
0108 #endif //  DROP_CGAL