Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Exact to Double Conversion Error

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Exact to Double Conversion Error


Chronological Thread 
  • From: Myirci <>
  • To:
  • Subject: Re: [cgal-discuss] Exact to Double Conversion Error
  • Date: Wed, 23 Sep 2020 12:11:24 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:AL349h1T61rAzrI1smDT+DRfVm0co7zxezQtwd8ZsesWL/XxwZ3uMQTl6Ol3ixeRBMOHsq0C0rSd6f2oGTRZp8rY7jZaKN0EfiRGoP1epxYnDs+BBB+zB9/RRAt+Iv5/UkR49WqwK0lfFZW2TVTTpnqv8WxaQU2nZkJ6KevvB4Hdkdm82fys9J3PeQVIgye2ba9vIBmsogjdq8sbjZF/JqswxRfFvHtFcPlSyW90OF6fhRnx6tqx8ZJ57yhcp/ct/NNcXKvneKg1UaZWByk8PWAv483ruxjDTQ+R6XYZT24bjBlGDRXb4R/jRpv+vTf0ueR72CmBIM35Vqs0Vii476dqUxDnliEKPCMk/W7Ni8xwiKVboA+9pxF63oXZbp2ZOOZ4c6jAe94RWGhPUdtLVyFZDYy8YYkAAeoPM+hbsofzuUcBoACkCgWwHu7i0CNEimP00KA8zu8vERvG3AslH98Wt3rVrNT1NL0OXuC00aLFyjDDbvNX2Tfn9IfIcwssof6JXb1qcMrRzVMjGB/CjlWVsIHoOS6e2esRvWaB9eVgSf6vhHA9qwF3ujWi28MhhIbJi44J113J9Cp0zJg1KNC4TEN2b96pHZRNuiyHKod4TMMvTnxstSs7yrMLvZG1cTUUxZkmyRDRZPOJfo6V6RztU+aRJC13hHNjeL+niBa970+gyujiWcmoylZLriRFncPQuXAR0BzT8MiGRuFh8Uem3DaDzxzc6u5eLkAwj6bbLIQhwrEompoSt0TDBC72l1/sgK+YbEUp/PWj5ef/Yrj+uJOQK4t5hhv9P6kugMCzHPo0PwsUU2WU+umx0qDo81fjT7VQlPI2l7HUsJDEKsQfoa60GwpV3Zwi6xa7Fjun3tEYkWQeIFJLdx+KjJLlO17JIPD/Ave/h0qjnC13yPDBO73tGpTNLn7dn7f9Zbtx9VJQxQ4pwd1c559YEKwNLOzwV0Pru9HVDQc1MwmuzObmDNV92JkeWWWKAqKBNaPTsV6I5vgzLOmNf4IVtzP9JOIk5/7ql3M2hVgdfayx0ZsNdH+4BuhmI1meYXf0ntgBHn0Fvg4nQOP3iV2CSiJcZ2upX6In/Tw7E4KnDYLbRo+3mrCB3SG7HodXZm9cEFyMH23oJM25XewRYneSPtN5iW5DEqOwTpcokxCorg7zjbR9afHF/zUR8pPl2t8y7OLakVQ+9Cd/Et+GgFyLVHx+vn8NQ2o2wLxnuh46jUyS1LBxxf1eD91aof1TFRwrMIbViO18Bde1UQ3IepKFSU2tX869Ugw3Vc87/9IefxN9B8m6lUKEmDG7Bqcc0b2NHp09tKzGmGPgIt50jHfA2q5mhFYvRo5DNHatm7VkpDTUUoXGmkHcm6exfrkHxwbM8n2CxCyAphJ2Sgl1BIDUXGoUZwOCqMX4/EjDZ7CrALUjdABGzJjReeNxdtT1gAAeF7/YM9PEbjfpwjviNVOz3rqJKbHSVSAFxiyEURoLlgkS+TCNMg1sXn788VKbNyRnEBfUW22p8eR6rynmHEo9zgXPcEg4krTpqlgagvuTT/5V1bUB6n94+mdEWW2l1teTMOKu4g9ofaFSe9Q4uQ4V2mfQtgg7NZulfflv

