Subject: CGAL users discussion list
List archive
- From: Sebastien Loriot <>
- To:
- Subject: Re: [cgal-discuss] Re: conversion between Gmpq and double
- Date: Fri, 20 Feb 2009 14:20:36 +0100
Jean Pierre Charalambos wrote:
Hello,Hi! any thought regarding my conversion issue? I have been not able to fix it :( Best, Jean Pierre On Tue, Feb 17, 2009 at 6:59 PM, Jean Pierre Charalambos wrote:Hi cgal users, I'm new to cgal 3.4 and I want to compute the minimal bounding sphere of a set of spheres. So I just tried to adapt the min_sphere_of_spheres_d_3.cpp example, but I have a problem when trying to convert the sphere types (radius and center) to double types. I suppose this is a basic question, but I have read the faqs and I googled a lot without success. My code is: typedef CGAL::Gmpq FT; typedef CGAL::Cartesian<FT> K; typedef CGAL::Min_sphere_of_spheres_d_traits_3<K,FT> Traits; typedef CGAL::Min_sphere_of_spheres_d<Traits> Min_sphere; typedef K::Point_3 Point; typedef Traits::Sphere Sphere; //after checking in the spheres in ms and computing the minimal sphere (just like in the example) I attempted the conversion as follows: radius = CGAL::to_double(ms.radius()); However, I got the following compilation error: cannot convert 'CGAL::Null_tag' to 'double' in assignment If I use "typedef double FT" (instead of typedef CGAL::Gmpq FT) and retrieve the radius with "radius = ms.radius()" the code compiles (and it actually runs perfectly in cgal3.3), but I get the following errror at running time: terminate called after throwing an instance of 'CGAL::Assertion_exception' what(): CGAL ERROR: assertion violation! Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1) File: /usr/include/CGAL/Interval_nt.h Line: 154 Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC? Aborted Thank you in advanced for your suggestions, Jean Pierre -- You don't become a failure until you're satisfied with being one. According to http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Bounding_volumes_ref/Class_Min_sphere_of_spheres_d.html and in particular the text after Min_sphere_of_spheres_d<Traits>::Result, the Result of radius() should in your case be a pair<FT,FT> (a,b) representing a number a+b*sqrt(t), where t is given by member function disciminant(). Sebastien |
- [cgal-discuss] conversion between Gmpq and double, Jean Pierre Charalambos, 02/18/2009
- [cgal-discuss] Re: conversion between Gmpq and double, Jean Pierre Charalambos, 02/20/2009
- Re: [cgal-discuss] Re: conversion between Gmpq and double, Laurent Rineau (GeometryFactory), 02/20/2009
- Re: [cgal-discuss] Re: conversion between Gmpq and double, Sebastien Loriot, 02/20/2009
- Re: [cgal-discuss] Re: conversion between Gmpq and double, Sebastien Loriot, 02/20/2009
- Re: [cgal-discuss] Re: conversion between Gmpq and double, Jean Pierre Charalambos, 02/21/2009
- Re: [cgal-discuss] Re: conversion between Gmpq and double, Sebastien Loriot, 02/20/2009
- [cgal-discuss] Re: conversion between Gmpq and double, Jean Pierre Charalambos, 02/20/2009
Archive powered by MHonArc 2.6.16.