Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2006-06-27 09:56:57


On Jun 12, 2006, at 1:03 PM, Johan Oudinet wrote:

> Hi,
>
> I try using the compressed_sparse row_graph graph type, and I want add
> lots vertices.
>
> When I read the documentation
> (http://www.boost-consulting.com/boost/libs/graph/doc/
> compressed_sparse_row.html),
> I saw the appropriate add_vertices function described as bellow:
>
> vertex_descriptor add_vertices(vertices_size_type count,
> compressed_sparse_row_graph& g)
>
> But, in compressed_sparse_row_graph.hpp:346:
> <--8-----------------------------------------------------
> template<BOOST_CSR_GRAPH_TEMPLATE_PARMS>
> inline Vertex
> add_vertices(Vertex count, BOOST_CSR_GRAPH_TYPE& g) {
> Vertex old_num_verts_plus_one = g.m_rowstart.size();
> g.m_rowstart.resize(old_num_verts_plus_one + count, EdgeIndex(0));
> return old_num_verts_plus_one - 1;
> }
> <--8-----------------------------------------------------
>
> I don't understand why `count' is a `Vertex' type! Why not
> `vertices_size_type' type ?

The vertices in a CSR graph are always numeric values (indices into
one of CSR's internal arrays), so "Vertex" is actually the same type
as "vertices_size_type." Still, you are right: this should
technically be vertices_size_type. It's now fixed in CVS. Thanks!

        Doug


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