Hi,

Thank you Laurent for your answer, sorry for my late reply, I had a computer issue and could not try out your suggestion.

I have installed libmpfi-dev and I'm now sure that my CMakeLists.txt can find it along with GMP and MPFR (As I observe it in cmake-gui). However, I still cannot make the simple program run. Here is the error I got, does it make any sense?


ERROR LOG:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
myirci@ubuntu:~/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/build$ make
[ 50%] Building CXX object CMakeFiles/test.dir/test.cpp.o
In file included from /usr/include/CGAL/Algebraic_kernel_d_1.h:31,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h: In instantiation of ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:61: error: conversion from ‘CGAL::Null_functor::result_type’ {aka ‘CGAL::Null_tag’} to non-scalar type ‘std::pair<double, double>’ requested
  176 |       std::pair<double, double> interval = CGAL::to_interval( convert_to_bfi( (*this)));
      |                                            ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/CGAL/CORE_BigFloat.h:22,
                 from /usr/include/CGAL/CORE_arithmetic_kernel.h:31,
                 from /usr/include/CGAL/Arithmetic_kernel.h:43,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:30,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Bigfloat_interval_traits.h: In instantiation of ‘long int CGAL::get_precision(BFI) [with BFI = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:174:41:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Bigfloat_interval_traits.h:39:59: error: invalid use of incomplete type ‘class CGAL::Bigfloat_interval_traits<CGAL::Null_tag>’
   39 |     typename Bigfloat_interval_traits<BFI>::Get_precision get_precision;
      |                                                           ^~~~~~~~~~~~~
/usr/include/CGAL/Bigfloat_interval_traits.h:26:43: note: declaration of ‘class CGAL::Bigfloat_interval_traits<CGAL::Null_tag>’
   26 | template<typename BigfloatInterval> class Bigfloat_interval_traits;
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/CGAL/Bigfloat_interval_traits.h: In instantiation of ‘long int CGAL::set_precision(BFI, long int) [with BFI = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:175:20:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Bigfloat_interval_traits.h:34:59: error: invalid use of incomplete type ‘class CGAL::Bigfloat_interval_traits<CGAL::Null_tag>’
   34 |     typename Bigfloat_interval_traits<BFI>::Set_precision set_precision;
      |                                                           ^~~~~~~~~~~~~
/usr/include/CGAL/Bigfloat_interval_traits.h:26:43: note: declaration of ‘class CGAL::Bigfloat_interval_traits<CGAL::Null_tag>’
   26 | template<typename BigfloatInterval> class Bigfloat_interval_traits;
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/CGAL/Algebraic_kernel_d_1.h:31,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h: In instantiation of ‘typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval CGAL::convert_to_bfi(const CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>&) [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:77:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:479:43: error: no matching function for call to ‘CGAL::Null_tag::Null_tag(int)’
  479 |   if(CGAL::sign(x) == CGAL::ZERO) return (BFI(0));
      |                                          ~^~~~~~~
In file included from /usr/include/CGAL/basic.h:32,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:26,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/tags.h:50:8: note: candidate: ‘constexpr CGAL::Null_tag::Null_tag()’
   50 | struct Null_tag {};
      |        ^~~~~~~~
/usr/include/CGAL/tags.h:50:8: note:   candidate expects 0 arguments, 1 provided
/usr/include/CGAL/tags.h:50:8: note: candidate: ‘constexpr CGAL::Null_tag::Null_tag(const CGAL::Null_tag&)’
/usr/include/CGAL/tags.h:50:8: note:   no known conversion for argument 1 from ‘int’ to ‘const CGAL::Null_tag&’
/usr/include/CGAL/tags.h:50:8: note: candidate: ‘constexpr CGAL::Null_tag::Null_tag(CGAL::Null_tag&&)’
/usr/include/CGAL/tags.h:50:8: note:   no known conversion for argument 1 from ‘int’ to ‘CGAL::Null_tag&&’
In file included from /usr/include/CGAL/Algebraic_kernel_d_1.h:31,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:484:23: error: no matching function for call to ‘hull(CGAL::internal::Arithmetic_kernel_base::Bigfloat_interval, CGAL::internal::Arithmetic_kernel_base::Bigfloat_interval)’
  484 |   BFI bfi = CGAL::hull(convert_to_bfi(x.low()), convert_to_bfi(x.high()));
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/CGAL/Interval_nt.h:41,
                 from /usr/include/CGAL/long_double.h:27,
                 from /usr/include/CGAL/number_type_basic.h:52,
                 from /usr/include/CGAL/basic.h:33,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:26,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Interval_traits.h:205:1: note: candidate: ‘template<class Interval> typename CGAL::Interval_traits<T>::Hull::result_type CGAL::hull(Interval, Interval, typename boost::enable_if<boost::is_same<typename CGAL::Interval_traits<Interval>::Is_interval, CGAL::Boolean_tag<true> > >::type*)’
  205 | hull(Interval interval1, Interval interval2, typename boost::enable_if<
      | ^~~~
/usr/include/CGAL/Interval_traits.h:205:1: note:   template argument deduction/substitution failed:
/usr/include/CGAL/Interval_traits.h: In substitution of ‘template<class Interval> typename CGAL::Interval_traits<T>::Hull::result_type CGAL::hull(Interval, Interval, typename boost::enable_if<boost::is_same<typename CGAL::Interval_traits<Interval>::Is_interval, CGAL::Boolean_tag<true> > >::type*) [with Interval = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:484:23:   required from ‘typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval CGAL::convert_to_bfi(const CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>&) [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval = CGAL::Null_tag]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:77:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Interval_traits.h:205:1: error: no type named ‘type’ in ‘struct boost::enable_if<boost::is_same<CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >, void>’
In file included from /usr/include/CGAL/Algebraic_kernel_d_1.h:31,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h: In instantiation of ‘typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval CGAL::convert_to_bfi(const CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>&) [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:77:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:486:10: error: no match for ‘operator!’ (operand type is ‘CGAL::Null_functor::result_type’ {aka ‘CGAL::Null_tag’})
  486 |   while( !singleton(bfi) &&  get_significant_bits(bfi) < final_prec  ){
      |          ^~~~~~~~~~~~~~~
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:486:10: note: candidate: ‘operator!(bool)’ <built-in>
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:486:10: note:   no known conversion for argument 1 from ‘CGAL::Null_functor::result_type’ {aka ‘CGAL::Null_tag’} to ‘bool’
In file included from /usr/include/CGAL/assertions.h:350,
                 from /usr/include/CGAL/basic.h:31,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:26,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Uncertain.h:289:17: note: candidate: ‘CGAL::Uncertain<bool> CGAL::operator!(CGAL::Uncertain<bool>)’
  289 | Uncertain<bool> operator!(Uncertain<bool> a)
      |                 ^~~~~~~~
/usr/include/CGAL/Uncertain.h:289:43: note:   no known conversion for argument 1 from ‘CGAL::Null_functor::result_type’ {aka ‘CGAL::Null_tag’} to ‘CGAL::Uncertain<bool>’
  289 | Uncertain<bool> operator!(Uncertain<bool> a)
      |                           ~~~~~~~~~~~~~~~~^
In file included from /usr/include/CGAL/Algebraic_kernel_d_1.h:31,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:488:21: error: no matching function for call to ‘hull(CGAL::internal::Arithmetic_kernel_base::Bigfloat_interval, CGAL::internal::Arithmetic_kernel_base::Bigfloat_interval)’
  488 |     bfi = CGAL::hull(
      |           ~~~~~~~~~~^
  489 |         convert_to_bfi(x.low()),
      |         ~~~~~~~~~~~~~~~~~~~~~~~~
  490 |         convert_to_bfi(x.high()));
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/CGAL/Interval_nt.h:41,
                 from /usr/include/CGAL/long_double.h:27,
                 from /usr/include/CGAL/number_type_basic.h:52,
                 from /usr/include/CGAL/basic.h:33,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:26,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/Interval_traits.h:205:1: note: candidate: ‘template<class Interval> typename CGAL::Interval_traits<T>::Hull::result_type CGAL::hull(Interval, Interval, typename boost::enable_if<boost::is_same<typename CGAL::Interval_traits<Interval>::Is_interval, CGAL::Boolean_tag<true> > >::type*)’
  205 | hull(Interval interval1, Interval interval2, typename boost::enable_if<
      | ^~~~
/usr/include/CGAL/Interval_traits.h:205:1: note:   template argument deduction/substitution failed:
/usr/include/CGAL/Interval_traits.h: In substitution of ‘template<class Interval> typename CGAL::Interval_traits<T>::Hull::result_type CGAL::hull(Interval, Interval, typename boost::enable_if<boost::is_same<typename CGAL::Interval_traits<Interval>::Is_interval, CGAL::Boolean_tag<true> > >::type*) [with Interval = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:488:21:   required from ‘typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval CGAL::convert_to_bfi(const CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>&) [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval = CGAL::Null_tag]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:77:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/Interval_traits.h:205:1: error: no type named ‘type’ in ‘struct boost::enable_if<boost::is_same<CGAL::Boolean_tag<false>, CGAL::Boolean_tag<true> >, void>’
In file included from /usr/include/CGAL/double.h:22,
                 from /usr/include/CGAL/number_type_basic.h:51,
                 from /usr/include/CGAL/basic.h:33,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:26,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/number_utils.h: In instantiation of ‘typename CGAL::Real_embeddable_traits<Type_>::To_interval::result_type CGAL::to_interval(const Real_embeddable&) [with Real_embeddable = CGAL::Null_tag; typename CGAL::Real_embeddable_traits<Type_>::To_interval::result_type = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:61:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/number_utils.h:301:23: error: no match for call to ‘(CGAL::INTERN_RET::Real_embeddable_traits_base<CGAL::Null_tag, CGAL::Boolean_tag<false> >::To_interval {aka CGAL::Null_functor}) (const CGAL::Null_tag&)’
  301 |     return to_interval( x );
      |            ~~~~~~~~~~~^~~~~
In file included from /usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:27,
                 from /usr/include/CGAL/Algebraic_kernel_d_1.h:31,
                 from /home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:2:
/usr/include/CGAL/convert_to_bfi.h: In instantiation of ‘typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval CGAL::convert_to_bfi(const NTX&) [with NTX = CGAL::Gmpq; typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval = CGAL::Null_tag]’:
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:477:45:   required from ‘typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval CGAL::convert_to_bfi(const CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>&) [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; typename CGAL::Get_arithmetic_kernel<NT>::Arithmetic_kernel::Bigfloat_interval = CGAL::Null_tag]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:176:77:   required from ‘std::pair<double, double> CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_interval() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:161:13:   required from ‘double CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1>::to_double() const [with Coefficient_ = CGAL::Gmpz; Rational_ = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; AlgebraicRealRep_d_1 = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>]’
/usr/include/CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h:416:26:   required from ‘double CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::To_double::operator()(const Type&) const [with Coefficient = CGAL::Gmpz; Rational = CGAL::Gmpq; HandlePolicy = CGAL::Handle_policy_no_union; RepClass = CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq>; CGAL::Real_embeddable_traits<CGAL::internal::Algebraic_real_d_1<Coefficient_, Rational_, HandlePolicy, AlgebraicRealRep_d_1> >::Type = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >]’
/usr/include/CGAL/number_utils.h:291:21:   required from ‘typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type CGAL::to_double(const Real_embeddable&) [with Real_embeddable = CGAL::internal::Algebraic_real_d_1<CGAL::Gmpz, CGAL::Gmpq, CGAL::Handle_policy_no_union, CGAL::internal::Algebraic_real_rep<CGAL::Gmpz, CGAL::Gmpq> >; typename CGAL::Real_embeddable_traits<Type_>::To_double::result_type = double]’
/home/myirci/Documents/dev/bitbucket/dev_trial_cpp/CGAL/Algebraic_Kernel/Error/test.cpp:21:72:   required from here
/usr/include/CGAL/convert_to_bfi.h:30:31: error: no match for call to ‘(CGAL::Coercion_traits_for_level<CGAL::Gmpq, CGAL::Null_tag, 0>::Cast {aka CGAL::Null_functor}) (const CGAL::Gmpq&)’
   30 |     return typename CT::Cast()(x);
      |            ~~~~~~~~~~~~~~~~~~~^~~
make[2]: *** [CMakeFiles/test.dir/build.make:63: CMakeFiles/test.dir/test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/test.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
  

On Wed, Jul 22, 2020 at 11:14 AM Laurent Rineau (CGAL/GeometryFactory) <> wrote:
On Monday, July 20, 2020 12:54:54 PM CEST Myirci wrote:
> Hi all,
>
> I had been using CGAL actively for about 4 years ago and I have a project
> which I wanted to rebuild with the more recent version of CGAL 5.1 beta1. I
> have sorted out most of the compile errors but one simple thing caused lots
> of trouble which was working perfectly in the past but I cannot make it
> work right now. The error is related to a basic conversion from exact
> numbers such as CGAL::Gmpq, CGAL::Gmpz to double using the CGAL API such as
> CGAL::to_double() and CGAL::to_interval().
>
> I wrote down a sample code (based on the example in the CGAL documentation
> for Algebraic Kernels)
[...]
> test.cpp:
> ----------------------------------------------------------------------------
> -----------------------------------
>
> #include <CGAL/config.h>
> #include <CGAL/Algebraic_kernel_d_1.h>
> #include <CGAL/Gmpz.h>
> #include <vector>
>
> typedef CGAL::Algebraic_kernel_d_1<CGAL::Gmpz>          AK;
> typedef AK::Coefficient                                 Coefficient;
> typedef AK::Polynomial_1                                Polynomial_1;
> typedef AK::Algebraic_real_1                            Algebraic_real_1;
> typedef AK::Bound                                       Bound;
> typedef std::pair<Bound,Bound>                          Interval;

Hi Myirci, to use to_interval with the GMP algebraic kernel, you need the MPFI library. Maybe on your older machine, MPFI was available.

If you do not have MPFI, you can use the CORE algebraic kernel, that way:

//--------------
#include <CGAL/config.h>
#include <CGAL/Algebraic_kernel_d_1.h>
#include <vector>

typedef CGAL::Algebraic_kernel_d_1<CORE::BigInt>          AK;
typedef AK::Coefficient                                 Coefficient;
typedef AK::Polynomial_1                                Polynomial_1;
typedef AK::Algebraic_real_1                            Algebraic_real_1;
typedef AK::Bound                                       Bound;
typedef std::pair<Bound,Bound>                          Interval;

int main()
{
    AK ak;
    AK::Construct_algebraic_real_1 construct_algebraic_real_1 = ak.construct_algebraic_real_1_object();
    Polynomial_1 x = CGAL::shift(AK::Polynomial_1(1),1); // the monomial x
    Algebraic_real_1 a = construct_algebraic_real_1(x*x-2,1); //  sqrt(2)

    std::cout << "sign of a is                 : " << CGAL::sign(a)      << "\n";
    std::cout << "double approximation of a is : " << CGAL::to_double(a) << "\n";
    std::cout << "double lower bound of a      : " << CGAL::to_interval(a).first  << "\n";
    std::cout << "double upper bound of a      : " << CGAL::to_interval(a).second << "\n";

    return 0;
}
//--------------


--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory           http://www.geometryfactory.com/
Release Manager of the CGAL Project       http://www.cgal.org/




--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss




--
Murat Yirci



Archive powered by MHonArc 2.6.19+.

Top of Page