diff --git a/cpp/mwmatching.h b/cpp/mwmatching.h index 4abcd22..b32a9e3 100644 --- a/cpp/mwmatching.h +++ b/cpp/mwmatching.h @@ -482,12 +482,10 @@ struct MatchingContext /** Count the number of vertices in the graph. */ static VertexId count_num_vertex(const std::vector& edges) { - const VertexId max_num_vertex = std::numeric_limits::max(); - VertexId num_vertex = 0; for (const Edge& edge : edges) { VertexId m = std::max(edge.vt.first, edge.vt.second); - assert(m < max_num_vertex); + assert(m < std::numeric_limits::max()); num_vertex = std::max(num_vertex, m + 1); } @@ -1840,7 +1838,7 @@ struct MatchingContext // Count the number of vertices inside this blossom. VertexId blossom_num_vertex = 0; for_vertices_in_blossom(blossom, - [&blossom_num_vertex](VertexId x) { + [&blossom_num_vertex](VertexId) { ++blossom_num_vertex; }); @@ -2070,10 +2068,8 @@ template std::vector> adjust_weights_for_maximum_cardinality_matching( const std::vector>& edges_in) { - const WeightType min_safe_weight = - std::numeric_limits::min() / 4; - const WeightType max_safe_weight = - std::numeric_limits::max() / 4; + const WeightType min_safe_weight = std::numeric_limits::min() / 4; + const WeightType max_safe_weight = std::numeric_limits::max() / 4; // Copy edges. std::vector> edges(edges_in); @@ -2086,7 +2082,7 @@ std::vector> adjust_weights_for_maximum_cardinality_matching( // Count number of vertices. // Determine minimum and maximum edge weight. VertexId num_vertex = 0; - WeightType min_weight = edges.first().weight; + WeightType min_weight = edges.front().weight; WeightType max_weight = min_weight; const VertexId max_num_vertex = std::numeric_limits::max();