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
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Checks: >
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-slicing,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-use-default-member-init

CheckOptions:
Expand Down
4 changes: 4 additions & 0 deletions include/chinese/chinesePostman.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class PgrDirectedChPPGraph {

~PgrDirectedChPPGraph();

PgrDirectedChPPGraph(const PgrDirectedChPPGraph&) = delete;
PgrDirectedChPPGraph& operator=(const PgrDirectedChPPGraph&) = delete;
PgrDirectedChPPGraph(PgrDirectedChPPGraph&&) = delete;
PgrDirectedChPPGraph& operator=(PgrDirectedChPPGraph&&) = delete;

private:
bool EulerCircuitDFS(int64_t p);
Expand Down
5 changes: 5 additions & 0 deletions include/cpp_common/line_vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class Line_vertex {
target(v.target),
cost(v.cost) {}

Line_vertex& operator=(const Line_vertex&) = default;
Line_vertex(Line_vertex&&) = default;
Line_vertex& operator=(Line_vertex&&) = default;
~Line_vertex() = default;
Comment thread
Mohit242-bit marked this conversation as resolved.

void cp_members(const Line_vertex &other) {
this->id = other.id;
this->vertex_id = other.vertex_id;
Expand Down
7 changes: 5 additions & 2 deletions include/vrp/solution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ class Solution {

/* @brief copy assignment */
Solution& operator = (const Solution& sol) {
EPSILON = 0.0001,
EPSILON = 0.0001;
fleet = sol.fleet;
trucks = sol.trucks;
return *this;
};
}

/* @brief destructor */
~Solution() = default;
Comment thread
Mohit242-bit marked this conversation as resolved.


Initials_code get_kind() const;
Expand Down
5 changes: 5 additions & 0 deletions include/withPoints/withPoints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class Pg_points_graph : public Pgr_messages {
public:
Pg_points_graph() = delete;
Pg_points_graph(const Pg_points_graph &) = delete;
Pg_points_graph& operator=(const Pg_points_graph&) = delete;
Comment thread
Mohit242-bit marked this conversation as resolved.
Pg_points_graph(Pg_points_graph&&) = delete;
Pg_points_graph& operator=(Pg_points_graph&&) = delete;
~Pg_points_graph() = default;

Pg_points_graph(
std::vector<Point_on_edge_t> p_points,
std::vector<Edge_t> p_edges_to_modify,
Expand Down
23 changes: 17 additions & 6 deletions include/yen/ksp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#pragma once

#include <map>
#include <memory>
#include <sstream>
#include <deque>
#include <vector>
Expand Down Expand Up @@ -63,11 +64,15 @@ class Pgr_ksp : public Pgr_messages {
m_end(0),
m_K(0),
m_heap_paths(false),
m_vis(new Visitor) {
m_vis(std::make_unique<Visitor>()) {
}
~Pgr_ksp() {
delete m_vis;
}

~Pgr_ksp() = default;

Pgr_ksp(const Pgr_ksp&) = delete;
Pgr_ksp& operator=(const Pgr_ksp&) = delete;
Comment thread
Mohit242-bit marked this conversation as resolved.
Pgr_ksp(Pgr_ksp&&) = delete;
Pgr_ksp& operator=(Pgr_ksp&&) = delete;

std::deque<Path> Yen(
G &graph,
Expand Down Expand Up @@ -121,7 +126,13 @@ class Pgr_ksp : public Pgr_messages {

class Visitor {
public:
virtual ~Visitor() {}
virtual ~Visitor() = default;

Visitor() = default;
Visitor(const Visitor&) = delete;
Visitor& operator=(const Visitor&) = delete;
Comment thread
Mohit242-bit marked this conversation as resolved.
Visitor(Visitor&&) = delete;
Visitor& operator=(Visitor&&) = delete;

virtual void on_insert_first_solution(const Path) const {
/* noop */
Expand Down Expand Up @@ -239,7 +250,7 @@ class Pgr_ksp : public Pgr_messages {
pSet m_ResultSet; //!< ordered set of shortest paths
pSet m_Heap; //!< the heap

Visitor *m_vis;
std::unique_ptr<Visitor> m_vis;
};


Expand Down
4 changes: 2 additions & 2 deletions include/yen/turnRestrictedPath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <set>
#include <limits>
#include <cstdint>
#include <memory>

#include "yen/ksp.hpp"
#include "cpp_common/assert.hpp"
Expand Down Expand Up @@ -161,8 +162,7 @@ class Pgr_turnRestrictedPath : public Pgr_ksp< G > {
this->m_end = end_vertex;
this->m_K = K;
Pgr_ksp<G>::m_heap_paths = true;
delete this->m_vis;
this->m_vis = new Myvisitor(
this->m_vis = std::make_unique<Myvisitor>(
m_solutions,
m_restrictions,
m_stop_on_first);
Expand Down