Boost logo

Boost Users :

From: Jeremy Graham Siek (jsiek_at_[hidden])
Date: 2004-12-03 14:04:34


Hi Jean,

The vertex descriptor of a graph is not, *in general*, required to be
something
that one can print with an ostream. The vertex_index, however, is just
an
integer, which can be printed via ostream.

However, to use this, your graph must have an internal vertex_index
property.
Does it have this?

Cheers,
Jeremy

On Dec 3, 2004, at 12:05 PM, Jean Utke wrote:

> Since I haven't gotten any reaction to this - after some more digging
> it seems the explanation lies with the changes made between
> revisions 1.17 and 1.21 of boost/graph/graphviz.hpp
> for instance for vertex printing:
> revision 1.17: line 254:
> out << *i;
> vs
> revision 1.21: line 263:
> out << get(vertex_index, *i);
>
> I read the change comment from CVS:
> ===
> Revision *1.18*
> /Tue Aug 12 01:15:37 2003 UTC/ (15 months, 3 weeks ago) by /jsiek/ :
> changed to print the vertex_index instead of the vertex_descriptor
> ===
> I understand how vertex_descriptor works, I am not sure about
> vertex_index, I have not yet fully traced it back through the
> templates.
> Can somebody please explain this to me?
>
> Thanks,
>
> Jean
>
>
>
>
> Jean Utke wrote:
>
>> I am running into a problem compiling code that uses write_graphviz
>> which used to work e.g. for gcc 3.3 and boost versions prior to 1.31.
>> As I am trying to move forward I am testing different gcc and boost
>> versions.
>> Here is the example code:
>> ----------------------------------------------------------------
>> #include "boost/graph/adjacency_list.hpp"
>> #include "boost/graph/graphviz.hpp"
>>
>> class BoostVertexContentType {
>> public:
>> enum { num=100 };
>> typedef boost::vertex_property_tag kind;
>> };
>>
>> class BoostEdgeContentType {
>> public:
>> enum { num=101 };
>> typedef boost::edge_property_tag kind;
>> };
>>
>> int main(void) {
>> boost::adjacency_list<
>> boost::listS,
>> boost::listS,
>> boost::bidirectionalS,
>> boost::property<BoostVertexContentType, int>,
>> boost::property<BoostEdgeContentType, int> > b;
>> std::ofstream anOutFileStream;
>> anOutFileStream.open("test.dot",std::ios::out);
>> boost::write_graphviz(anOutFileStream,
>> b);
>> anOutFileStream.close();
>> }
>> -----------------------------------------------------------------
>> This compiles ok with gcc 3.3 and boost 1.30.0 / 1.30.2
>>
>> It does not compile with gcc 3.3/3.4.3 and boost 1.31/1.32
>> basically complaining about:
>>
>> boost_1_32_0/boost/graph/graphviz.hpp:269: error: no
>> match for `std::basic_ostream<char, std::char_traits<char> >& <<
>> const
>> boost::detail::error_property_not_found&' operator
>>
>> My target right now is to use gcc 3.4.3 with boost 1.32.
>> Before I spend time searching for a workaround I hope that somebody
>> has seen this and that there is an easy solution.
>>
>> Thanks,
>>
>> Jean
>>
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
>
>
> --
> Jean Utke
> Argonne National Lab./MCS
> utke_at_[hidden]
> phone: 630 252 4552 cell: 630 363 5753
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
_______________________________________________
Jeremy Siek <jsiek_at_[hidden]>
http://www.osl.iu.edu/~jsiek
Ph.D. Candidate, Indiana University Bloomington
C++ Booster (http://www.boost.org)
_______________________________________________


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