BGL: adjacency_list: remove_edge problems
I'm using a undirected grap with hash_setS as the Edge List container and vecS as the Vertex List Container I'm using MSVC60 with SP5 as soon as i'm trying to use remove_edge(vertex1,vertex2,graph) i get the following error message. I dont understand the error message. It means, that my edgelist is a std::vector allthough i compile with boost::hash_setS. Could it be, that some BGL config file detects MSVC and concludes, that hash sets are not available in the MSVC stl?? d:\matthias\programmieren\boost\boost\graph\detail\adjacency_list.hpp(665): error C2039: 'find': Ist kein Element von 'vector<boost::detail::sei_<unsigned int,list<boost::list_edge<unsigned int,boost::property<enum boost::edge_weight_t,float,boost:: no_property>>>::iter,boost::property<enum boost::edge_weight_t,float,boost::no_property>>,allocator<boost::detail::sei _<unsigned int,list<boost::list_edge<unsigned int,boost::property<enum boost::edge_weight_t,float,boost::no_property>>>::iter,boost ::property<enum boost::edge_weight_t,float,boost::no_property>>>>' find is not an element of vector the corresponding code fragment is. template <class Graph, class EdgeList, class Vertex> inline void remove_edge_and_property(Graph& g, EdgeList& el, Vertex v, boost::disallow_parallel_edge_tag) { typedef typename EdgeList::value_type StoredEdge; typename EdgeList::iterator i = el.find(StoredEdge(v)), end = el.end(); if (i != end) { g.m_edges.erase((*i).get_iter()); el.erase(i); } }
Hm, boost::remove_edge(v1,v2,currentGraph); fails, but boost::remove_edge( boost::edge(v1,v2,currentGraph), currentGraph); is ok. ?? ----- Original Message ----- From: "Matthias Kronenberger" <yg-boost-users@m.gmane.org> Newsgroups: gmane.comp.lib.boost.user Sent: Monday, August 26, 2002 3:33 PM Subject: BGL: adjacency_list: remove_edge problems
I'm using a undirected grap with hash_setS as the Edge List container and vecS as the Vertex List Container
I'm using MSVC60 with SP5
as soon as i'm trying to use remove_edge(vertex1,vertex2,graph) i get the following error message. I dont understand the error message. It means, that my edgelist is a std::vector allthough i compile with boost::hash_setS.
Could it be, that some BGL config file detects MSVC and concludes, that hash sets are not available in the MSVC stl??
d:\matthias\programmieren\boost\boost\graph\detail\adjacency_list.hpp(665):
error C2039: 'find': Ist kein Element von 'vector<boost::detail::sei_<unsigned int,list<boost::list_edge<unsigned int,boost::property<enum boost::edge_weight_t,float,boost:: no_property>>>::iter,boost::property<enum
boost::edge_weight_t,float,boost::no_property>>,allocator<boost::detail::sei
_<unsigned int,list<boost::list_edge<unsigned int,boost::property<enum boost::edge_weight_t,float,boost::no_property>>>::iter,boost ::property<enum boost::edge_weight_t,float,boost::no_property>>>>'
find is not an element of vector
the corresponding code fragment is. template <class Graph, class EdgeList, class Vertex> inline void remove_edge_and_property(Graph& g, EdgeList& el, Vertex v, boost::disallow_parallel_edge_tag) { typedef typename EdgeList::value_type StoredEdge; typename EdgeList::iterator i = el.find(StoredEdge(v)), end = el.end(); if (i != end) { g.m_edges.erase((*i).get_iter()); el.erase(i); } }
Hi Matthias, On Mon, 26 Aug 2002, Matthias Kronenberger wrote: yg-boo> Could it be, that some BGL config file detects MSVC and concludes, yg-boo> that hash sets are not available in the MSVC stl?? Yes, for hash sets to work, BGL needs to create partial specializations for the hash template class. However, MSVC does not support partial specialization. I can't think of a straightforward workaround for this problem. Sorry. Regards, Jeremy ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
Does that mean i can only use vecS as the EdgeList? What about the usual std::set. Could one change a BGL config file to use hash_setS as the default EdgeList? Which file would that be? Thanks ----- Original Message ----- From: "Jeremy Siek" <jsiek@cs.indiana.edu> Newsgroups: gmane.comp.lib.boost.user Sent: Monday, August 26, 2002 7:17 PM Subject: Re: BGL: adjacency_list: remove_edge problems
Hi Matthias,
On Mon, 26 Aug 2002, Matthias Kronenberger wrote: yg-boo> Could it be, that some BGL config file detects MSVC and concludes, yg-boo> that hash sets are not available in the MSVC stl??
Yes, for hash sets to work, BGL needs to create partial specializations for the hash template class. However, MSVC does not support partial specialization. I can't think of a straightforward workaround for this problem. Sorry.
Regards, Jeremy
---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
Hi Matthias, On Tue, 27 Aug 2002, Matthias Kronenberger wrote: mkrone> Does that mean i can only use vecS as the EdgeList? mkrone> What about the usual std::set. You can use vecS, listS, setS, and you can use the container_gen class to add your own. mkrone> Could one change a BGL config file to use hash_setS as the default mkrone> EdgeList? Which file would that be? The defaults are specified in boost/adjacency_list.hpp, line 301. Another approach that would not required modifying boost headers would be to create a type generator class: template <typename EdgeProp, typename VertexProp, etc.> struct my_favorite_adj_list { typedef adjacency_list<hash_setS, vecS, EdgeProp, VertexProp, etc.> type; }; Cheers, Jeremy ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
----- Original Message ----- From: "Jeremy Siek" <jsiek@cs.indiana.edu> Newsgroups: gmane.comp.lib.boost.user Sent: Tuesday, August 27, 2002 7:33 PM Subject: Re: Re: BGL: adjacency_list: remove_edge problems
Hi Matthias,
On Tue, 27 Aug 2002, Matthias Kronenberger wrote: mkrone> Does that mean i can only use vecS as the EdgeList? mkrone> What about the usual std::set.
You can use vecS, listS, setS, and you can use the container_gen class to add your own.
mkrone> Could one change a BGL config file to use hash_setS as the default mkrone> EdgeList? Which file would that be?
The defaults are specified in boost/adjacency_list.hpp, line 301.
Another approach that would not required modifying boost headers would be to create a type generator class:
template <typename EdgeProp, typename VertexProp, etc.> struct my_favorite_adj_list { typedef adjacency_list<hash_setS, vecS, EdgeProp, VertexProp, etc.> type; };
Hm, i'm allready using a type generator, but also MSVC. The question mark was: can i use hash_setS as an edge list with MSVC, which you denied because of the lack of partial specialisation support. Your answer was, that i'm stuck with vecS for the Edge List, right?
Cheers, Jeremy
---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
On Thu, 29 Aug 2002, Matthias Kronenberger wrote: mkrone> mkrone> Hm, i'm allready using a type generator, but also MSVC. The question mark mkrone> was: can i use hash_setS as an edge mkrone> list with MSVC, which you denied because of the lack of partial mkrone> specialisation support. mkrone> Your answer was, that i'm stuck with vecS for the Edge List, right? No, there are other options than vecS. There is also listS and setS, and you can specify your own with container_gen. Cheers, Jeremy ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
participants (3)
-
Jeremy Siek
-
Matthias Kronenberger
-
Matthias Kronenberger