|
Boost Users : |
From: agiatojon (JonAgiato_at_[hidden])
Date: 2002-11-07 11:27:47
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]
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