Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-05-07 10:55:11


Hi Jan,

Thanks for the bug report (it was indeed a bug). I've checked the fix into
CVS at sourceforge.

Cheers,
Jeremy

P.S. The set_adaptor.hpp and bitset_adaptor.hpp are "experimental" at this
point. I'll move them out of detail once they are polished off.

On Mon, 7 May 2001, Jan van der Veen wrote:

jan> Hi Jeremy,
jan>
jan> sorry for the direct mail. I have not been able to post to boost_at_yahoogroups
jan> due to storage problems on their side.
jan>
jan> The following code does not compile (RedHat 6.2, boost 1.21.2, g++ 2.95.2). The
jan> compiler complains at length about in_edges(*vertices(fg).first, fg). Am I
jan> doing something wrong here?
jan>
jan> Thanks in advance,
jan>
jan> Jan van der Veen.
jan>
jan> PS: In my opinion boost/graph/filtered_graph.hpp should include
jan> boost/graph/detail/set_adaptor.hpp and boost/graph/detail/bitset_adaptor.hpp.
jan>
jan> #include <boost/config.hpp>
jan> #include <iostream>
jan> #include <boost/graph/adjacency_list.hpp>
jan> #include <boost/graph/filtered_graph.hpp>
jan> #include <boost/graph/detail/set_adaptor.hpp>
jan> #include <boost/graph/graph_utility.hpp>
jan>
jan> int main()
jan> {
jan> using namespace boost;
jan>
jan> typedef adjacency_list<vecS, vecS, bidirectionalS, no_property, property<edge_weight_t, int> > TGraph;
jan> typedef set<graph_traits<TGraph>::vertex_descriptor> TVertexSet;
jan>
jan> enum { A, B, C, D, E, N };
jan> const char* name = "ABCDE";
jan> TGraph g(N);
jan> add_edge(A, B, 2, g);
jan> add_edge(A, C, 0, g);
jan> add_edge(C, D, 1, g);
jan> add_edge(C, E, 0, g);
jan> add_edge(D, B, 3, g);
jan> add_edge(E, C, 0, g);
jan>
jan> TVertexSet X;
jan> X.insert(A);
jan>
jan> typedef filtered_graph<TGraph, keep_all, is_not_in_subset<TVertexSet> > TFilteredGraph;
jan> TFilteredGraph fg(g, keep_all(), is_not_in_subset<TVertexSet>(X));
jan>
jan> std::cout << "filtered graph: ";
jan> print_graph(fg, name);
jan>
jan> graph_traits<TFilteredGraph>::in_edge_iterator itin, itin_end;
jan> for (tie(itin, itin_end) = in_edges(*vertices(fg).first, fg); itin != itin_end; itin++)
jan> ;
jan>
jan> return 0;
jan> }
jan>

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk