diff -r 17e367a93cbb -r c2c76e4598f6 doc/getstart.dox --- a/doc/getstart.dox Mon Jun 27 19:47:09 2005 +0000 +++ b/doc/getstart.dox Mon Jun 27 20:44:29 2005 +0000 @@ -106,40 +106,11 @@ \section helloworld My first program using LEMON If you have installed LEMON on your system you can paste the -following code segment into a file (named e.g. \c hello_lemon.cc) -to have a first working program that uses library LEMON. +following code segment into a file (you can find it as \c +demo/hello_lemon.cc in the LEMON package) to have a first working +program that uses library LEMON. -\code -#include -#include - -int main() -{ - typedef lemon::ListGraph Graph; - typedef Graph::EdgeIt EdgeIt; - typedef Graph::NodeIt NodeIt; - using lemon::INVALID; - - Graph g; - - for (int i = 0; i < 3; i++) - g.addNode(); - - for (NodeIt i(g); i!=INVALID; ++i) - for (NodeIt j(g); j!=INVALID; ++j) - if (i != j) g.addEdge(i, j); - - std::cout << "Nodes:"; - for (NodeIt i(g); i!=INVALID; ++i) - std::cout << " " << g.id(i); - std::cout << std::endl; - - std::cout << "Edges:"; - for (EdgeIt i(g); i!=INVALID; ++i) - std::cout << " (" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")"; - std::cout << std::endl; -} -\endcode +\include hello_lemon.cc First let us briefly explain how this program works. @@ -159,11 +130,10 @@ \c target and \c source member functions can be used to access the endpoints of an edge. -If you have saved the preceding code into a file named, say, \c -hello_lemon.cc and your installation of LEMON into directory \c -/usr/local was successful then it is very easy to compile this -program with the following command (the argument -lemon -tells the compiler that we are using the installed library LEMON): +If your installation of LEMON into directory \c /usr/local was +successful then it is very easy to compile this program with the +following command (the argument -lemon tells the compiler +that we are using the installed library LEMON): \verbatim g++ hello_lemon.cc -o hello_lemon -lemon