Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Checks: >
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-slicing,
-cppcoreguidelines-use-default-member-init
-cppcoreguidelines-slicing

CheckOptions:
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
Expand Down
8 changes: 3 additions & 5 deletions include/bdAstar/bdAstar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ class Pgr_bdAstar : public Pgr_bidirectional<G> {

public:
explicit Pgr_bdAstar(G &pgraph) :
Pgr_bidirectional<G>(pgraph),
m_heuristic(5),
m_factor(1.0) {
Pgr_bidirectional<G>(pgraph) {
m_log << "pgr_bdAstar constructor\n";
}

Expand Down Expand Up @@ -184,8 +182,8 @@ class Pgr_bdAstar : public Pgr_bidirectional<G> {
}

private:
int m_heuristic;
double m_factor;
int m_heuristic{5};
double m_factor{1.0};
};

} // namespace bidirectional
Expand Down
6 changes: 3 additions & 3 deletions include/chinese/chinesePostman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ class PgrDirectedChPPGraph {
void setPathEdges(graph::PgrCostFlowGraph &flowGraph);

private:
int64_t totalDeg;
double totalCost;
int64_t totalDeg{0};
double totalCost{0};
int64_t superSource, superTarget;
int64_t startPoint;
double m_cost;
Expand Down Expand Up @@ -110,7 +110,7 @@ PgrDirectedChPPGraph::~PgrDirectedChPPGraph() {
edgeToIdx.clear();
}
PgrDirectedChPPGraph::PgrDirectedChPPGraph(const std::vector<Edge_t> &dataEdges) :
totalDeg(0), totalCost(0), vertices(),
vertices(),
edgeToIdx(), originalEdges(),
resultGraph(), VToVecid(), edgeVisited(),
pathStack(), resultPath(),
Expand Down
5 changes: 2 additions & 3 deletions include/contraction/contractionGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
Prepares the _graph_ to be of type *directed*
*/
explicit Pgr_contractionGraph()
: Pgr_base_graph<G, CH_vertex, CH_edge, t_directed>(),
min_edge_id(0) {
: Pgr_base_graph<G, CH_vertex, CH_edge, t_directed>() {
}

/*! @brief get the vertex descriptors of adjacent vertices of *v*
Expand Down Expand Up @@ -548,7 +547,7 @@ class Pgr_contractionGraph : public Pgr_base_graph<G, CH_vertex, CH_edge, t_dire
}

private:
int64_t min_edge_id;
int64_t min_edge_id{0};
Identifiers<V> forbiddenVertices;
};

Expand Down
5 changes: 2 additions & 3 deletions include/cpp_common/bidirectional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ class Pgr_bidirectional {
public:
explicit Pgr_bidirectional(G &pgraph):
graph(pgraph),
INF((std::numeric_limits<double>::max)()),
best_cost(0) {
INF((std::numeric_limits<double>::max)()) {
m_log << "constructor\n";
}

Expand Down Expand Up @@ -222,7 +221,7 @@ class Pgr_bidirectional {

double INF; //!< infinity

double best_cost;
double best_cost{0};

mutable std::ostringstream m_log;
Priority_queue forward_queue;
Expand Down
3 changes: 1 addition & 2 deletions include/visitors/dijkstra_visitors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ class dijkstra_distance_visitor_no_init : public boost::default_dijkstra_visitor
std::vector<boost::default_color_type> &color_map) :
m_root(root),
m_distance_goal(distance_goal),
m_num_examined(0),
m_predecessors(predecessors),
m_dist(distances),
m_color(color_map) {
Expand Down Expand Up @@ -190,7 +189,7 @@ class dijkstra_distance_visitor_no_init : public boost::default_dijkstra_visitor
private:
V m_root;
double m_distance_goal;
size_t m_num_examined;
size_t m_num_examined{0};
std::vector<V > &m_predecessors;
std::vector<double> &m_dist;
std::vector<boost::default_color_type> &m_color;
Expand Down
4 changes: 1 addition & 3 deletions include/vrp/solution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Solution {
friend class Optimize;
friend class PD_problem;
protected:
double EPSILON;
double EPSILON{0.0001};
std::deque<Vehicle_pickDeliver> fleet;

/* this solution belongs to this problem*/
Expand All @@ -66,14 +66,12 @@ class Solution {

/* @brief copy constructor */
Solution(const Solution &sol) :
EPSILON(0.0001),
fleet(sol.fleet),
trucks(sol.trucks)
{};

/* @brief copy assignment */
Solution& operator = (const Solution& sol) {
EPSILON = 0.0001;
fleet = sol.fleet;
trucks = sol.trucks;
return *this;
Expand Down
12 changes: 4 additions & 8 deletions include/yen/ksp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ class Pgr_ksp : public Pgr_messages {

public:
Pgr_ksp() :
m_start(0),
m_end(0),
m_K(0),
m_heap_paths(false),
m_vis(std::make_unique<Visitor>()) {
}

Expand Down Expand Up @@ -240,10 +236,10 @@ class Pgr_ksp : public Pgr_messages {
///@{
V v_source; //!< source descriptor
V v_target; //!< target descriptor
int64_t m_start; //!< source id
int64_t m_end; //!< target id
size_t m_K;
bool m_heap_paths;
int64_t m_start{0}; //!< source id
int64_t m_end{0}; //!< target id
size_t m_K{0};
bool m_heap_paths{false};

Path curr_result_path; //!< storage for the current result

Expand Down
1 change: 0 additions & 1 deletion src/pickDeliver/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ Solution::get_kind() const {
}

Solution::Solution() :
EPSILON(0.0001),
trucks(problem->trucks()) {
ENTERING(msg());
for (const auto &t : trucks) {
Expand Down