Subject: CGAL users discussion list
List archive
- From: Bruce Duncan <>
- To:
- Subject: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s)
- Date: Fri, 06 Aug 2010 13:02:32 +0100
- Openpgp: id=BFD0445D
- Organization: School of Engineering, University of Edinburgh
Hi all,
As part of my project, I've encountered a couple of troubles using CGAL.
I'd appreciate some guidance on where I'm going wrong!
For one of the assertions I'm hitting, I've created what I hope is a
small testcase. The code and the output on my machine is attached.
I think I do want to use the Exact_constructions_exact_predicates
kernel, however, I hit a different assertion with
Extended_homogeneous<Gmpz> and Homogeneous<Gmpzf> doesn't compile...
Pointers in this area would also be welcome.
Regards,
Bruce
--
CLX Compute Cluster Developer (http://clx.see.ed.ac.uk/)
AL116, Alrick Building, King's Buildings. 0131 6505637
School of Engineering, University of Edinburgh
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Extended_homogeneous.h> #include <CGAL/Quotient.h> #include <CGAL/Gmpz.h> #include <CGAL/Gmpzf.h> #include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Polyhedron_3.h> #include <CGAL/IO/Nef_polyhedron_iostream_3.h> #include <CGAL/IO/Polyhedron_VRML_2_ostream.h> #include <CGAL/centroid.h> #include <list> #include <fstream> #include <iostream> typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; //typedef CGAL::Homogeneous<CGAL::Gmpzf> Kernel; //typedef CGAL::Extended_homogeneous<CGAL::Gmpz> Kernel; typedef CGAL::Polyhedron_3<Kernel> Polyhedron; typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron; typedef Polyhedron::Vertex_iterator Vertex_iterator; typedef Kernel::Vector_3 Vector; typedef Kernel::Direction_3 Direction; typedef Kernel::Aff_transformation_3 Aff_transformation; typedef Kernel::Plane_3 Plane_3; typedef Kernel::Vector_3 Vector_3; typedef Kernel::Point_3 Point_3; int main() { Point_3 p( 1.0, 0.0, 0.0); Point_3 q( 0.0, 1.0, 0.0); Point_3 r( 0.0, 0.0, 1.0); Point_3 s( 0.0, 0.0, 0.0); Polyhedron P; P.make_tetrahedron( p, q, r, s); Nef_polyhedron N(P); Polyhedron P1; N.convert_to_polyhedron(P1); Polyhedron::Facet_const_iterator fi = P1.facets_begin(); std::cerr << "Facet... " << &fi << std::endl; std::cerr << "fi->plane(): " << fi->plane() << std::endl; std::cerr << "fi->plane().orthogonal_direction(): " << fi->plane().orthogonal_direction() << std::endl; Direction d1 = fi->plane().orthogonal_direction(); //++fi; std::cout << (d1 == fi->plane().orthogonal_direction()) << std::endl; return 0; }:)
bduncan@ltw2676:~/src/cutcell$
g++ -o testcase testcase.cpp -lgmp -lCGAL -I/home/bduncan/opt/include
-L/home/bduncan/opt/lib -frounding-math -ffloat-store -ggdb 2>&1
:)
bduncan@ltw2676:~/src/cutcell$
LD_LIBRARY_PATH=/home/bduncan/opt/lib gdb ./testcase
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/bduncan/src/cutcell/testcase...done.
(gdb) run
Starting program: /home/bduncan/src/cutcell/testcase
[Thread debugging using libthread_db enabled]
Facet... 0xbffff214
fi->plane(): 0.5 0.5 0.5 0.5
fi->plane().orthogonal_direction(): 0.5 0.5 0.5
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: !(i>s)
File: /home/bduncan/opt/include/CGAL/Interval_nt.h
Line: 88
Explanation: Variable used before being initialized (or CGAL bug)
Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt
#0 0x0012d422 in __kernel_vsyscall ()
#1 0x00322651 in *__GI_raise (sig=6) at
../nptl/sysdeps/unix/sysv/linux/raise.c:64
#2 0x00325a82 in *__GI_abort () at abort.c:92
#3 0x0027c52f in __gnu_cxx::__verbose_terminate_handler() () from
/usr/lib/libstdc++.so.6
#4 0x0027a465 in ?? () from /usr/lib/libstdc++.so.6
#5 0x0027a4a2 in std::terminate() () from /usr/lib/libstdc++.so.6
#6 0x0027a5e1 in __cxa_throw () from /usr/lib/libstdc++.so.6
#7 0x001a7c24 in CGAL::assertion_fail(char const*, char const*, int, char
const*) () from /home/bduncan/opt/lib/libCGAL.so.5
#8 0x0804fbd9 in Interval_nt (this=0xbfffef68, i=1, s=0) at
/home/bduncan/opt/include/CGAL/Interval_nt.h:87
#9 0x08098e19 in CGAL::operator*<false> (a=..., b=...) at
/home/bduncan/opt/include/CGAL/Interval_nt.h:656
#10 0x08086a29 in CGAL::sign_of_determinant<CGAL::Interval_nt<false> >
(a00=..., a01=..., a10=..., a11=...) at
/home/bduncan/opt/include/CGAL/predicates/sign_of_determinant.h:38
#11 0x08075585 in CGAL::equal_directionC3<CGAL::Interval_nt<false> >
(dx1=..., dy1=..., dz1=..., dx2=..., dy2=..., dz2=...)
at /home/bduncan/opt/include/CGAL/predicates/kernel_ftC3.h:280
#12 0x08066b06 in
CGAL::DirectionC3<CGAL::Simple_cartesian<CGAL::Interval_nt<false> >
>::operator== (this=0x81fb430, d=...)
at /home/bduncan/opt/include/CGAL/Cartesian/Direction_3.h:113
#13 0x0805983b in
CGAL::CommonKernelFunctors::Equal_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
> >::operator() (this=0xbffff0ec, v1=..., v2=...)
at /home/bduncan/opt/include/CGAL/Kernel/function_objects.h:2159
#14 0x080543a4 in
CGAL::Filtered_predicate<CGAL::CommonKernelFunctors::Equal_3<CGAL::Simple_cartesian<CGAL::Gmpq>
>,
CGAL::CommonKernelFunctors::Equal_3<CGAL::Simple_cartesian<CGAL::Interval_nt<false>
> >,
CGAL::Exact_converter<CGAL::Lazy_kernel<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >,
CGAL::Simple_cartesian<CGAL::Gmpq> >,
CGAL::Approx_converter<CGAL::Lazy_kernel<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > >,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> > >,
true>::operator()<CGAL::Direction_3<CGAL::Lazy_kernel<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > >,
CGAL::Direction_3<CGAL::Lazy_kernel<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > > >
(this=0xbffff0eb, a1=..., a2=...)
at /home/bduncan/opt/include/CGAL/Filtered_predicate.h:209
#15 0x0804fb4a in
CGAL::operator==<CGAL::Lazy_kernel<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::Cartesian_converter<CGAL::Simple_cartesian<CGAL::Gmpq>,
CGAL::Simple_cartesian<CGAL::Interval_nt<false> >,
CGAL::NT_converter<CGAL::Gmpq, CGAL::Interval_nt<false> > > > > (p=..., q=...)
at /home/bduncan/opt/include/CGAL/Kernel/global_functions_3.h:750
#16 0x0804ba8d in main () at testcase.cpp:46
(gdb)
Attachment:
signature.asc
Description: OpenPGP digital signature
- [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s), Bruce Duncan, 08/06/2010
- Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s), Sylvain Pion, 08/06/2010
- Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s), Bruce Duncan, 08/06/2010
- Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s), Sylvain Pion, 08/09/2010
- Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s), Bruce Duncan, 08/06/2010
- Re: [cgal-discuss] Assertion: CGAL/Interval_nt.h:88: !(i>s), Sylvain Pion, 08/06/2010
Archive powered by MHonArc 2.6.16.