From 176f4182fda45cd2c1ef2326881075cd9de2448c Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Fri, 28 Sep 2018 09:48:33 +0200 Subject: [PATCH] Add simple CSR graph class It is defined in view of ParMETIS use --- src/utils/CSRGraph.hpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/utils/CSRGraph.hpp diff --git a/src/utils/CSRGraph.hpp b/src/utils/CSRGraph.hpp new file mode 100644 index 000000000..1581a8528 --- /dev/null +++ b/src/utils/CSRGraph.hpp @@ -0,0 +1,40 @@ +#ifndef CSR_GRAPH_HPP +#define CSR_GRAPH_HPP + +#include <Array.hpp> + +class CSRGraph +{ + private: + Array<int> m_entries; + Array<int> m_neighbors; + + public: + const Array<int>& entries() const + { + return m_entries; + } + + const Array<int>& neighbors() const + { + return m_neighbors; + } + + CSRGraph& operator=(CSRGraph&&) = default; + CSRGraph& operator=(const CSRGraph&) = default; + + CSRGraph(Array<int> entries, + Array<int> neighbors) + : m_entries(entries), + m_neighbors(neighbors) + { + ; + } + + CSRGraph() = default; + CSRGraph(CSRGraph&&) = default; + CSRGraph(const CSRGraph&) = default; + ~CSRGraph() = default; +}; + +#endif // CSR_GRAPH_HPP -- GitLab