CGAL 5.0.2  2D Polyline Simplification

#include <CGAL/Polyline_simplification_2/Scaled_squared_distance_cost.h>
This class is a cost function which calculates the cost as a scaled variant of the square of the distance between the original and simplified polylines.
Public Member Functions  
Scaled_squared_distance_cost ()  
Initializes the cost function.  
template<class CDT >  
boost::optional< typename CDT::Geom_traits::FT >  operator() (const Constrained_triangulation_plus_2< CDT > &pct, typename Constrained_triangulation_plus_2< CDT >::Vertices_in_constraint_iterator vicq) const 
Given a vertex in constraint iterator vicq computes vicp=std::prev(vicq) and vicr=std::next(vicq) , returns the maximum of the square distances between each point along the original subpolyline between vicp and vicr , and the straight line segment from *vicp>point() to *vicr>point() divided by the shortest squared distance between that segment and each of the vertices adjacent to vicq . More...  
boost::optional<typename CDT::Geom_traits::FT> CGAL::Polyline_simplification_2::Scaled_squared_distance_cost::operator()  (  const Constrained_triangulation_plus_2< CDT > &  pct, 
typename Constrained_triangulation_plus_2< CDT >::Vertices_in_constraint_iterator  vicq  
)  const 
Given a vertex in constraint iterator vicq
computes vicp=std::prev(vicq)
and vicr=std::next(vicq)
, returns the maximum of the square distances between each point along the original subpolyline between vicp
and vicr
, and the straight line segment from *vicp>point() to *vicr>point()
divided by the shortest squared distance between that segment and each of the vertices adjacent to vicq
.
CDT  must be CGAL::Constrained_Delaunay_triangulation_2 with a vertex type that is model of PolylineSimplificationVertexBase_2 . 