// 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) : Arno Eigenwillig // Michael Seel // Michael Hemmer // // ============================================================================ // TODO: The comments are all original EXACUS comments and aren't adapted. So // they may be wrong now. /*! \file NiX/Polynomial.h * \brief Defines class NiX::Polynomial. * * Polynomials in one variable (or more, by recursion) */ #ifndef CGAL_POLYNOMIAL_H #define CGAL_POLYNOMIAL_H #include #include #include #include #include #include #include #include #include //#include #include #include #ifdef CGAL_USE_LEDA #include #endif // CGAL_USE_LEDA #include #include #include #include #include #include #include // TODO: Are these still includes necessary? #include // used above for NT_traits::Gcd #include // for compatibility #include #include CGAL_BEGIN_NAMESPACE // Internally, Polynomials also need this: //! used internally for data exchanged between nesting levels of polynomials // this traits-class provides // a) poly_nesting_depth: a counter for identifying a polynomials nesting level // b) Innermost_coefficient: a type which defines the numbertype of the // innermost nesting level, which is not a polynomial itself // c) Innermost_lcoeff: returns the leading coefficient of the polynomial in its // common sense // d) Innermost_coefficient_to_polynomial: transforms an innermost // numbertype into a polynomial like a typecast // fwd Polynomial_traits_d //template class Polynomial_traits_d; // // Non-Member Functions // // The following former parts of Polynomial.h have been moved to the new files // (items 2,3,5) and (item 4): // // 2) gcd (basic form without cofactors) // 3) extended gcd computation (with cofactors) // 4) resultant computation from polynomial remainder sequences (PRS) // 5) square-free factorization // } // namespace NiX // Cofraction_traits added by Michael Hemmer /*namespace NiX{ namespace Intern{ template class Cofraction_traits_base; template class Cofraction_traits_base, TAG > { typedef NT_ NT; public: typedef Polynomial Numerator_type; typedef ::LiS::False_tag Is_composable; typedef ::LiS::Null_tag Denominator_type; typedef ::LiS::Null_tag Type; typedef ::LiS::Null_tag Compose; }; template class Cofraction_traits_base, LiS::True_tag > { typedef NT_ NT; typedef NiX::Cofraction_traits CFT_NT; public: typedef Polynomial Numerator_type; typedef ::LiS::True_tag Is_composable; typedef typename CFT_NT::Denominator_type Denominator_type; typedef Polynomial Type; class Compose { public: //! first argument type typedef Numerator_type first_argument_type; //! second argument type typedef Denominator_type second_argument_type; //! result type typedef Type result_type; //! Compose fraction Type operator() (Numerator_type num, Denominator_type den = Denominator_type(1)){ Type tmp1; NiX::convert_to(num,tmp1); Type tmp2; NiX::convert_to(den,tmp2); return tmp1/tmp2; } }; }; } //namespace Intern */ /*! \ingroup NiX_Cofraction_traits_specs * \brief Specialization of Cofraction_traits for NiX::Polynomial. */ //template /*class Cofraction_traits > : public Intern::Cofraction_traits_base< Polynomial, typename Cofraction_traits::Is_composable>{ //nothing new };*/ CGAL_END_NAMESPACE // // trailing documentation // // Literature reference // // [Akritas, 1989] // Alkiviadis G. Akritas // Elements of Computer Algebra With Applications // Wiley, New York, 1989. // // [Cohen, 1993] // Cohen, Henri // A Course in Computational Algebraic Number Theory // Springer GTM 138, 1993 // // [Cox et al, 1997] // David Cox; John Little; Donal O'Shea // Ideals, Varieties, and Algorithms // 2nd ed., Springer UTM, 1997 // // [Geddes et al, 1992] // Geddes, Keith O. and Czapor, Stephen R. and Labahn, George // Algorithms for Computer Algebra // Kluwer, 1992 // // [Mignotte, 1992] // Mignotte, Maurice // Mathematics for Computer Algebra // Springer, 1992 // // [PARI] // (a computer algebra system by Henri Cohen and collaborators) // http://www.parigp-home.de/ #endif // NiX_POLYNOMIAL_H // EOF