25template<
typename TNode,
typename TEdge>
78 template<
typename ... Params>
85 template<
typename ... Params>
90 template<
typename ... Params>
115 std::string
name()
const override;
123template<
typename TNode,
typename TEdge>
125 return m_adjacency_list;
128template<
typename TNode,
typename TEdge>
130 return std::move(m_adjacency_list);
133template<
typename TNode,
typename TEdge>
138template<
typename TNode,
typename TEdge>
140 return std::move(m_succ_list);
143template<
typename TNode,
typename TEdge>
148template<
typename TNode,
typename TEdge>
150 return std::move(m_pred_list);
155template<
typename TNode,
typename TEdge>
162template<
typename TNode,
typename TEdge>
166 m_pred_list[std::forward<TNode>(n)];
169template<
typename TNode,
typename TEdge>
170template<
typename... Params>
172 addNode(TNode(std::forward<Params>(params) ...));
177template<
typename TNode,
typename TEdge>
179 auto search_succ = m_succ_list.find(e.first);
180 auto search_pred = m_pred_list.find(e.first);
182 if (search_succ != m_succ_list.end() && search_succ->second.find(e.second) != search_succ->second.end()) {
184 }
else if (search_pred != m_pred_list.end() && search_pred->second.find(e.second) != search_pred->second.end()) {
189 if (m_adjacency_list.find(e.first) != m_adjacency_list.end()
190 && m_adjacency_list[e.first].find(e.second) != m_adjacency_list[e.first].end()) {
202template<
typename TNode,
typename TEdge>
204 auto search_succ = m_succ_list.find(e.first);
205 auto search_pred = m_pred_list.find(e.first);
207 if (search_succ != m_succ_list.end() && search_succ->second.find(e.second) != search_succ->second.end()) {
209 }
else if (search_pred != m_pred_list.end() && search_pred->second.find(e.second) != search_pred->second.end()) {
214 if (m_adjacency_list.find(e.first) != m_adjacency_list.end()
215 && m_adjacency_list[e.first].find(e.second) != m_adjacency_list[e.first].end()) {
222 m_adjacency_list[e.second].insert(
ext::make_pair(e.first, std::forward<TEdge>(e)));
227template<
typename TNode,
typename TEdge>
228template<
typename... Params>
230 return addEdge(TEdge(std::forward<Params>(params) ...));
233template<
typename TNode,
typename TEdge>
236 if (m_adjacency_list.find(e.first) != m_adjacency_list.end()
237 && m_adjacency_list[e.first].find(e.second) != m_adjacency_list[e.first].end()) {
242 auto search_succ = m_succ_list.find(e.first);
243 if (search_succ != m_succ_list.end() && search_succ->second.find(e.second) != search_succ->second.end()) {
255template<
typename TNode,
typename TEdge>
258 if (m_adjacency_list.find(e.first) != m_adjacency_list.end()
259 && m_adjacency_list[e.first].find(e.second) != m_adjacency_list[e.first].end()) {
264 auto search_succ = m_succ_list.find(e.first);
265 if (search_succ != m_succ_list.end() && search_succ->second.find(e.second) != search_succ->second.end()) {
272 m_pred_list[e.second].insert(
ext::make_pair(e.first, std::forward<TEdge>(e)));
277template<
typename TNode,
typename TEdge>
278template<
typename... Params>
280 return addArc(TEdge(std::forward<Params>(params)...));
285template<
typename TNode,
typename TEdge>
287 return m_adjacency_list.size();
289template<
typename TNode,
typename TEdge>
293 for (
const auto &
i: m_adjacency_list) {
294 cnt +=
i.second.size();
299 for (
const auto &
i: m_succ_list) {
300 cnt +=
i.second.size();
308template<
typename TNode,
typename TEdge>
312 for (
const auto &
i: m_adjacency_list) {
319template<
typename TNode,
typename TEdge>
323 for (
const auto &
i: m_adjacency_list) {
324 for (
const auto &j :
i.second) {
325 vec.push_back(j.second);
329 for (
const auto &
i: m_succ_list) {
330 for (
const auto &j :
i.second) {
331 vec.push_back(j.second);
340template<
typename TNode,
typename TEdge>
344 if (m_adjacency_list.count(n) == 0) {
348 for (
const auto &
i: m_adjacency_list.at(n)) {
352 for (
const auto &
i: m_succ_list.at(n)) {
359template<
typename TNode,
typename TEdge>
363 if (m_succ_list.count(n) == 0) {
367 for (
const auto &
i: m_adjacency_list.at(n)) {
368 vec.push_back(
i.second);
371 for (
const auto &
i: m_succ_list.at(n)) {
372 vec.push_back(
i.second);
378template<
typename TNode,
typename TEdge>
382 if (m_pred_list.count(n) == 0) {
386 for (
const auto &
i: m_adjacency_list.at(n)) {
390 for (
const auto &
i: m_pred_list.at(n)) {
397template<
typename TNode,
typename TEdge>
401 if (m_pred_list.count(n) == 0) {
405 for (
const auto &
i: m_adjacency_list.at(n)) {
406 vec.push_back(
i.second);
409 for (
const auto &
i: m_pred_list.at(n)) {
410 vec.push_back(
i.second);
418template<
typename TNode,
typename TEdge>
425template<
typename TNode,
typename TEdge>
427 ostream <<
"(" << name() <<
" ";
428 for (
const auto &
i : m_adjacency_list) {
429 ostream <<
i.first <<
" <-->" << std::endl;
431 for (
const auto &j :
i.second) {
432 ostream <<
"\t\t" << j.first <<
" " << j.second << std::endl;
435 ostream <<
i.first <<
" -->" << std::endl;
436 for (
const auto &j : m_succ_list.at(
i.first)) {
437 ostream <<
"\t\t" << j.first <<
" " << j.second << std::endl;
457template<
typename TNode,
typename TEdge>
465 for (
auto &&j:
i.second) {
469 graph.addNode(first);
478 for (
auto &&j:
i.second) {
482 graph.addNode(first);
491 for (
auto &&j:
i.second) {
495 graph.addNode(first);
Class extending the map class from the standard library. Original reason is to allow printing of the ...
Definition: map.hpp:48
Class extending the pair class from the standard library. Original reason is to allow printing of the...
Definition: pair.hpp:43
Class extending the vector class from the standard library. Original reason is to allow printing of t...
Definition: vector.hpp:45
Definition: GraphInterface.hpp:19
TEdge edge_type
Definition: GraphInterface.hpp:23
TNode node_type
Definition: GraphInterface.hpp:22
static DefaultNodeType normalizeNode(TNode &&node)
Definition: Normalize.hpp:47
static DefaultEdgeType normalizeEdge(TEdge &&edge)
Definition: Normalize.hpp:52
Definition: MixedGraph.hpp:26
bool addArc(TEdge &&e)
Definition: MixedGraph.hpp:256
std::string name() const override
Definition: MixedGraph.hpp:419
bool addArc(Params &&... params)
Definition: MixedGraph.hpp:279
ext::map< TNode, ext::map< TNode, TEdge > > m_succ_list
Definition: MixedGraph.hpp:39
ext::vector< TEdge > getEdges() const override
Definition: MixedGraph.hpp:320
size_t nodeCount() const override
Definition: MixedGraph.hpp:286
void operator>>(ext::ostream &ostream) const override
Definition: MixedGraph.hpp:426
ext::set< TNode > successors(const TNode &n) const override
Definition: MixedGraph.hpp:341
bool addEdge(const TEdge &e)
Definition: MixedGraph.hpp:178
ext::vector< TEdge > successorEdges(const TNode &n) const override
Definition: MixedGraph.hpp:360
bool addArc(const TEdge &e)
Definition: MixedGraph.hpp:234
void addNode(TNode &&n)
Definition: MixedGraph.hpp:163
bool operator==(const MixedGraph &other) const
Definition: MixedGraph.hpp:66
size_t edgeCount() const override
Definition: MixedGraph.hpp:290
void addNode(Params &&... params)
Definition: MixedGraph.hpp:171
ext::set< TNode > predecessors(const TNode &n) const override
Definition: MixedGraph.hpp:379
bool addEdge(Params &&... params)
Definition: MixedGraph.hpp:229
ext::vector< TEdge > predecessorEdges(const TNode &n) const override
Definition: MixedGraph.hpp:398
ext::map< TNode, ext::map< TNode, TEdge > > m_adjacency_list
Definition: MixedGraph.hpp:36
ext::map< TNode, ext::map< TNode, TEdge > > m_pred_list
Definition: MixedGraph.hpp:40
const ext::map< TNode, ext::map< TNode, TEdge > > & getPredecessorList() const &
Definition: MixedGraph.hpp:144
ext::set< TNode > getNodes() const override
Definition: MixedGraph.hpp:309
void addNode(const TNode &n)
Definition: MixedGraph.hpp:156
const ext::map< TNode, ext::map< TNode, TEdge > > & getAdjacencyList() const &
Definition: MixedGraph.hpp:124
bool addEdge(TEdge &&e)
Definition: MixedGraph.hpp:203
const ext::map< TNode, ext::map< TNode, TEdge > > & getSuccessorList() const &
Definition: MixedGraph.hpp:134
p second
Definition: ToRegExpAlgebraic.h:126
int i
Definition: AllEpsilonClosure.h:118
Definition: normalize.hpp:10
Definition: CapacityEdge.hpp:18
Definition: sigHandler.cpp:20
constexpr tuple< Elements &... > tie(Elements &... args) noexcept
Helper of extended tuple of references construction. The tuple is constructed to reffer to values in ...
Definition: tuple.hpp:218
reference_mover< T > make_mover(T ¶m)
Move adaptor construction function specialized to lvalue reference parameter.
Definition: iterator.hpp:468
constexpr auto make_pair(T1 &&x, T2 &&y)
Definition: pair.hpp:79
Definition: ReconstructPath.hpp:14
static graph::MixedGraph eval(graph::MixedGraph< TNode, TEdge > &&value)
Definition: MixedGraph.hpp:459
Definition: normalize.hpp:13