23 #ifndef GUDHI_EDGE_LENGTH_COST_H_
24 #define GUDHI_EDGE_LENGTH_COST_H_
26 #include "Cost_policy.h"
30 namespace contraction {
38 typedef typename Cost_policy<EdgeProfile>::Cost_type Cost_type;
39 typedef typename EdgeProfile::Point Point;
40 Cost_type operator()(
const EdgeProfile& profile,
const boost::optional<Point>& placement)
const override{
42 auto p0_coord = profile.p0().begin();
43 auto p1_coord = profile.p1().begin();
44 for(; p0_coord != profile.p0().end(); p0_coord++, p1_coord++){
45 res += (*p0_coord - *p1_coord) * (*p0_coord - *p1_coord);
Policy to specify the cost of contracting an edge.
Definition: Cost_policy.h:36
return a cost corresponding to the squared length of the edge
Definition: Edge_length_cost.h:36