[Lemon-commits] [lemon_svn] alpar: r2154 - in hugo/trunk: demo lemon

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:50:34 CET 2006


Author: alpar
Date: Thu Aug 18 00:07:35 2005
New Revision: 2154

Modified:
   hugo/trunk/demo/dijkstra_demo.cc
   hugo/trunk/demo/dim_to_lgf.cc
   hugo/trunk/demo/graph_to_eps_demo.cc
   hugo/trunk/demo/hello_lemon.cc
   hugo/trunk/demo/kruskal_demo.cc
   hugo/trunk/demo/lp_demo.cc
   hugo/trunk/demo/lp_maxflow_demo.cc
   hugo/trunk/demo/reader_writer_demo.cc
   hugo/trunk/demo/sub_graph_adaptor_demo.cc
   hugo/trunk/lemon/smart_graph.h

Log:
Demos' documentations include the source.

Modified: hugo/trunk/demo/dijkstra_demo.cc
==============================================================================
--- hugo/trunk/demo/dijkstra_demo.cc	(original)
+++ hugo/trunk/demo/dijkstra_demo.cc	Thu Aug 18 00:07:35 2005
@@ -22,12 +22,13 @@
 /// a graph with edge lengths. Here we only show some of the
 /// facilities supplied by our implementation: for the detailed
 /// documentation of the LEMON Dijkstra class read \ref lemon::Dijkstra "this".
+///
+/// \include dijkstra_demo.cc
 
 #include <iostream>
 
 #include <lemon/list_graph.h>
 #include <lemon/dijkstra.h>
-//#include <lemon/graph_writer.h>
 
 using namespace lemon;
 
@@ -69,39 +70,35 @@
     len.set(v4_t, 8);
     len.set(v5_t, 8);
 
-    std::cout << "This program is a simple demo of the LEMON Dijkstra class."<<std::endl;
-    std::cout << "We calculate the shortest path from node s to node t in a graph."<<std::endl;
-    std::cout <<std::endl;
+    std::cout << "This program is a simple demo of the LEMON Dijkstra class."
+	      << std::endl;
+    std::cout <<
+      "We calculate the shortest path from node s to node t in a graph."
+	      << std::endl;
+    std::cout << std::endl;
 
 
-    std::cout << "The id of s is " << g.id(s)<< ", the id of t is " << g.id(t)<<"."<<std::endl;
+    std::cout << "The id of s is " << g.id(s)<< ", the id of t is "
+	      << g.id(t) << "." << std::endl;
 
     std::cout << "Dijkstra algorithm demo..." << std::endl;
 
-
     Dijkstra<Graph, LengthMap> dijkstra_test(g,len);
     
     dijkstra_test.run(s);
-
     
-    std::cout << "The distance of node t from node s: " << dijkstra_test.dist(t)<<std::endl;
+    std::cout << "The distance of node t from node s: "
+	      << dijkstra_test.dist(t) << std::endl;
 
-    std::cout << "The shortest path from s to t goes through the following nodes (the first one is t, the last one is s): "<<std::endl;
+    std::cout << "The shortest path from s to t goes through the following "
+	      << "nodes (the first one is t, the last one is s): "
+	      << std::endl;
 
-    for (Node v=t;v != s; v=dijkstra_test.predNode(v)){
-	std::cout << g.id(v) << "<-";
+    for (Node v=t;v != s; v=dijkstra_test.predNode(v)) {
+      std::cout << g.id(v) << "<-";
     }
+    
     std::cout << g.id(s) << std::endl;	
     
-
     return 0;
 }
-
-
-
-
-
-
-
-
-

Modified: hugo/trunk/demo/dim_to_lgf.cc
==============================================================================
--- hugo/trunk/demo/dim_to_lgf.cc	(original)
+++ hugo/trunk/demo/dim_to_lgf.cc	Thu Aug 18 00:07:35 2005
@@ -20,6 +20,8 @@
 ///
 /// This program converts various DIMACS formats to the LEMON Graph Format
 /// (LGF).
+///
+/// \include dim_to_lgf.cc
 
 #include <iostream>
 #include <fstream>

Modified: hugo/trunk/demo/graph_to_eps_demo.cc
==============================================================================
--- hugo/trunk/demo/graph_to_eps_demo.cc	(original)
+++ hugo/trunk/demo/graph_to_eps_demo.cc	Thu Aug 18 00:07:35 2005
@@ -25,6 +25,8 @@
 /// how to handle parallel egdes, how to change the properties (like
 /// color, shape, size, title etc.) of nodes and edges individually
 /// using appropriate \ref maps-page "graph maps".
+///
+/// \include graph_to_eps_demo.cc
 
 #include <cmath>
 

