From 44e4adcbb7762a890270376abe3fe1b32d2a2d61 Mon Sep 17 00:00:00 2001 From: Sebastian Limbach Date: Wed, 28 Feb 2007 16:09:53 +0000 Subject: [PATCH] hgdelta_update function from Polynomial.h is now located in this separate file. --- .gitattributes | 1 + .../include/CGAL/Polynomial/hgdelta_update.h | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 Polynomial/include/CGAL/Polynomial/hgdelta_update.h diff --git a/.gitattributes b/.gitattributes index 36b02b0838b..7fb9c20ccdb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1722,6 +1722,7 @@ Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d_InnermostLeadingCoefficient Polynomial/doc_tex/Polynomial_ref/PolynomialTraits_d_Move.tex -text Polynomial/doc_tex/Polynomial_ref/Polynomial_1.tex -text Polynomial/include/CGAL/Polynomial/Coercion_traits.h -text +Polynomial/include/CGAL/Polynomial/hgdelta_update.h -text Polytope_distance_d/test/Polytope_distance_d/create_test_PD_cin -text Polytope_distance_d/test/Polytope_distance_d/test_PD.cin -text Polytope_distance_d/test/Polytope_distance_d/test_PD_data/intersecting_segments.data -text diff --git a/Polynomial/include/CGAL/Polynomial/hgdelta_update.h b/Polynomial/include/CGAL/Polynomial/hgdelta_update.h new file mode 100644 index 00000000000..f3a2812b381 --- /dev/null +++ b/Polynomial/include/CGAL/Polynomial/hgdelta_update.h @@ -0,0 +1,45 @@ +// TODO: Add licence +// +// 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) : +// +// ============================================================================ + +// TODO: The comments are all original EXACUS comments and aren't adapted. So +// they may be wrong now. + +#ifndef CGAL_POLYNOMIAL_HGDELTA_UPDATE_H +#define CGAL_POLYNOMIAL_HGDELTA_UPDATE_H + +CGAL_BEGIN_NAMESPACE + +// This subroutine has been retained here for use in both new files. +namespace INTERN_POLYNOMIAL { + template inline + void hgdelta_update(NT& h, const NT& g, int delta) { + typename Algebraic_structure_traits::Integral_division idiv; + + // compute h = h^(1-delta) * g^delta + switch (delta) { + case 0: + // h = h; + break; + case 1: + h = g; + break; + default: + h = idiv(ipower(g, delta), ipower(h, delta-1)); + break; + } + } +} // namespace INTERN_POLYNOMIAL + +CGAL_END_NAMESPACE + +#endif // CGAL_POLYNOMIAL_HGDELTA_UPDATE_H