Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-15 08:57:35

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