|
Boost Users : |
Subject: Re: [Boost-users] [graph] Is reverse_graph<> read-only?
From: al.zatv (al.zatv_at_[hidden])
Date: 2011-02-17 18:06:03
Jeremiah Willcock <jewillco_at_[hidden]> пиÑал(а) в ÑвоÑм пиÑÑме Fri, 18
Feb 2011 01:49:27 +0300:
>> Is reverse_graph<> in Boost::Graph Library, read-only?
> It appears to be read-only. It should be possible to add mutation; it
> just isn't there yet. Do you need that feature?
Yes. My program build two trees in the same graph. First tree is
"forward". Second tree is "backward": build by the same algorithm, but in
reverse order. So I need add_vertex and add_edge for reverse trees. I
wrote them this way (please look if I'm correct - because I'm a newbie and
can make stupid errors).
=============
template <typename Graph>
inline std::pair<typename reverse_graph<Graph,Graph&>::edge_descriptor,
bool>
add_edge(typename reverse_graph<Graph,Graph&>::vertex_descriptor u,
typename reverse_graph<Graph,Graph&>::vertex_descriptor v,
//const typename reverse_graph<Graph,Graph&>::edge_property_type&
p,
reverse_graph<Graph,Graph&> &g)
{
return add_edge(v,u,g.m_g);
}
template <typename Graph>
inline std::pair<typename reverse_graph<Graph,Graph&>::edge_descriptor,
bool>
add_edge(typename reverse_graph<Graph,Graph&>::vertex_descriptor u,
typename reverse_graph<Graph,Graph&>::vertex_descriptor v,
const typename reverse_graph<Graph,Graph&>::edge_property_type& p,
reverse_graph<Graph,Graph&> &g)
{
return add_edge(v,u,p,g.m_g);
}
==============
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net