CGAL : centroid and BigFLoat

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CGAL : centroid and BigFLoat

Tom Dreyfus-2

Hello,

I have some trouble using the CORE::BigFloat number type with the centroid function of CGAL, and I did not see any body with the same problems.

Here is a minimal example that does not compile for me :

#include <CGAL/CORE_BigFloat.h>
#include <CGAL/Cartesian.h>
#include <CGAL/centroid.h>
typedef CGAL::Cartesian<CORE::BigFloat> K;
int main(int argc, char *argv[]){
  std::vector<K::Point_3> points;
  K::Point_3 c = CGAL::centroid(points.begin(), points.end());
  return 0;}

I have the following error :


/usr/include/CGAL/centroid.h:425:23: error: call of overloaded ‘BigFloat(unsigned int&)’ is ambiguous
   return ORIGIN + v / (FT)nb_pts;
                       ^~~~~~~~~~

I can solve this by simply turning the unsigned nb_points into an int, but there is may be something I did not see, or the problem is solved in a more recent version of CGAL ?

My environment is :

Compiler : GNU 6.3.1, /usr/lib64/ccache/c++

OS : Fedora 25

CGAL : 4.9.1 installed with dnf

Thanks !

Tom.





Reply | Threaded
Open this post in threaded view
|

Re: CGAL : centroid and BigFLoat

Sebastien Loriot (GeometryFactory)
BigFloat does not have a constructor from unsigned int so it makes the
call in centroid ambiguous as you noted.

Should be fixed by https://github.com/CGAL/cgal/pull/3166

Sebastien.

On 06/08/2018 11:38 AM, Tom Dreyfus wrote:

> Hello,
>
> I have some trouble using the CORE::BigFloat number type with the
> centroid function of CGAL, and I did not see any body with the same
> problems.
>
> Here is a minimal example that does not compile for me :
>
> /#include <CGAL/CORE_BigFloat.h>//
> //#include <CGAL/Cartesian.h>//
> //#include <CGAL/centroid.h>//
> //typedef CGAL::Cartesian<CORE::BigFloat> K;//
> //int main(int argc, char *argv[]){//
> //  std::vector<K::Point_3> points;//
> //  K::Point_3 c = CGAL::centroid(points.begin(), points.end());//
> //  return 0;}/
>
> I have the following error :
>
> *
> **/usr/include/CGAL/centroid.h:425:23: error: call of overloaded
> ‘BigFloat(unsigned int&)’ is ambiguous**
> **   return ORIGIN + v / (FT)nb_pts;**
> **                       ^~~~~~~~~~*
>
> I can solve this by simply turning the unsigned nb_points into an int,
> but there is may be something I did not see, or the problem is solved in
> a more recent version of CGAL ?
>
> My environment is :
>
> _Compiler_ : GNU 6.3.1, /usr/lib64/ccache/c++
>
> _OS_ : Fedora 25
>
> _CGAL_ : 4.9.1 installed with dnf
>
> Thanks !
>
> Tom.
>
>
>
>
>

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