[Lemon-commits] Peter Kovacs: Doc improvements in LGF related files

Lemon HG hg at lemon.cs.elte.hu
Sun Jul 6 08:49:29 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/7bf5f97d574f
changeset: 192:7bf5f97d574f
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Sat Jul 05 00:14:27 2008 +0200
description:
	Doc improvements in LGF related files

diffstat:

5 files changed, 166 insertions(+), 115 deletions(-)
demo/lgf_demo.cc   |    6 -
doc/groups.dox     |    6 -
doc/lgf.dox        |    4 -
lemon/lgf_reader.h |  159 +++++++++++++++++++++++++++++++---------------------
lemon/lgf_writer.h |  106 ++++++++++++++++++++--------------

diffs (truncated from 833 to 300 lines):

diff -r 1e6af6f0843c -r 7bf5f97d574f demo/lgf_demo.cc
--- a/demo/lgf_demo.cc	Fri Jul 04 16:12:31 2008 +0200
+++ b/demo/lgf_demo.cc	Sat Jul 05 00:14:27 2008 +0200
@@ -34,8 +34,6 @@
 #include <lemon/smart_graph.h>
 #include <lemon/lgf_reader.h>
 #include <lemon/lgf_writer.h>
-#include <lemon/random.h>
-
 
 using namespace lemon;
 
@@ -44,13 +42,13 @@
   SmartDigraph::ArcMap<int> cap(g);
   SmartDigraph::Node s, t;
 
-  digraphReader("digraph.lgf", g). // read the directeg graph into g
+  digraphReader("digraph.lgf", g). // read the directed graph into g
     arcMap("capacity", cap).       // read the 'capacity' arc map into cap
     node("source", s).             // read 'source' node to s
     node("target", t).             // read 'target' node to t
     run();
 
-  std::cout << "Digraph read from 'digraph.lgf'" << std::endl;
+  std::cout << "A digraph is read from 'digraph.lgf'." << std::endl;
   std::cout << "Number of nodes: " << countNodes(g) << std::endl;
   std::cout << "Number of arcs: " << countArcs(g) << std::endl;
 
