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