From 9f45c201233cd0c992cf9ea6d24e1739c852449d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Pe=C3=B1aranda?= Date: Thu, 19 Sep 2013 15:37:59 -0300 Subject: [PATCH] changed c-style to c++-style comments --- .../include/CGAL/RS/algebraic_1.h | 3 +- .../include/CGAL/RS/isolator_1.h | 102 ++++++++---------- .../include/CGAL/RS/polynomial_1_utils.h | 64 ++++++----- .../include/CGAL/RS/sign_1_no_rs.h | 3 +- 4 files changed, 82 insertions(+), 90 deletions(-) diff --git a/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h b/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h index b87f8b993f8..04504ab87e5 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/algebraic_1.h @@ -122,7 +122,8 @@ public: bool is_valid()const; bool is_finite()const; - /*template*/ double to_double()const; + //template + double to_double()const; std::pair to_interval() const; Algebraic_1 sqrt()const; }; // class Algebraic_1 diff --git a/Algebraic_kernel_d/include/CGAL/RS/isolator_1.h b/Algebraic_kernel_d/include/CGAL/RS/isolator_1.h index a2e6b524079..4b4fc8a602d 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/isolator_1.h +++ b/Algebraic_kernel_d/include/CGAL/RS/isolator_1.h @@ -22,16 +22,15 @@ // // ============================================================================ -/*! \file RS/isolator.h - \brief Defines class CGAL::RS_real_root_isolator - - Isolate real roots of polynomials with Fabrice Roullier's Rs. - - The polynomial has to be a univariate polynomial over any number type - which is contained in the real numbers. The polynomial does not need to - be square-free. - -*/ +/// \file RS/isolator.h +/// Defines class CGAL::RS_real_root_isolator +/// +/// Isolate real roots of polynomials with Fabrice Roullier's Rs. +/// +/// The polynomial has to be a univariate polynomial over any number type +/// which is contained in the real numbers. The polynomial does not need to +/// be square-free. +/// #ifndef CGAL_ALGEBRAIC_KERNEL_D_RS_ISOLATOR_H #define CGAL_ALGEBRAIC_KERNEL_D_RS_ISOLATOR_H @@ -45,11 +44,9 @@ namespace CGAL { namespace internal { -/*! \brief A model of concept RealRootIsolator. - - Polynomial_ must be Polynomial, and Bound_ must be Gmpfr. - - */ +/// A model of concept RealRootIsolator. +/// +/// Polynomial_ must be Polynomial, and Bound_ must be Gmpfr. template class RS_real_root_isolator { @@ -68,11 +65,9 @@ private: typedef Gmpfi Interval; public: - /*! \brief Constructor from univariate square free polynomial. - - The RealRootIsolator provides isolating intervals for the real - roots of the polynomial - */ + /// Constructor from univariate square free polynomial. + /// The RealRootIsolator provides isolating intervals for the real + /// roots of the polynomial RS_real_root_isolator(const Polynomial& p = Polynomial(Coefficient(0))) : _m_polynomial(p) //, _m_interval_given(false) @@ -84,61 +79,58 @@ public: public: // functions - /*! \brief returns the defining polynomial*/ + //! Returns the defining polynomial. Polynomial polynomial() const { return _m_polynomial; } - //! returns the number of real roots + //! Returns the number of real roots. int number_of_real_roots() const { return _m_real_roots.size(); } - /*! \brief returns true if the isolating interval is degenerated to a - single point. - - If is_exact_root(i) is true, - then left_bound(int i) equals \f$root_i\f$. \n - If is_exact_root(i) is true, - then right_bound(int i) equals \f$root_i\f$. \n - */ + /// Returns true if the isolating interval is degenerated to a + /// single point. + /// + /// If is_exact_root(i) is true, + /// then left_bound(int i) equals \f$root_i\f$. \n + /// If is_exact_root(i) is true, + /// then right_bound(int i) equals \f$root_i\f$. \n bool is_exact_root(int i) const { return(_m_real_roots[i].inf()==_m_real_roots[i].sup()); } public: - /*! \brief returns \f${l_i}\f$ the left bound of the isolating interval - for root \f$root_{i}\f$. - - In case is_exact_root(i) is true, \f$l_i = root_{i}\f$,\n - otherwise: \f$l_i < root_{i}\f$. - - If \f$i-1>=0\f$, then \f$l_i > root_{i-1}\f$. \n - If \f$i-1>=0\f$, then \f$l_i >= r_{i-1}\f$, - the right bound of \f$root_{i-1}\f$\n - - \pre 0 <= i < number_of_real_roots() - */ + /// Returns \f${l_i}\f$ the left bound of the isolating interval + /// for root \f$root_{i}\f$. + /// + /// In case is_exact_root(i) is true, \f$l_i = root_{i}\f$,\n + /// otherwise: \f$l_i < root_{i}\f$. + /// + /// If \f$i-1>=0\f$, then \f$l_i > root_{i-1}\f$. \n + /// If \f$i-1>=0\f$, then \f$l_i >= r_{i-1}\f$, + /// the right bound of \f$root_{i-1}\f$\n + /// + /// \pre 0 <= i < number_of_real_roots() Bound left_bound(int i) const { CGAL_assertion(i >= 0); CGAL_assertion(i < this->number_of_real_roots()); return _m_real_roots[i].inf(); } - /*! \brief returns \f${r_i}\f$ the right bound of the isolating interval - for root \f$root_{i}\f$. - - In case is_exact_root(i) is true, \f$r_i = root_{i}\f$,\n - otherwise: \f$r_i > root_{i}\f$. - - If \f$i+1< n \f$, then \f$r_i < root_{i+1}\f$, - where \f$n\f$ is number of real roots.\n - If \f$i+1< n \f$, then \f$r_i <= l_{i+1}\f$, - the left bound of \f$root_{i+1}\f$\n - - \pre 0 <= i < number_of_real_roots() - */ + /// Returns \f${r_i}\f$ the right bound of the isolating interval + /// for root \f$root_{i}\f$. + /// + /// In case is_exact_root(i) is true, \f$r_i = root_{i}\f$,\n + /// otherwise: \f$r_i > root_{i}\f$. + /// + /// If \f$i+1< n \f$, then \f$r_i < root_{i+1}\f$, + /// where \f$n\f$ is number of real roots.\n + /// If \f$i+1< n \f$, then \f$r_i <= l_{i+1}\f$, + /// the left bound of \f$root_{i+1}\f$\n + /// + /// \pre 0 <= i < number_of_real_roots() Bound right_bound(int i) const { CGAL_assertion(i >= 0); CGAL_assertion(i < this->number_of_real_roots()); diff --git a/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h b/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h index b934e133125..a492a9fb867 100644 --- a/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h +++ b/Algebraic_kernel_d/include/CGAL/RS/polynomial_1_utils.h @@ -251,39 +251,37 @@ struct Ediv_1: public std::binary_function{ RS_polynomial_1* operator()(const RS_polynomial_1 &f,const RS_polynomial_1 &g){ - /* - int degf,degg,i; - mpz_ptr lcg; - mpz_t r; - degf=f.get_degree(); - degg=g.get_degree(); - RS_polynomial_1 *q=new RS_polynomial_1(degf-degg); - lcg=g.leading_coefficient(); - if(!degg){ - for(int i=0;i<=degf;++i) - mpz_divexact(q->coef(i),f.coef(i),lcg); - return q; - } - mpz_init(r); - mpz_set(r,f.leading_coefficient()); - std::cout<<"f="<