From cb1b03f4d8a76677b06134f7b9d40e45c1923a8b Mon Sep 17 00:00:00 2001 From: Baruch Zukerman Date: Sun, 18 Jun 2006 12:40:01 +0000 Subject: [PATCH] hash function for integers --- .gitattributes | 1 + .../CGAL/Sweep_line_2/Integer_hash_function.h | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 Arrangement_2/include/CGAL/Sweep_line_2/Integer_hash_function.h diff --git a/.gitattributes b/.gitattributes index 43728a1a3ad..baf4044fb41 100644 --- a/.gitattributes +++ b/.gitattributes @@ -258,6 +258,7 @@ Arrangement_2/doc_tex/Sweep_line_2/sl_simple.ps -text Arrangement_2/examples/Arrangement_2/ex_dual_lines.C -text Arrangement_2/examples/Arrangement_2/ex_unbounded_non_intersecting.C -text Arrangement_2/examples/Arrangement_2/points.dat -text +Arrangement_2/include/CGAL/Sweep_line_2/Integer_hash_function.h eol=lf Arrangement_of_spheres_3/include/CGAL/Arrangement_of_spheres_3/Sphere_key.h -text Arrangement_of_spheres_3/include/CGAL/Tools/Coordinate_index.h -text Arrangement_of_spheres_3/src/CGAL/Arrangement_of_spheres_traits_3.C -text diff --git a/Arrangement_2/include/CGAL/Sweep_line_2/Integer_hash_function.h b/Arrangement_2/include/CGAL/Sweep_line_2/Integer_hash_function.h new file mode 100644 index 00000000000..21f9a51b3b9 --- /dev/null +++ b/Arrangement_2/include/CGAL/Sweep_line_2/Integer_hash_function.h @@ -0,0 +1,40 @@ +// Copyright (c) 1997 Tel-Aviv University (Israel). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org); you may redistribute it under +// the terms of the Q Public License version 1.0. +// See the file LICENSE.QPL distributed with CGAL. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// +// Author(s) : Baruch Zukerman + +#ifndef CGAL_INTEGER_HASH_FUNCTION +#define CGAL_INTEGER_HASH_FUNCTION + +#include +#include + +CGAL_BEGIN_NAMESPACE + +struct Integer_hash_function +{ + typedef std::size_t result_type; + + std::size_t operator() (unsigned int i) const + { + return i; + } +}; + +CGAL_END_NAMESPACE + +#endif