<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.programmingexamples.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FBoost%2FBGL%2FFilteredGraphEdges</id>
		<title>CPP/Boost/BGL/FilteredGraphEdges - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.programmingexamples.net/w/index.php?action=history&amp;feed=atom&amp;title=CPP%2FBoost%2FBGL%2FFilteredGraphEdges"/>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=CPP/Boost/BGL/FilteredGraphEdges&amp;action=history"/>
		<updated>2026-06-15T19:53:56Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.5</generator>

	<entry>
		<id>http://www.programmingexamples.net/w/index.php?title=CPP/Boost/BGL/FilteredGraphEdges&amp;diff=5151&amp;oldid=prev</id>
		<title>Daviddoria: Created page with '==FilteredGraph.cpp== &lt;source lang=&quot;cpp&quot;&gt; #include &lt;iostream&gt;  #include &lt;boost/graph/adjacency_list.hpp&gt; #include &lt;boost/array.hpp&gt; #include &lt;boost/graph/filtered_graph.hpp&gt; #inc…'</title>
		<link rel="alternate" type="text/html" href="http://www.programmingexamples.net/w/index.php?title=CPP/Boost/BGL/FilteredGraphEdges&amp;diff=5151&amp;oldid=prev"/>
				<updated>2012-01-26T15:25:23Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;==FilteredGraph.cpp== &amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt; #include &amp;lt;iostream&amp;gt;  #include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt; #include &amp;lt;boost/array.hpp&amp;gt; #include &amp;lt;boost/graph/filtered_graph.hpp&amp;gt; #inc…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==FilteredGraph.cpp==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;boost/graph/adjacency_list.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/array.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/graph/filtered_graph.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/graph/graph_utility.hpp&amp;gt;&lt;br /&gt;
&lt;br /&gt;
template &amp;lt;typename EdgeWeightMap&amp;gt;&lt;br /&gt;
struct positive_edge_weight {&lt;br /&gt;
  positive_edge_weight() { }&lt;br /&gt;
  positive_edge_weight(EdgeWeightMap weight) : m_weight(weight) { }&lt;br /&gt;
  template &amp;lt;typename Edge&amp;gt;&lt;br /&gt;
  bool operator()(const Edge&amp;amp; e) const {&lt;br /&gt;
    return 0 &amp;lt; get(m_weight, e);&lt;br /&gt;
  }&lt;br /&gt;
  EdgeWeightMap m_weight;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
  using namespace boost;&lt;br /&gt;
&lt;br /&gt;
  typedef adjacency_list&amp;lt;vecS, vecS, directedS,&lt;br /&gt;
    no_property, property&amp;lt;edge_weight_t, int&amp;gt; &amp;gt; Graph;&lt;br /&gt;
  typedef property_map&amp;lt;Graph, edge_weight_t&amp;gt;::type EdgeWeightMap;&lt;br /&gt;
&lt;br /&gt;
  enum { A, B, C, D, E, N };&lt;br /&gt;
  const char* name = &amp;quot;ABCDE&amp;quot;;&lt;br /&gt;
  Graph g(N);&lt;br /&gt;
  add_edge(A, B, 2, g);&lt;br /&gt;
  add_edge(A, C, 0, g);&lt;br /&gt;
  add_edge(C, D, 1, g);&lt;br /&gt;
  add_edge(C, E, 0, g);&lt;br /&gt;
  add_edge(D, B, 3, g);&lt;br /&gt;
  add_edge(E, C, 0, g);&lt;br /&gt;
&lt;br /&gt;
  positive_edge_weight&amp;lt;EdgeWeightMap&amp;gt; filter(get(edge_weight, g));&lt;br /&gt;
  filtered_graph&amp;lt;Graph, positive_edge_weight&amp;lt;EdgeWeightMap&amp;gt; &amp;gt; filteredGraph(g, filter);&lt;br /&gt;
&lt;br /&gt;
  boost::print_graph(filteredGraph, name);&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==CMakeLists.txt==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cmake&amp;quot;&amp;gt;&lt;br /&gt;
cmake_minimum_required(VERSION 2.6)&lt;br /&gt;
&lt;br /&gt;
Project(FilteredGraphEdges)&lt;br /&gt;
&lt;br /&gt;
set(Boost_USE_MULTITHREADED ON)&lt;br /&gt;
FIND_PACKAGE(Boost 1.38 COMPONENTS required)&lt;br /&gt;
&lt;br /&gt;
INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES} ${Boost_INCLUDE_DIRS})&lt;br /&gt;
LINK_DIRECTORIES(${LINK_DIRECTORIES} ${Boost_LIBRARY_DIRS})&lt;br /&gt;
&lt;br /&gt;
ADD_EXECUTABLE(FilteredGraphEdges FilteredGraphEdges.cpp)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Daviddoria</name></author>	</entry>

	</feed>