/** \page getstart How to start using LEMON In this page we detail how to start using LEMON, from downloading it to your computer, through the steps of installation to showing a simple "Hello World" type program that already uses LEMON. If anything is not clear write to our FAQ. \todo Is this FAQ thing a good idea here? Is there such a thing? If twice YES then a link comes here. \section downloadLEMON How to download LEMON You can download LEMON from the LEMON web site: http://lemon.cs.elte.hu by following the download link. There you will find the issued distributions in form of \e .ta.gz files. If you want a developer version (for example you want to contribute in developing the library LEMON) then you might want to use our Subversion repository. This case is not detailed here, so from now on we suppose that you downloaded a tar.gz file. \section installLEMON How to install LEMON In order to install LEMON you have to do the following Download the tarball and issue the following commands: \code tar xvzf lemon-0.3.1.tar.gz cd lemon-0.3.1 ./configure make make check (This is optional, but recomended. It runs a bunch of tests.) make install \endcode These commands install LEMON under /usr/local. If you want to install it to some other place, then pass the --prefix=DIR flag to ./configure. Ide kell írni: -Hol fordul (Windows-os fordító nem fordítja, unix/linux alatt gcc hanyas verziója kell) - \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 to have a first working program that uses library LEMON. \code #include #include using namespace lemon; int main() { typedef ListGraph Graph; typedef Graph::Edge Edge; typedef Graph::InEdgeIt InEdgeIt; typedef Graph::OutEdgeIt OutEdgeIt; typedef Graph::EdgeIt EdgeIt; typedef Graph::Node Node; typedef Graph::NodeIt NodeIt; 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 ListGraph is one of LEMON's graph classes. It is based on linked lists, therefore iterating throuh its edges and nodes is fast. After some convenient typedefs we create a graph and add three nodes to it. Then we add edges to it to form a complete graph. Then we iterate through all nodes of the graph. We use a constructor of the node iterator to initialize it to the first node. The operator++ is used to step to the next node. Using operator++ on the iterator pointing to the last node invalidates the iterator i.e. sets its value to \ref lemon::INVALID "INVALID". This is what we exploit in the stop condition. We can also iterate through all edges of the graph very similarly. The \c target and \c source member functions can be used to access the endpoints of an edge. The previous code fragment prints out the following: \code Nodes: 2 1 0 Edges: (0,2) (1,2) (0,1) (2,1) (1,0) (2,0) \endcode If you want to see more features, go to the \ref quicktour "Quick Tour to LEMON", if you want to see see some demo programs then go to our \ref demoprograms "Demo Programs" page! */