// Copyright (c) 2006-2013 INRIA Nancy-Grand Est (France). All rights reserved. // // 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. // See the file LICENSE.LGPL 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$ // SPDX-License-Identifier: LGPL-3.0+ // // Author: Luis PeƱaranda #ifndef CGAL_RS_POLYNOMIAL_CONVERTER_1_H #define CGAL_RS_POLYNOMIAL_CONVERTER_1_H namespace CGAL{ namespace RS_AK1{ template struct Polynomial_converter_1: public CGAL::cpp98::unary_function{ typedef InputPolynomial_ InpPolynomial_1; typedef OutputPolynomial_ OutPolynomial_1; OutPolynomial_1 operator()(const InpPolynomial_1&)const; }; // class Polynomial_converter_1 template <> Polynomial Polynomial_converter_1,Polynomial >::operator()( const Polynomial &p)const{ std::vector outcoeffs; unsigned degree=p.degree(); mpz_t lcm; mpz_init(lcm); mpz_lcm(lcm,mpq_denref(p[0].mpq()),mpq_denref(p[degree].mpq())); for(unsigned i=1;i(outcoeffs.begin(),outcoeffs.end()); } } // namespace RS_AK1 } // namespace CGAL #endif // CGAL_RS_POLYNOMIAL_CONVERTER_1_H