Boost logo

Boost Users :

From: J-S Lin (yg-boost-users_at_[hidden])
Date: 2003-03-12 16:26:26


Hi,

You need to add
#include <boost/graph/graph_utility.hpp>

J-S

"agiatojon" <JonAgiato_at_[hidden]> wrote in message
news:aqe4a3+k7tj_at_eGroups.com...
> Hello all, I'm new to the list and to Boost in general and am trying
> to use an adjacency_matrix in order to plot coordinates (hopefully
> that is a good use for it). I just started trying to learn it and
> have entered the sample program from page 237 into my compiler
> (VS.NET). Below is the program I have entered. I am getting errors
> in that print_vertices, print_edges, and print_graph are undefined
> and are not members of boost. Any help apprechiated! Thanks.
>
> /**
> * adjaMatri.cpp
> * Nov 7th, 2002
> * Boost Graph Library, pg. 237
> */
>
> #include <iostream>
> using std::cout;
> using std::cin;
> using std::endl;
>
> #include <boost/graph/adjacency_matrix.hpp>
> using namespace boost;
>
> int main()
> {
> enum { A, B, C, D, E, F, N };
> const char *name = "ABCDEF";
>
> typedef boost::adjacency_matrix<boost::undirectedS> UGraph;
> UGraph ug(N);
> add_edge(B, C, ug);
> add_edge(B, F, ug);
> add_edge(C, A, ug);
> add_edge(D, E, ug);
> add_edge(F, A, ug);
>
> cout << "vertex set: ";
> boost::print_vertices(ug, name);
> cout << endl;
>
> cout << "edge_set: ";
> boost::print_edges(ug, name);
> cout << endl;
>
> cout << "incident edges: ";
> boost::print_graph(ug, name);
> cout << endl;
>
> cout << "Press enter to exit...";
> cin.get();
>
> return EXIT_SUCCESS;
> }
>
> Jon Agiato
> JonAgiato_at_[hidden]
>
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


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