|
Boost Users : |
From: Martin Okrslar (okrslar_at_[hidden])
Date: 2003-03-21 08:49:21
Dear Group,
trying for several days, I simply don't get the correct usage of
internal property maps and the connected_components algorithm. My graphs
are very large (about 600 000 vertices), so that I am using internal
instead of external property maps.
Looking at one of Jeremy's postings
(http://lists.boost.org/MailArchives/boost/msg15114.php) I defined my
graph as follows:
namespace boost {
enum vertex_component_t {vertex_component = 113 };
BOOST_INSTALL_PROPERTY(vertex, component);
}
typedef typename boost::adjacency_list<
boost::listS, //edges
boost::listS, //nodes
boost::undirectedS,
//vertex properties
boost::property<boost::vertex_name_t, std::string, //the name of the
protein
boost::property<boost::vertex_component_t, int >
> >
// no edge properties
> Graph;
The code that uses internal property maps as an argument to
compute_components comes below (actually, I am not sure whether this is
a connected_components problem at all).
typedef boost::property_map<Graph, boost::vertex_component_t>::type
ComponentPropertyMap;
ComponentPropertyMap component = boost::get(boost::vertex_component,g);
int components_num = boost::connected_components(g,component);
This looks quite straightforward and is in line with what Jeremy has
posted. But I get the following compiler errors (using Boost 1.29 and
gcc 3.2):
[snip]
/project/algorithmics/include/boost/property_map.hpp:344: no match for
`const
__gnu_cxx::__normal_iterator<boost::default_color_type*,
std::vector<boost::default_color_type,
std::allocator<boost::default_color_type> > >& + const
boost::detail::error_property_not_found&' operator
What is going wrong? Do I have to use a color_type_t (Why? How?)?
Any help is very welcome...
Many thanks in advance
Martin
-- ----------------------------------------------------------------------------- Martin Okrslar MPI for Molecular Genetics phone: ++ 49 + 30 / 8413-1166 Computational Molecular Biology Fax: ++ 49 + 30 / 8413-1152 Ihnestrasse 73 email: okrslar_at_[hidden] D-14195 Berlin URL: http://cmb.molgen.mpg.de -----------------------------------------------------------------------------
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