From 8d7329f3e5ad843e553c3c5503cecc28ef2eead6 Mon Sep 17 00:00:00 2001 From: Gard Spreemann Date: Thu, 20 Apr 2017 11:10:45 +0200 Subject: GUDHI 2.0.0 as released by upstream in a tarball. --- .../gudhi_patches/CGAL/NewKernel_d/static_int.h | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 include/gudhi_patches/CGAL/NewKernel_d/static_int.h (limited to 'include/gudhi_patches/CGAL/NewKernel_d/static_int.h') diff --git a/include/gudhi_patches/CGAL/NewKernel_d/static_int.h b/include/gudhi_patches/CGAL/NewKernel_d/static_int.h new file mode 100644 index 00000000..21858804 --- /dev/null +++ b/include/gudhi_patches/CGAL/NewKernel_d/static_int.h @@ -0,0 +1,61 @@ +// Copyright (c) 2014 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org); you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public License as +// published by the Free Software Foundation; either version 3 of the License, +// or (at your option) any later version. +// +// 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) : Marc Glisse + +#ifndef CGAL_STATIC_INT_H +#define CGAL_STATIC_INT_H +#include + +namespace CGAL { +template struct static_zero { + operator NT() const { return constant(); } +}; +template struct static_one { + operator NT() const { return constant(); } +}; + +template static_zero operator-(static_zero) { return static_zero(); } + +template NT operator+(NT const& x, static_zero) { return x; } +template NT operator+(static_zero, NT const& x) { return x; } +template static_zero operator+(static_zero, static_zero) { return static_zero(); } +template static_one operator+(static_zero, static_one) { return static_one(); } +template static_one operator+(static_one, static_zero) { return static_one(); } + +template NT operator-(NT const& x, static_zero) { return x; } +template NT operator-(static_zero, NT const& x) { return -x; } +template static_zero operator-(static_zero, static_zero) { return static_zero(); } +template static_zero operator-(static_one, static_one) { return static_zero(); } +template static_one operator-(static_one, static_zero) { return static_one(); } + +template NT operator*(NT const& x, static_one) { return x; } +template NT operator*(static_one, NT const& x) { return x; } +template static_zero operator*(NT const&, static_zero) { return static_zero(); } +template static_zero operator*(static_zero, NT const&) { return static_zero(); } +template static_zero operator*(static_zero, static_zero) { return static_zero(); } +template static_one operator*(static_one, static_one) { return static_one(); } +template static_zero operator*(static_zero, static_one) { return static_zero(); } +template static_zero operator*(static_one, static_zero) { return static_zero(); } + +template NT operator/(NT const& x, static_one) { return x; } +template static_zero operator/(static_zero, NT const&) { return static_zero(); } +template static_zero operator/(static_zero, static_one) { return static_zero(); } +template static_one operator/(static_one, static_one) { return static_one(); } + +} +#endif // CGAL_STATIC_INT_H -- cgit v1.2.3