-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First Recompile with node and Edge package Reorganized Signed-off-by: ZigRazor <zigrazor@gmail.com> * Reorganized Graph Class * Moved PartitionGraph function as a static function of the Partitioner Class * Some Include Optimizzation * Little Modification Signed-off-by: ZigRazor <zigrazor@gmail.com> * Corrected some static analisys errors Signed-off-by: ZigRazor <zigrazor@gmail.com> * Corrected an issue for input/output test Signed-off-by: ZigRazor <zigrazor@gmail.com> --------- Signed-off-by: ZigRazor <zigrazor@gmail.com>
- Loading branch information
Showing
64 changed files
with
5,698 additions
and
4,642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/***********************************************************/ | ||
/*** ______ ____ ______ _ ***/ | ||
/*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/ | ||
/*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/ | ||
/*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/ | ||
/*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/ | ||
/*** |_| ***/ | ||
/***********************************************************/ | ||
/*** Header-Only C++ Library for Graph ***/ | ||
/*** Representation and Algorithms ***/ | ||
/***********************************************************/ | ||
/*** Author: ZigRazor ***/ | ||
/*** E-Mail: zigrazor@gmail.com ***/ | ||
/***********************************************************/ | ||
/*** Collaboration: ----------- ***/ | ||
/***********************************************************/ | ||
/*** License: AGPL v3.0 ***/ | ||
/***********************************************************/ | ||
|
||
#ifndef __CXXGRAPH_DIRECTEDEDGE_H__ | ||
#define __CXXGRAPH_DIRECTEDEDGE_H__ | ||
|
||
#pragma once | ||
|
||
#include "DirectedEdge_impl.hpp" | ||
|
||
#endif // __CXXGRAPH_DIRECTEDEDGE_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/***********************************************************/ | ||
/*** ______ ____ ______ _ ***/ | ||
/*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/ | ||
/*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/ | ||
/*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/ | ||
/*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/ | ||
/*** |_| ***/ | ||
/***********************************************************/ | ||
/*** Header-Only C++ Library for Graph ***/ | ||
/*** Representation and Algorithms ***/ | ||
/***********************************************************/ | ||
/*** Author: ZigRazor ***/ | ||
/*** E-Mail: zigrazor@gmail.com ***/ | ||
/***********************************************************/ | ||
/*** Collaboration: ----------- ***/ | ||
/***********************************************************/ | ||
/*** License: AGPL v3.0 ***/ | ||
/***********************************************************/ | ||
|
||
#ifndef __CXXGRAPH_DIRECTEDEDGE_DECL_H__ | ||
#define __CXXGRAPH_DIRECTEDEDGE_DECL_H__ | ||
|
||
#pragma once | ||
|
||
#include "Edge_decl.h" | ||
|
||
namespace CXXGraph { | ||
// Smart pointers alias | ||
template <typename T> | ||
using unique = std::unique_ptr<T>; | ||
template <typename T> | ||
using shared= std::shared_ptr<T>; | ||
|
||
template <typename T> | ||
class UndirectedEdge; | ||
|
||
template <typename T> | ||
class DirectedEdge; | ||
// ostream operator | ||
template <typename T> | ||
std::ostream &operator<<(std::ostream &o, const DirectedEdge<T> &edge); | ||
template <typename T> | ||
class DirectedEdge : public Edge<T> { | ||
public: | ||
DirectedEdge(const CXXGraph::id_t id, const Node<T> &node1, | ||
const Node<T> &node2); | ||
DirectedEdge(const CXXGraph::id_t id, shared<const Node<T>> node1, | ||
shared<const Node<T>> node2); | ||
DirectedEdge(const CXXGraph::id_t id, | ||
const std::pair<const Node<T> *, const Node<T> *> &nodepair); | ||
DirectedEdge(const CXXGraph::id_t id, | ||
const std::pair<shared<const Node<T>>, shared<const Node<T>>> &nodepair); | ||
DirectedEdge(const Edge<T> &edge); | ||
virtual ~DirectedEdge() = default; | ||
const Node<T> &getFrom() const; | ||
const Node<T> &getTo() const; | ||
const std::optional<bool> isDirected() const override; | ||
const std::optional<bool> isWeighted() const override; | ||
// operator | ||
explicit operator UndirectedEdge<T>() const { | ||
return UndirectedEdge<T>(Edge<T>::getId(), Edge<T>::getNodePair()); | ||
} | ||
|
||
friend std::ostream &operator<< <>(std::ostream &os, | ||
const DirectedEdge<T> &edge); | ||
}; | ||
} // namespace CXXGraph | ||
|
||
#endif // __CXXGRAPH_DIRECTEDEDGE_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/***********************************************************/ | ||
/*** ______ ____ ______ _ ***/ | ||
/*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/ | ||
/*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/ | ||
/*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/ | ||
/*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/ | ||
/*** |_| ***/ | ||
/***********************************************************/ | ||
/*** Header-Only C++ Library for Graph ***/ | ||
/*** Representation and Algorithms ***/ | ||
/***********************************************************/ | ||
/*** Author: ZigRazor ***/ | ||
/*** E-Mail: zigrazor@gmail.com ***/ | ||
/***********************************************************/ | ||
/*** Collaboration: ----------- ***/ | ||
/***********************************************************/ | ||
/*** License: AGPL v3.0 ***/ | ||
/***********************************************************/ | ||
#ifndef __CXXGRAPH_DIRECTEDWEIGHTEDEDGE_H__ | ||
#define __CXXGRAPH_DIRECTEDWEIGHTEDEDGE_H__ | ||
|
||
#pragma once | ||
|
||
#include "DirectedWeightedEdge_impl.hpp" | ||
|
||
#endif // __CXXGRAPH_DIRECTEDWEIGHTEDEDGE_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/***********************************************************/ | ||
/*** ______ ____ ______ _ ***/ | ||
/*** / ___\ \/ /\ \/ / ___|_ __ __ _ _ __ | |__ ***/ | ||
/*** | | \ / \ / | _| '__/ _` | '_ \| '_ \ ***/ | ||
/*** | |___ / \ / \ |_| | | | (_| | |_) | | | | ***/ | ||
/*** \____/_/\_\/_/\_\____|_| \__,_| .__/|_| |_| ***/ | ||
/*** |_| ***/ | ||
/***********************************************************/ | ||
/*** Header-Only C++ Library for Graph ***/ | ||
/*** Representation and Algorithms ***/ | ||
/***********************************************************/ | ||
/*** Author: ZigRazor ***/ | ||
/*** E-Mail: zigrazor@gmail.com ***/ | ||
/***********************************************************/ | ||
/*** Collaboration: ----------- ***/ | ||
/***********************************************************/ | ||
/*** License: AGPL v3.0 ***/ | ||
/***********************************************************/ | ||
#ifndef __CXXGRAPH_DIRECTEDWEIGHTEDEDGE_DECL_H__ | ||
#define __CXXGRAPH_DIRECTEDWEIGHTEDEDGE_DECL_H__ | ||
|
||
#pragma once | ||
|
||
#include "DirectedEdge_decl.h" | ||
#include "Weighted.h" | ||
|
||
namespace CXXGraph { | ||
// Smart pointers alias | ||
template <typename T> | ||
using unique = std::unique_ptr<T>; | ||
template <typename T> | ||
using shared= std::shared_ptr<T>; | ||
|
||
// Foward Declaration | ||
template <typename T> | ||
class UndirectedWeightedEdge; | ||
|
||
template <typename T> | ||
class DirectedWeightedEdge; | ||
|
||
// ostream operator | ||
template <typename T> | ||
std::ostream &operator<<(std::ostream &o, const DirectedWeightedEdge<T> &edge); | ||
|
||
template <typename T> | ||
class DirectedWeightedEdge : public DirectedEdge<T>, public Weighted { | ||
public: | ||
DirectedWeightedEdge(const CXXGraph::id_t id, const Node<T> &node1, | ||
const Node<T> &node2, const double weight); | ||
DirectedWeightedEdge(const CXXGraph::id_t id, shared<const Node<T>> node1, | ||
shared<const Node<T>> node2, const double weight); | ||
DirectedWeightedEdge( | ||
const CXXGraph::id_t id, | ||
const std::pair<const Node<T> *, const Node<T> *> &nodepair, | ||
const double weight); | ||
DirectedWeightedEdge( | ||
const CXXGraph::id_t id, | ||
const std::pair<shared<const Node<T>>, shared<const Node<T>>> &nodepair, | ||
const double weight); | ||
DirectedWeightedEdge(const DirectedEdge<T> &edge, const double weight); | ||
DirectedWeightedEdge(const Edge<T> &edge, const double weight); | ||
DirectedWeightedEdge(const DirectedEdge<T> &edge); | ||
DirectedWeightedEdge(const Edge<T> &edge); | ||
DirectedWeightedEdge(const UndirectedWeightedEdge<T> &edge); | ||
virtual ~DirectedWeightedEdge() = default; | ||
const std::optional<bool> isWeighted() const override; | ||
// operator | ||
explicit operator UndirectedWeightedEdge<T>() const { | ||
return UndirectedWeightedEdge<T>(Edge<T>::getId(), Edge<T>::getNodePair(), | ||
Weighted::getWeight()); | ||
} | ||
|
||
friend std::ostream &operator<< <>(std::ostream &os, | ||
const DirectedWeightedEdge<T> &edge); | ||
}; | ||
|
||
} // namespace CXXGraph | ||
|
||
#endif // __CXXGRAPH_DIRECTEDWEIGHTEDEDGE_DECL_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.