11 #ifndef CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_ 12 #define CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_ 14 #include <gudhi/Contraction/policies/Cost_policy.h> 18 namespace contraction {
23 template<
typename EdgeProfile>
26 typedef typename Cost_policy<EdgeProfile>::Cost_type Cost_type;
27 typedef typename EdgeProfile::Point Point;
29 Cost_type operator()(
const EdgeProfile& profile,
const boost::optional<Point>& placement)
const override {
31 auto p0_coord = profile.p0().begin();
32 auto p1_coord = profile.p1().begin();
33 for (; p0_coord != profile.p0().end(); p0_coord++, p1_coord++) {
34 res += (*p0_coord - *p1_coord) * (*p0_coord - *p1_coord);
44 #endif // CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_ Definition: SimplicialComplexForAlpha.h:14
Policy to specify the cost of contracting an edge.
Definition: Cost_policy.h:25
return a cost corresponding to the squared length of the edge
Definition: Edge_length_cost.h:24