Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] CGAL::Assertion_exception
- Date: Tue, 27 Sep 2011 10:14:30 +0200
First try with this kernel:
CGAL::Simple_cartesian<CGAL::Gmpq> or
CGAL::Simple_cartesian<CGAL::Quotient<CGAL::MP_Float> if gmp is not
available on your machine.
This will deactivate the filtering layer and probably will give you
more information on where the problem is.
If you cannot solve it, then we will need more details (ideally a
minimal example showing the problem).
Sebastien.
wendsomde wrote:
Hello,
I am using CGAL 3.8 under Windows XP/Visual Studio 2008. I have first been
using the Exact_predicates_inexact_constructions_kernel Kernel with the
double number type but I the realized that some of my geometry operations
returned wrong results. So I switched to the exact kernel
CGAL::Simple_cartesian<CGAL::Lazy_exact_nt<CGAL::Quotient<CGAL::MP_Float>>>.
For this to be possible, I had to modify some of my own code to use the CGAL
exact number type (in this case
CGAL::Lazy_exact_nt<CGAL::Quotient<CGAL::MP_Float>>) instead of
double. Part of this code is a vertex class and a matrix class that I use
for some computations. For exemple the operator * for multiplying a matrix
with a vertex looks like this:
template<class NumberType,class OperationsType>
CVertex3Base<NumberType,OperationsType> operator* (
CVertex3Base<NumberType,OperationsType>& oVertex,
CMatrix4x4Base<NumberType,OperationsType>& oMatrix )
{
CVertex3Base<NumberType,OperationsType> oVertex3dRet;
for ( int i = 0; i < 3; i++ ) {
oVertex3dRet[i] = 0.0;
for ( int j = 0; j < 3; j++ ) {
oVertex3dRet[i] += oMatrix(j,i)*oVertex[j];
}
}
return oVertex3dRet;
}
However, my program crashes on an "CGAL::Assertion_exception" at the first
place I perform an arithmetic operation on the CGAL number type, in this
case in the code
oVertex3dRet[i] += oMatrix(j,i)*oVertex[j];
Somewhere in my stacktrace I got " Variable used before being initialized (or CGAL bug)"
Could anyone tell me what I am doing wrong?
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/CGAL-Assertion-exception-tp3839613p3839613.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] CGAL::Assertion_exception, wendsomde, 09/24/2011
- Re: [cgal-discuss] CGAL::Assertion_exception, Sebastien Loriot (GeometryFactory), 09/27/2011
Archive powered by MHonArc 2.6.16.