Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] CGAL::Assertion_exception

Subject: CGAL users discussion list

List archive

[cgal-discuss] CGAL::Assertion_exception


Chronological Thread 
  • From: wendsomde <>
  • To:
  • Subject: [cgal-discuss] CGAL::Assertion_exception
  • Date: Sat, 24 Sep 2011 09:07:16 -0700 (PDT)

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&lt;CGAL::Lazy_exact_nt&lt;CGAL::Quotient&lt;CGAL::MP_Float&gt;>>.
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&lt;CGAL::Quotient&lt;CGAL::MP_Float&gt;>) 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&lt;NumberType,OperationsType&gt; operator* (
CVertex3Base&lt;NumberType,OperationsType&gt;& oVertex,
CMatrix4x4Base&lt;NumberType,OperationsType&gt;& oMatrix )
{
CVertex3Base&lt;NumberType,OperationsType&gt; 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.



Archive powered by MHonArc 2.6.16.

Top of Page