BWAPI
|
00001 // Copyright (c) 2008 Max-Planck-Institute Saarbruecken (Germany) 00002 // 00003 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public License as 00005 // published by the Free Software Foundation; version 2.1 of the License. 00006 // See the file LICENSE.LGPL distributed with CGAL. 00007 // 00008 // Licensees holding a valid commercial license may use this file in 00009 // accordance with the commercial license agreement provided with the software. 00010 // 00011 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 // 00014 // $URL: svn+ssh://afabri@scm.gforge.inria.fr/svn/cgal/trunk/Polynomial/include/CGAL/Polynomial/polynomial_functions.h $ 00015 // $Id: polynomial_functions.h 46402 2008-10-21 16:20:05Z eric $ 00016 // 00017 // 00018 // Author(s) : Michael Hemmer 00019 // ============================================================================ 00020 00021 // TODO: The comments are all original EXACUS comments and aren't adapted. So 00022 // they may be wrong now. 00023 00024 #ifndef CGAL_POLYNOMIAL_HGDELTA_UPDATE_H 00025 #define CGAL_POLYNOMIAL_HGDELTA_UPDATE_H 00026 00027 CGAL_BEGIN_NAMESPACE 00028 00029 // This subroutine has been retained here for use in both new files. 00030 namespace CGALi { 00031 template <class NT> inline 00032 void hgdelta_update(NT& h, const NT& g, int delta) { 00033 typename Algebraic_structure_traits<NT>::Integral_division idiv; 00034 00035 // compute h = h^(1-delta) * g^delta 00036 switch (delta) { 00037 case 0: 00038 // h = h; 00039 break; 00040 case 1: 00041 h = g; 00042 break; 00043 default: 00044 h = idiv(CGAL::ipower(g, delta), CGAL::ipower(h, delta-1)); 00045 break; 00046 } 00047 } 00048 } // namespace CGALi 00049 00050 CGAL_END_NAMESPACE 00051 00052 #endif // CGAL_POLYNOMIAL_HGDELTA_UPDATE_H