You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, If I want to know if a point is on a segment(like use "bounded_side"), when the number type is double, the result maybe is wrong.
If I specialize the template function "CGAL::compare" like this(from network):
double tolerance = 1e-4; // two numbers are equal if their difference is within this rangetemplate <>
inlinetypename CGAL::Real_embeddable_traits<typename CGAL::Coercion_traits<double,double>::Type>
::Compare::result_type
CGAL::compare(constdouble& a,constdouble& b)
{
if((a - b) < -tolerance){
return SMALLER;
}
elseif((a - b) > tolerance){
return LARGER;
}
else{
return EQUAL;
}
}
OK, the "bounded_side" has a correct result now.
But I dont know that CGAL::intersection, CGAL::join ... , these functions can also get the correct results I want.
And I can't find anything in the documentation about: "How to specialize those templates" and "which templates should be specialized".
Someone help?
Sorry about my english.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
For example, If I want to know if a point is on a segment(like use "bounded_side"), when the number type is double, the result maybe is wrong.
If I specialize the template function "CGAL::compare" like this(from network):
OK, the "bounded_side" has a correct result now.
But I dont know that
CGAL::intersection
,CGAL::join
... , these functions can also get the correct results I want.And I can't find anything in the documentation about: "How to specialize those templates" and "which templates should be specialized".
Someone help?
Sorry about my english.
Beta Was this translation helpful? Give feedback.
All reactions