diff -r 1e6af6f0843c -r 7bf5f97d574f doc/groups.dox
--- a/doc/groups.dox	Fri Jul 04 16:12:31 2008 +0200
+++ b/doc/groups.dox	Sat Jul 05 00:14:27 2008 +0200
@@ -475,11 +475,9 @@
 /**
 @defgroup lemon_io Lemon Input-Output
 @ingroup io_group
-\brief Reading and writing LEMON format
+\brief Reading and writing \ref lgf-format "Lemon Graph Format".
 
-This group describes methods for reading and writing LEMON format. 
-You can find more about this format on the \ref graph-io-page "Graph Input-Output"
-tutorial pages.
+This group describes methods for reading and writing \ref lgf-format "Lemon Graph Format".
 */
 
 /**
diff -r 1e6af6f0843c -r 7bf5f97d574f doc/lgf.dox
--- a/doc/lgf.dox	Fri Jul 04 16:12:31 2008 +0200
+++ b/doc/lgf.dox	Sat Jul 05 00:14:27 2008 +0200
@@ -46,7 +46,7 @@
 contain whitespaces and escape sequences. 
 
 The \c \@nodes section describes a set of nodes and associated
-maps. The first is a header line, it columns are the names of the
+maps. The first is a header line, its columns are the names of the
 maps appearing in the following lines.
 One of the maps must be called \c
 "label", which plays special role in the file.
@@ -64,7 +64,7 @@
 \endcode
 
 The \c \@arcs section is very similar to the \c \@nodes section,
-it again starts with a header line describing the names of the arc,
+it again starts with a header line describing the names of the maps,
 but the \c "label" map is not obligatory here. The following lines
 describe the arcs. The first two tokens of each line are
 the source and the target node of the arc, respectively, then come the map
diff -r 1e6af6f0843c -r 7bf5f97d574f lemon/lgf_reader.h
--- a/lemon/lgf_reader.h	Fri Jul 04 16:12:31 2008 +0200
+++ b/lemon/lgf_reader.h	Sat Jul 05 00:14:27 2008 +0200
@@ -18,7 +18,7 @@
 
 ///\ingroup lemon_io
 ///\file
-///\brief Lemon Graph Format reader.
+///\brief \ref lgf-format "Lemon Graph Format" reader.
 
 
 #ifndef LEMON_LGF_READER_H
@@ -400,7 +400,7 @@
 
   /// \ingroup lemon_io
   ///  
-  /// \brief LGF reader for directed graphs
+  /// \brief \ref lgf-format "LGF" reader for directed graphs
   ///
   /// This utility reads an \ref lgf-format "LGF" file.
   ///
@@ -410,22 +410,22 @@
   /// member function. A map reading rule can be added to the reader
   /// with the \c nodeMap() or \c arcMap() members. An optional
   /// converter parameter can also be added as a standard functor
-  /// converting from std::string to the value type of the map. If it
+  /// converting from \c std::string to the value type of the map. If it
   /// is set, it will determine how the tokens in the file should be
-  /// is converted to the map's value type. If the functor is not set,
+  /// converted to the value type of the map. If the functor is not set,
   /// then a default conversion will be used. One map can be read into
   /// multiple map objects at the same time. The \c attribute(), \c
   /// node() and \c arc() functions are used to add attribute reading
   /// rules.
   ///
   ///\code
-  ///     DigraphReader<Digraph>(std::cin, digraph).
-  ///       nodeMap("coordinates", coord_map).
-  ///       arcMap("capacity", cap_map).
-  ///       node("source", src).
-  ///       node("target", trg).
-  ///       attribute("caption", caption).
-  ///       run();
+  /// DigraphReader<Digraph>(std::cin, digraph).
+  ///   nodeMap("coordinates", coord_map).
+  ///   arcMap("capacity", cap_map).
+  ///   node("source", src).
+  ///   node("target", trg).
+  ///   attribute("caption", caption).
+  ///   run();
   ///\endcode
   ///
   /// By default the reader uses the first section in the file of the
@@ -437,14 +437,14 @@
   /// that the nodes or arcs should not be constructed (added to the
   /// graph) during the reading, but instead the label map of the items
   /// are given as a parameter of these functions. An
-  /// application of these function is multipass reading, which is
-  /// important if two \e \@arcs sections must be read from the
-  /// file. In this example the first phase would read the node set and one
+  /// application of these functions is multipass reading, which is
+  /// important if two \c \@arcs sections must be read from the
+  /// file. In this case the first phase would read the node set and one
   /// of the arc sets, while the second phase would read the second arc
   /// set into an \e ArcSet class (\c SmartArcSet or \c ListArcSet).
   /// The previously read label node map should be passed to the \c
   /// useNodes() functions. Another application of multipass reading when
-  /// paths are given as a node map or an arc map. It is impossible read this in
+  /// paths are given as a node map or an arc map. It is impossible to read this in
   /// a single pass, because the arcs are not constructed when the node
   /// maps are read.
   template <typename _Digraph>
@@ -735,7 +735,7 @@
     ///
     /// Use previously constructed node set, and specify the node
     /// label map and a functor which converts the label map values to
-    /// std::string.
+    /// \c std::string.
     template <typename Map, typename Converter>
     DigraphReader& useNodes(const Map& map, 
 			    const Converter& converter = Converter()) {
@@ -768,7 +768,7 @@
     ///
     /// Use previously constructed arc set, and specify the arc
     /// label map and a functor which converts the label map values to
-    /// std::string.
+    /// \c std::string.
     template <typename Map, typename Converter>
     DigraphReader& useArcs(const Map& map, 
 			   const Converter& converter = Converter()) {
@@ -784,12 +784,11 @@
     /// \brief Skips the reading of node section
     ///
     /// Omit the reading of the node section. This implies that each node
-    /// map reading rule will be abanoned, and the nodes of the graph
+    /// map reading rule will be abandoned, and the nodes of the graph
     /// will not be constructed, which usually cause that the arc set
-    /// could not be read due to lack of node name
-    /// resolving. Therefore, the \c skipArcs() should be used too, or
-    /// the useNodes() member function should be used to specify the
-    /// label of the nodes.
+    /// could not be read due to lack of node name resolving.
+    /// Therefore \c skipArcs() function should also be used, or
+    /// \c useNodes() should be used to specify the label of the nodes.
     DigraphReader& skipNodes() {
       LEMON_ASSERT(!_skip_nodes, "Skip nodes already set"); 
       _skip_nodes = true;
@@ -799,7 +798,7 @@
     /// \brief Skips the reading of arc section
     ///
     /// Omit the reading of the arc section. This implies that each arc
-    /// map reading rule will be abanoned, and the arcs of the graph
+    /// map reading rule will be abandoned, and the arcs of the graph
     /// will not be constructed.
     DigraphReader& skipArcs() {
       LEMON_ASSERT(!_skip_arcs, "Skip arcs already set"); 
@@ -1175,6 +1174,9 @@
     
   };
 
+  /// \brief Return a \ref DigraphReader class
+  /// 
+  /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
   template <typename Digraph>
   DigraphReader<Digraph> digraphReader(std::istream& is, Digraph& digraph) {
@@ -1182,6 +1184,9 @@
     return tmp;
   }
 
+  /// \brief Return a \ref DigraphReader class
+  /// 
+  /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
   template <typename Digraph>
   DigraphReader<Digraph> digraphReader(const std::string& fn, 
@@ -1190,6 +1195,9 @@
     return tmp;
   }
 
+  /// \brief Return a \ref DigraphReader class
+  /// 
+  /// This function just returns a \ref DigraphReader class.
   /// \relates DigraphReader
   template <typename Digraph>
   DigraphReader<Digraph> digraphReader(const char* fn, Digraph& digraph) {
@@ -1211,9 +1219,13 @@
 
   /// \ingroup lemon_io
   ///  
-  /// \brief LGF reader for undirected graphs
+  /// \brief \ref lgf-format "LGF" reader for undirected graphs
   ///
   /// This utility reads an \ref lgf-format "LGF" file.
+  ///
+  /// It can be used almost the same way as \c DigraphReader.
+  /// The only difference is that this class can handle edges and
+  /// edge maps as well as arcs and arc maps.
   template <typename _Graph>
   class GraphReader {
   public:
@@ -1262,7 +1274,7 @@
 
     /// \brief Constructor
     ///
-    /// Construct a undirected graph reader, which reads from the given
+    /// Construct an undirected graph reader, which reads from the given
     /// input stream.
     GraphReader(std::istream& is, Graph& graph) 
       : _is(&is), local_is(false), _graph(graph),
@@ -1271,7 +1283,7 @@
 
     /// \brief Constructor
     ///
-    /// Construct a undirected graph reader, which reads from the given
+    /// Construct an undirected graph reader, which reads from the given
     /// file.
     GraphReader(const std::string& fn, Graph& graph) 
       : _is(new std::ifstream(fn.c_str())), local_is(true), _graph(graph),
@@ -1280,7 +1292,7 @@
     
     /// \brief Constructor
     ///
-    /// Construct a undirected graph reader, which reads from the given
+    /// Construct an undirected graph reader, which reads from the given
     /// file.
     GraphReader(const char* fn, Graph& graph) 
       : _is(new std::ifstream(fn)), local_is(true), _graph(graph),
@@ -1497,7 +1509,7 @@
 
     /// \brief Set \c \@nodes section to be read
     ///
-    /// Set \c \@nodes section to be read
+    /// Set \c \@nodes section to be read.
     GraphReader& nodes(const std::string& caption) {
       _nodes_caption = caption;
       return *this;
@@ -1505,7 +1517,7 @@
 
     /// \brief Set \c \@edges section to be read
     ///
-    /// Set \c \@edges section to be read
+    /// Set \c \@edges section to be read.
     GraphReader& edges(const std::string& caption) {
       _edges_caption = caption;
       return *this;
@@ -1513,7 +1525,7 @@
 
     /// \brief Set \c \@attributes section to be read
     ///
-    /// Set \c \@attributes section to be read
+    /// Set \c \@attributes section to be read.
     GraphReader& attributes(const std::string& caption) {
       _attributes_caption = caption;
       return *this;
@@ -1544,7 +1556,7 @@
     ///
     /// Use previously constructed node set, and specify the node
     /// label map and a functor which converts the label map values to
-    /// std::string.
+    /// \c std::string.
     template <typename Map, typename Converter>
     GraphReader& useNodes(const Map& map, 
 			    const Converter& converter = Converter()) {
@@ -1577,7 +1589,7 @@
     ///
     /// Use previously constructed edge set, and specify the edge
     /// label map and a functor which converts the label map values to
-    /// std::string.
+    /// \c std::string.
     template <typename Map, typename Converter>
     GraphReader& useEdges(const Map& map, 
 			    const Converter& converter = Converter()) {
@@ -1590,25 +1602,25 @@



More information about the Lemon-commits mailing list