File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
power_grid_model_c/power_grid_model/include/power_grid_model/optimizer Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,10 @@ struct TrafoGraphEdge {
50
50
Idx2D regulated_idx{};
51
51
EdgeWeight weight{};
52
52
53
+ constexpr TrafoGraphEdge () = default;
54
+ constexpr TrafoGraphEdge (Idx2D regulated_idx_, EdgeWeight weight_)
55
+ : regulated_idx{regulated_idx_}, weight{weight_} {}
56
+
53
57
bool operator ==(const TrafoGraphEdge& other) const {
54
58
return regulated_idx == other.regulated_idx && weight == other.weight ;
55
59
} // thanks boost
@@ -65,7 +69,7 @@ struct TrafoGraphEdge {
65
69
}
66
70
};
67
71
68
- constexpr TrafoGraphEdge unregulated_edge_prop = {unregulated_idx, 0 };
72
+ constexpr auto unregulated_edge_prop = TrafoGraphEdge {unregulated_idx, 0 };
69
73
using TrafoGraphEdges = std::vector<std::pair<TrafoGraphIdx, TrafoGraphIdx>>;
70
74
using TrafoGraphEdgeProperties = std::vector<TrafoGraphEdge>;
71
75
@@ -330,8 +334,7 @@ inline auto get_edge_weights(TransformerGraph const& graph) -> TrafoGraphEdgePro
330
334
" away from the source than the tap side.\n " );
331
335
}
332
336
if (!is_unreachable (edge_res)) {
333
- result.emplace_back (
334
- TrafoGraphEdge{graph[e].regulated_idx , edge_tgt_rank}); // NOLINT(clang-diagnostic-error, other-warning)
337
+ result.emplace_back (graph[e].regulated_idx , edge_tgt_rank);
335
338
}
336
339
}
337
340
You can’t perform that action at this time.
0 commit comments