Subject: CGAL users discussion list
List archive
- From: Jean Pierre Charalambos <>
- To:
- Subject: [cgal-discuss] conversion between Gmpq and double
- Date: Tue, 17 Feb 2009 18:59:43 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; b=b8muJ8sLXisirsfRcNwbhQJPXU9+Iy4AHRBOEN21OyOgBdFMuUzdnbVYke+UYXZ8zH bbbcxbieEfqWqQVLrEaqTP7JYN8pf8rzUV9nC/djepES32U9Z2KN+XqWrI6HhSzlv8N2 xuvhK+omKime4D+/unNqXPOxb3NhAQwoER4os=
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.
- [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.