Skip to content
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Checks: >
cppcoreguidelines-avoid-goto,
cppcoreguidelines-avoid-non-const-global-variables,
cppcoreguidelines-avoid-reference-coroutine-parameters,
cppcoreguidelines-interfaces-global-init,
cppcoreguidelines-rvalue-reference-param-not-moved,
cppcoreguidelines-init-variables,
cppcoreguidelines-prefer-member-initializer,
cppcoreguidelines-special-member-functions
Expand Down
9 changes: 4 additions & 5 deletions include/cpp_common/path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class Path {
std::deque< Path_t > path;
int64_t m_start_id;
int64_t m_end_id;
double m_tot_cost;
double m_tot_cost{0};

public:
Path(): m_start_id(0), m_end_id(0), m_tot_cost(0)
Path() : m_start_id(0), m_end_id(0)
{}
Path(int64_t s_id, int64_t e_id)
: m_start_id(s_id), m_end_id(e_id), m_tot_cost(0)
: m_start_id(s_id), m_end_id(e_id)
{}

int64_t start_id() const {return m_start_id;}
Expand Down Expand Up @@ -189,8 +189,7 @@ class Path {
const Path &original,
bool only_cost) :
m_start_id(original.m_start_id),
m_end_id(original.m_end_id),
m_tot_cost(0) {
m_end_id(original.m_end_id) {
if (original.path.empty()) return;

typename G::EO_i ei, ei_end;
Expand Down
2 changes: 1 addition & 1 deletion src/max_flow/minCostMaxFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ PgrCostFlowGraph::GetFlowEdges() const {
if (((capacity[*e] - residual_capacity[*e]) > 0) &&
((*e).m_source != supersource) &&
((*e).m_target != supersink)) {
Flow_t edge;
Flow_t edge{};
edge.edge = GetEdgeId(*e);
edge.source = GetVertexId((*e).m_source);
edge.target = GetVertexId((*e).m_target);
Expand Down