From 0b91007fa6b7e9b24b0df91801cf5d6d2cbec942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 4 Nov 2023 17:41:17 +0100 Subject: [PATCH] make node members public --- graph.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/graph.hpp b/graph.hpp index 632e507..16ccd00 100644 --- a/graph.hpp +++ b/graph.hpp @@ -90,6 +90,11 @@ public: /** @return The array of ids of the neighbors of this node. **/ std::vector const & neighbors() const; +public: + NodeId matched_neighbor {invalid_node_id}; + NodeId ear_or_root_neighbor {invalid_node_id}; + NodeId root_of_ear_component {invalid_node_id}; + private: // This allows each Graph to access private members of this class, // in our case the add_neighbor function @@ -104,9 +109,6 @@ private: void add_neighbor(NodeId const id); std::vector _neighbors; - NodeId _matched_neighbor {invalid_node_id}; - NodeId _ear_or_root_neighbor {invalid_node_id}; - NodeId _root_of_ear_component {invalid_node_id}; }; // class Node /** @@ -228,19 +230,19 @@ Node const & Graph::node(NodeId const id) const inline NodeId Graph::matched_neighbor(NodeId const id) const { - return _nodes[id]._matched_neighbor; + return _nodes[id].matched_neighbor; } inline NodeId Graph::ear_or_root_neighbor(const ED::NodeId id) const { - return _nodes[id]._ear_or_root_neighbor; + return _nodes[id].ear_or_root_neighbor; } inline NodeId Graph::root_of_ear_component(const ED::NodeId id) const { - return _nodes[id]._root_of_ear_component; + return _nodes[id].root_of_ear_component; } } // namespace ED