Modified: hugo/trunk/demo/hello_lemon.cc
==============================================================================
--- hugo/trunk/demo/hello_lemon.cc	(original)
+++ hugo/trunk/demo/hello_lemon.cc	Thu Aug 18 00:07:35 2005
@@ -21,6 +21,8 @@
 /// This program is intended to be a "Hello World!" program that shows
 /// the very basic notions of the LEMON library: \ref graphs "graphs" and
 /// \ref maps-page "maps". Click on the links to read more about these.
+///
+/// \include hello_lemon.cc
 
 #include <iostream>
 #include <lemon/list_graph.h>
@@ -81,7 +83,8 @@
   std::cout << "There is a map on the edges (length)!" << std::endl;
   std::cout <<  std::endl;
   for (EdgeIt i(g); i!=INVALID; ++i)
-    std::cout << "length(" << g.id(g.source(i)) << "," << g.id(g.target(i)) << ")="<<length[i]<<std::endl;
+    std::cout << "length(" << g.id(g.source(i)) << ","
+	      << g.id(g.target(i)) << ")="<<length[i]<<std::endl;
 
   std::cout << std::endl;
 

Modified: hugo/trunk/demo/kruskal_demo.cc
==============================================================================
--- hugo/trunk/demo/kruskal_demo.cc	(original)
+++ hugo/trunk/demo/kruskal_demo.cc	Thu Aug 18 00:07:35 2005
@@ -20,6 +20,8 @@
 ///
 /// This demo program shows how to find a minimum weight spanning tree
 /// in a graph by using the Kruskal algorithm. 
+///
+/// \include kruskal_demo.cc
 
 #include <iostream>
 #include <vector>
@@ -123,7 +125,8 @@
   for(int i=tree_edge_vec.size()-1; i>=0;  i--)
     std::cout << g.id(tree_edge_vec[i]) << ";" ;
   std::cout << std::endl;
-  std::cout << "The size of the tree again is: "<< tree_edge_vec.size()<< std::endl; 
+  std::cout << "The size of the tree again is: "<< tree_edge_vec.size()
+	    << std::endl; 
 
   
   return 0;

Modified: hugo/trunk/demo/lp_demo.cc
==============================================================================
--- hugo/trunk/demo/lp_demo.cc	(original)
+++ hugo/trunk/demo/lp_demo.cc	Thu Aug 18 00:07:35 2005
@@ -23,6 +23,8 @@
 /// solve it using the underlying solver (GLPK or CPLEX for
 /// example). For the detailed documentation of the LEMON LP solver
 /// interface read \ref lemon::LpSolverBase "this".
+///
+/// \include lp_demo.cc
 
 #include <lemon/lp.h>
 

Modified: hugo/trunk/demo/lp_maxflow_demo.cc
==============================================================================
--- hugo/trunk/demo/lp_maxflow_demo.cc	(original)
+++ hugo/trunk/demo/lp_maxflow_demo.cc	Thu Aug 18 00:07:35 2005
@@ -22,6 +22,8 @@
 /// problem using the LEMON LP solver interface. We would like to lay
 /// the emphasis on the simplicity of the way one can formulate LP
 /// constraints that arise in graph theory in our library LEMON .
+///
+/// \include lp_maxflow_demo.cc
 
 #include<lemon/graph_reader.h>
 #include<lemon/list_graph.h>

Modified: hugo/trunk/demo/reader_writer_demo.cc
==============================================================================
--- hugo/trunk/demo/reader_writer_demo.cc	(original)
+++ hugo/trunk/demo/reader_writer_demo.cc	Thu Aug 18 00:07:35 2005
@@ -22,7 +22,8 @@
 /// This simple demo program gives an example of how to read and write
 /// a graph and additional maps (on the nodes or the edges) from/to a
 /// stream. 
-
+///
+/// \include reader_writer_demo.cc
 
 #include <iostream>
 #include <lemon/smart_graph.h>

Modified: hugo/trunk/demo/sub_graph_adaptor_demo.cc
==============================================================================
--- hugo/trunk/demo/sub_graph_adaptor_demo.cc	(original)
+++ hugo/trunk/demo/sub_graph_adaptor_demo.cc	Thu Aug 18 00:07:35 2005
@@ -21,7 +21,8 @@
 ///
 /// This program computes a maximum number of edge-disjoint shortest paths
 /// between nodes \c s and \c t.
-
+///
+/// \include sub_graph_adaptor_demo.cc
 
 // Use a DIMACS max flow file as input.
 // sub_graph_adaptor_demo < dimacs_max_flow_file

Modified: hugo/trunk/lemon/smart_graph.h
==============================================================================
--- hugo/trunk/lemon/smart_graph.h	(original)
+++ hugo/trunk/lemon/smart_graph.h	Thu Aug 18 00:07:35 2005
@@ -150,6 +150,8 @@
 
     protected:
       int n;
+      ///\e
+
       ///\todo It should be removed (or at least define a setToId() instead).
       ///
       Node(int nn) {n=nn;}



More information about the Lemon-commits mailing list