mirror of https://github.com/CGAL/cgal
Deal with empty curves
This commit is contained in:
parent
1b0c19dec6
commit
b5f983695e
|
|
@ -25,7 +25,6 @@ int main()
|
|||
CGAL::IO::read_linestring_WKT(in, curves.back());
|
||||
}
|
||||
|
||||
int N = curves.size();
|
||||
Curve query = curves.back();
|
||||
curves.pop_back();
|
||||
|
||||
|
|
|
|||
|
|
@ -128,6 +128,9 @@ bool is_Frechet_distance_larger(const PointRange& polyline1,
|
|||
Interval_nt<false>>;
|
||||
Protect_FPU_rounding<filtered> p;
|
||||
|
||||
if(polyline1.empty() || polyline2.empty()){
|
||||
return false;
|
||||
}
|
||||
auto icurve1 = Frechet_distance::internal::toCurve<force_filtering>(polyline1, traits);
|
||||
auto icurve2 = Frechet_distance::internal::toCurve<force_filtering>(polyline2, traits);
|
||||
|
||||
|
|
@ -186,6 +189,11 @@ std::pair<double,double> bounded_error_Frechet_distance(const PointRange& polyli
|
|||
Interval_nt<false>>;
|
||||
Protect_FPU_rounding<filtered> p;
|
||||
|
||||
|
||||
if(polyline1.empty() || polyline2.empty()){
|
||||
return std::make_pair<double>(0,0);
|
||||
}
|
||||
|
||||
auto icurve1 = Frechet_distance::internal::toCurve<force_filtering>(polyline1, traits);
|
||||
auto icurve2 = Frechet_distance::internal::toCurve<force_filtering>(polyline2, traits);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue