diff --git a/alib2data/src/graph/directed/AdjacencyListDirectedGraph.cpp b/alib2data/src/graph/directed/AdjacencyListDirectedGraph.cpp index b0f41f710fae8dbe68c930b1bda99f038e190a3f..c665d665fe18970d0522dd93cdcdd95727094370 100644 --- a/alib2data/src/graph/directed/AdjacencyListDirectedGraph.cpp +++ b/alib2data/src/graph/directed/AdjacencyListDirectedGraph.cpp @@ -27,58 +27,7 @@ inline void listRemoveOne(std::list<T> &lst, const T &item) lst.erase(std::find(lst.begin(), lst.end(), item)); } -AdjacencyListDirectedGraph::AdjacencyListDirectedGraph() - - : DirectedGraph() -{ -} - -AdjacencyListDirectedGraph::~AdjacencyListDirectedGraph() noexcept -{ -} - -AdjacencyListDirectedGraph::AdjacencyListDirectedGraph( const AdjacencyListDirectedGraph & orig ) - - : DirectedGraph( orig ) - , succ( orig.succ ) - , pred( orig.pred ) - , edges( orig.edges ) -{ -} - -AdjacencyListDirectedGraph::AdjacencyListDirectedGraph( AdjacencyListDirectedGraph && orig ) - - : DirectedGraph( orig ) - , succ( std::move( orig.succ ) ) - , pred( std::move( orig.pred ) ) - , edges( std::move( orig.edges ) ) -{ -} - -AdjacencyListDirectedGraph & AdjacencyListDirectedGraph::operator=( const AdjacencyListDirectedGraph & orig ) -{ - if (this == &orig) - return *this; - - DirectedGraph::operator=( orig ); - this->succ = orig.succ; - this->pred = orig.pred; - this->edges = orig.edges; - - return *this; -} - -AdjacencyListDirectedGraph & AdjacencyListDirectedGraph::operator=( AdjacencyListDirectedGraph && orig ) -{ - if (this == &orig) - return *this; - - DirectedGraph::operator=( orig ); - this->succ = std::move( orig.succ ); - this->pred = std::move( orig.pred ); - this->edges = std::move( orig.edges ); - - return *this; +AdjacencyListDirectedGraph::AdjacencyListDirectedGraph() : DirectedGraph() { } AdjacencyListDirectedGraph::AdjacencyListDirectedGraph( const DirectedGraph & graph ) diff --git a/alib2data/src/graph/directed/AdjacencyListDirectedGraph.h b/alib2data/src/graph/directed/AdjacencyListDirectedGraph.h index a6367dedfbccfdb1579ecbdd22d3ea3533ec212d..9fefb9640657cc9c5cc841e951f97c89af8f722c 100644 --- a/alib2data/src/graph/directed/AdjacencyListDirectedGraph.h +++ b/alib2data/src/graph/directed/AdjacencyListDirectedGraph.h @@ -38,12 +38,6 @@ class AdjacencyListDirectedGraph : public DirectedGraph { public: AdjacencyListDirectedGraph(); - virtual ~AdjacencyListDirectedGraph() noexcept; - - AdjacencyListDirectedGraph( const AdjacencyListDirectedGraph & orig ); - AdjacencyListDirectedGraph( AdjacencyListDirectedGraph && orig ); - AdjacencyListDirectedGraph & operator=( const AdjacencyListDirectedGraph & orig ); - AdjacencyListDirectedGraph & operator=( AdjacencyListDirectedGraph && orig ); /// constructs an directed adjacency list from any representation of directed graph AdjacencyListDirectedGraph( const DirectedGraph & graph ); diff --git a/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.cpp b/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.cpp index 194e245b0e0b878b4471985db12083f2dbcf3291..130c858dc6bb25482d0cbb37686bbab3ea39ae02 100644 --- a/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.cpp +++ b/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.cpp @@ -21,61 +21,14 @@ namespace graph { -AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph() - - : DirectedGraph() -{ -} - -AdjacencyMatrixDirectedGraph::~AdjacencyMatrixDirectedGraph() noexcept -{ -} - -AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph( const AdjacencyMatrixDirectedGraph & orig ) - - : DirectedGraph( orig ) - , adj( orig.adj ) - , edges( orig.edges ) -{ -} - -AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph( AdjacencyMatrixDirectedGraph && orig ) - - : DirectedGraph( orig ) - , adj( std::move( orig.adj ) ) - , edges( std::move( orig.edges ) ) -{ +AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph() : DirectedGraph() { } -AdjacencyMatrixDirectedGraph & AdjacencyMatrixDirectedGraph::operator=( const AdjacencyMatrixDirectedGraph & orig ) -{ - if (this == &orig) - return *this; - - this->adj = orig.adj; - this->edges = orig.edges; - - return *this; -} - -AdjacencyMatrixDirectedGraph & AdjacencyMatrixDirectedGraph::operator=( AdjacencyMatrixDirectedGraph && orig ) -{ - if (this == &orig) - return *this; - - this->adj = std::move( orig.adj ); - this->edges = std::move( orig.edges ); - - return *this; -} - -AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph( const DirectedGraph & graph ) -{ +AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph( const DirectedGraph & graph ) { DirectedGraph::fromDirected( graph ); } -AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph( const UndirectedGraph & ugraph ) -{ +AdjacencyMatrixDirectedGraph::AdjacencyMatrixDirectedGraph( const UndirectedGraph & ugraph ) { DirectedGraph::fromUndirected( ugraph ); } diff --git a/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.h b/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.h index 6631a9005a1a4bae32b9656ff16a6002230be629..a33a25f5b191da40c6bc3d5804426391783800f3 100644 --- a/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.h +++ b/alib2data/src/graph/directed/AdjacencyMatrixDirectedGraph.h @@ -42,12 +42,6 @@ class AdjacencyMatrixDirectedGraph : public DirectedGraph { public: AdjacencyMatrixDirectedGraph(); - virtual ~AdjacencyMatrixDirectedGraph() noexcept; - - AdjacencyMatrixDirectedGraph( const AdjacencyMatrixDirectedGraph & orig ); - AdjacencyMatrixDirectedGraph( AdjacencyMatrixDirectedGraph && orig ); - AdjacencyMatrixDirectedGraph & operator=( const AdjacencyMatrixDirectedGraph & orig ); - AdjacencyMatrixDirectedGraph & operator=( AdjacencyMatrixDirectedGraph && orig ); /// constructs an directed adjacency matrix from any representation of directed graph AdjacencyMatrixDirectedGraph( const DirectedGraph & graph ); diff --git a/alib2data/src/graph/directed/DirectedGraph.cpp b/alib2data/src/graph/directed/DirectedGraph.cpp index 82e6398e2a1dfb6741bc0dbb11a95d71644231bf..11859b97f79ea11c08dc32db218fae8674d953c1 100644 --- a/alib2data/src/graph/directed/DirectedGraph.cpp +++ b/alib2data/src/graph/directed/DirectedGraph.cpp @@ -25,53 +25,9 @@ namespace graph { -DirectedGraph::DirectedGraph() -{ -} - -DirectedGraph::~DirectedGraph() noexcept -{ +DirectedGraph::DirectedGraph() { } -DirectedGraph::DirectedGraph( const DirectedGraph & orig ) - - : nodeValues( orig.nodeValues ) - , edgeValues( orig.edgeValues ) - , embedding( orig.embedding ) -{ -} - -DirectedGraph::DirectedGraph( DirectedGraph && orig ) noexcept - - : nodeValues( std::move( orig.nodeValues ) ) - , edgeValues( std::move( orig.edgeValues ) ) - , embedding( std::move( orig.embedding ) ) -{ -} - -DirectedGraph & DirectedGraph::operator=( const DirectedGraph & orig ) -{ - if (this == &orig) - return *this; - - nodeValues = orig.nodeValues; - edgeValues = orig.edgeValues; - embedding = orig.embedding; - - return *this; -} - -DirectedGraph & DirectedGraph::operator=( DirectedGraph && orig ) noexcept -{ - if (this == &orig) - return *this; - - nodeValues = std::move( orig.nodeValues ); - edgeValues = std::move( orig.edgeValues ); - embedding = std::move( orig.embedding ); - - return *this; -} void DirectedGraph::fromDirected( const DirectedGraph & orig ) { int value; diff --git a/alib2data/src/graph/directed/DirectedGraph.h b/alib2data/src/graph/directed/DirectedGraph.h index 6785a0d16e826f7df67d9e510396f65f595d735f..98a93aa092b8c889d3e9860d14b6563ff079cd69 100644 --- a/alib2data/src/graph/directed/DirectedGraph.h +++ b/alib2data/src/graph/directed/DirectedGraph.h @@ -28,12 +28,6 @@ class DirectedGraph : public GraphBase { public: DirectedGraph(); - virtual ~DirectedGraph() noexcept; - - DirectedGraph( const DirectedGraph & orig ); - DirectedGraph( DirectedGraph && orig ) noexcept; - DirectedGraph & operator=( const DirectedGraph & orig ); - DirectedGraph & operator=( DirectedGraph && orig ) noexcept; virtual GRAPH_TYPE getType() const override; virtual REPRESENTATION getRepresentation() const override = 0 ; diff --git a/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.cpp b/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.cpp index 071bbee0b7370f84809b12aaa252c744f40249e5..e4266c1e0ba78ba7b2953d9fda8a3712028c6e99 100644 --- a/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.cpp +++ b/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.cpp @@ -21,73 +21,22 @@ namespace graph { -AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph() - - : UndirectedGraph() -{ -} - -AdjacencyListUndirectedGraph::~AdjacencyListUndirectedGraph() noexcept -{ -} - -AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph( const AdjacencyListUndirectedGraph & orig ) - - : UndirectedGraph( orig ) - , adj( orig.adj ) - , edges( orig.edges ) -{ +AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph() : UndirectedGraph() { } -AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph( AdjacencyListUndirectedGraph && orig ) - - : UndirectedGraph( orig ) - , adj( std::move( orig.adj ) ) - , edges( std::move( orig.edges ) ) -{ -} - -AdjacencyListUndirectedGraph & AdjacencyListUndirectedGraph::operator=( const AdjacencyListUndirectedGraph & orig ) -{ - if (this == &orig) - return *this; - - UndirectedGraph::operator=( orig ); - this->adj = orig.adj; - this->edges = orig.edges; - - return *this; -} - -AdjacencyListUndirectedGraph & AdjacencyListUndirectedGraph::operator=( AdjacencyListUndirectedGraph && orig ) -{ - if (this == &orig) - return *this; - - UndirectedGraph::operator=( orig ); - this->adj = orig.adj; - this->edges = orig.edges; - - return *this; -} - -AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph( const UndirectedGraph & graph ) -{ +AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph( const UndirectedGraph & graph ) { UndirectedGraph::fromUndirected( graph ); } -AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph( const DirectedGraph & dgraph ) -{ +AdjacencyListUndirectedGraph::AdjacencyListUndirectedGraph( const DirectedGraph & dgraph ) { UndirectedGraph::fromDirected( dgraph ); } -GraphBase * AdjacencyListUndirectedGraph::clone() const -{ +GraphBase * AdjacencyListUndirectedGraph::clone() const { return new AdjacencyListUndirectedGraph( *this ); } -GraphBase * AdjacencyListUndirectedGraph::plunder() && -{ +GraphBase * AdjacencyListUndirectedGraph::plunder() && { return new AdjacencyListUndirectedGraph( std::move( *this ) ); } diff --git a/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.h b/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.h index 7537c4d48b39a7f0cb8d353e0b442eb3795ff421..71adfad12fb5e1b917a196384da60ec4eec07f30 100644 --- a/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.h +++ b/alib2data/src/graph/undirected/AdjacencyListUndirectedGraph.h @@ -41,12 +41,6 @@ class AdjacencyListUndirectedGraph : public UndirectedGraph { public: AdjacencyListUndirectedGraph(); - virtual ~AdjacencyListUndirectedGraph() noexcept; - - AdjacencyListUndirectedGraph( const AdjacencyListUndirectedGraph & orig ); - AdjacencyListUndirectedGraph( AdjacencyListUndirectedGraph && orig ); - AdjacencyListUndirectedGraph & operator=( const AdjacencyListUndirectedGraph & orig ); - AdjacencyListUndirectedGraph & operator=( AdjacencyListUndirectedGraph && orig ); /// constructs an undirected adjacency list from any representation of undirected graph AdjacencyListUndirectedGraph( const UndirectedGraph & graph ); diff --git a/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.cpp b/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.cpp index 0cc4ee2ad7e6c8cf62df3a39ce9e1f455c717236..1fcd0ecbff1bd62b36137bf87fae415826611f4f 100644 --- a/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.cpp +++ b/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.cpp @@ -21,73 +21,22 @@ namespace graph { -AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph() - - : UndirectedGraph() -{ -} - -AdjacencyMatrixUndirectedGraph::~AdjacencyMatrixUndirectedGraph() noexcept -{ -} - -AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph( const AdjacencyMatrixUndirectedGraph & orig ) - - : UndirectedGraph( orig ) - , adj( orig.adj ) - , edges( orig.edges ) -{ +AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph() : UndirectedGraph() { } -AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph( AdjacencyMatrixUndirectedGraph && orig ) - - : UndirectedGraph( orig ) - , adj( std::move( orig.adj ) ) - , edges( std::move( orig.edges ) ) -{ -} - -AdjacencyMatrixUndirectedGraph & AdjacencyMatrixUndirectedGraph::operator=( const AdjacencyMatrixUndirectedGraph & orig ) -{ - if (this == &orig) - return *this; - - UndirectedGraph::operator=( orig ); - this->adj = orig.adj; - this->edges = orig.edges; - - return *this; -} - -AdjacencyMatrixUndirectedGraph & AdjacencyMatrixUndirectedGraph::operator=( AdjacencyMatrixUndirectedGraph && orig ) -{ - if (this == &orig) - return *this; - - UndirectedGraph::operator=( orig ); - this->adj = std::move( orig.adj ); - this->edges = std::move( orig.edges ); - - return *this; -} - -AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph( const UndirectedGraph & graph ) -{ +AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph( const UndirectedGraph & graph ) { UndirectedGraph::fromUndirected( graph ); } -AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph( const DirectedGraph & dgraph ) -{ +AdjacencyMatrixUndirectedGraph::AdjacencyMatrixUndirectedGraph( const DirectedGraph & dgraph ) { UndirectedGraph::fromDirected( dgraph ); } -GraphBase * AdjacencyMatrixUndirectedGraph::clone() const -{ +GraphBase * AdjacencyMatrixUndirectedGraph::clone() const { return new AdjacencyMatrixUndirectedGraph( *this ); } -GraphBase * AdjacencyMatrixUndirectedGraph::plunder() && -{ +GraphBase * AdjacencyMatrixUndirectedGraph::plunder() && { return new AdjacencyMatrixUndirectedGraph( std::move( *this ) ); } diff --git a/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.h b/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.h index 8b72bb6fd0e25af59e17c8f83c4dffffb5df9880..778bd684a7b712c98e2c473b5bb8a2e79985c668 100644 --- a/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.h +++ b/alib2data/src/graph/undirected/AdjacencyMatrixUndirectedGraph.h @@ -44,12 +44,6 @@ class AdjacencyMatrixUndirectedGraph : public UndirectedGraph { public: AdjacencyMatrixUndirectedGraph(); - virtual ~AdjacencyMatrixUndirectedGraph() noexcept; - - AdjacencyMatrixUndirectedGraph( const AdjacencyMatrixUndirectedGraph & orig ); - AdjacencyMatrixUndirectedGraph( AdjacencyMatrixUndirectedGraph && orig ); - AdjacencyMatrixUndirectedGraph & operator=( const AdjacencyMatrixUndirectedGraph & orig ); - AdjacencyMatrixUndirectedGraph & operator=( AdjacencyMatrixUndirectedGraph && orig ); /// constructs an undirected adjacency matrix from any representation of undirected graph AdjacencyMatrixUndirectedGraph( const UndirectedGraph & graph ); diff --git a/alib2data/src/graph/undirected/UndirectedGraph.cpp b/alib2data/src/graph/undirected/UndirectedGraph.cpp index 2eb52bf99ab64cde337061e00f369e2173edb84b..46807fb29c2cd8743cdeda0d9007bd0b6229f26a 100644 --- a/alib2data/src/graph/undirected/UndirectedGraph.cpp +++ b/alib2data/src/graph/undirected/UndirectedGraph.cpp @@ -26,52 +26,7 @@ namespace graph { -UndirectedGraph::UndirectedGraph() -{ -} - -UndirectedGraph::~UndirectedGraph() noexcept -{ -} - -UndirectedGraph::UndirectedGraph( const UndirectedGraph & orig ) - - : nodeValues( orig.nodeValues ) - , edgeValues( orig.edgeValues ) - , embedding( orig.embedding ) -{ -} - -UndirectedGraph::UndirectedGraph( UndirectedGraph && orig ) noexcept - - : nodeValues( std::move( orig.nodeValues ) ) - , edgeValues( std::move( orig.edgeValues ) ) - , embedding( std::move( orig.embedding ) ) -{ -} - -UndirectedGraph & UndirectedGraph::operator=( const UndirectedGraph & orig ) -{ - if (this == &orig) - return *this; - - this->nodeValues = orig.nodeValues; - this->edgeValues = orig.edgeValues; - this->embedding = orig.embedding; - - return *this; -} - -UndirectedGraph & UndirectedGraph::operator=( UndirectedGraph && orig ) noexcept -{ - if (this == &orig) - return *this; - - this->nodeValues = std::move( orig.nodeValues ); - this->edgeValues = std::move( orig.edgeValues ); - this->embedding = std::move( orig.embedding ); - - return *this; +UndirectedGraph::UndirectedGraph() { } GRAPH_TYPE UndirectedGraph::getType() const diff --git a/alib2data/src/graph/undirected/UndirectedGraph.h b/alib2data/src/graph/undirected/UndirectedGraph.h index 18e2197729d91bbc48ad0bf1249714b1a6712a06..2bb99b472a5ec20c55474efa020fd66bbfde11dc 100644 --- a/alib2data/src/graph/undirected/UndirectedGraph.h +++ b/alib2data/src/graph/undirected/UndirectedGraph.h @@ -28,12 +28,6 @@ class UndirectedGraph : public GraphBase { public: UndirectedGraph(); - virtual ~UndirectedGraph() noexcept; - - UndirectedGraph( const UndirectedGraph & orig ); - UndirectedGraph( UndirectedGraph && orig ) noexcept; - UndirectedGraph & operator=( const UndirectedGraph & orig ); - UndirectedGraph & operator=( UndirectedGraph && orig ) noexcept; virtual GRAPH_TYPE getType() const override; virtual REPRESENTATION getRepresentation() const override = 0;