mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-09-30 03:34:25 +03:00
simple pass to pick up paths redundant with those from cyclic's succs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Intel Corporation
|
||||
* Copyright (c) 2015-2016, Intel Corporation
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
@@ -291,6 +291,22 @@ bool is_dag(const Graph &g, bool ignore_self_loops = false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename Cont>
|
||||
class vertex_recorder : public boost::default_dfs_visitor {
|
||||
public:
|
||||
explicit vertex_recorder(Cont &o) : out(o) {}
|
||||
template<class G>
|
||||
void discover_vertex(typename Cont::value_type v, const G &) {
|
||||
out.insert(v);
|
||||
}
|
||||
Cont &out;
|
||||
};
|
||||
|
||||
template<typename Cont>
|
||||
vertex_recorder<Cont> make_vertex_recorder(Cont &o) {
|
||||
return vertex_recorder<Cont>(o);
|
||||
}
|
||||
|
||||
template <class Graph>
|
||||
std::pair<typename Graph::edge_descriptor, bool>
|
||||
add_edge_if_not_present(typename Graph::vertex_descriptor u,
|
||||
|
Reference in New Issue
Block a user