[Lemon-commits] Alpar Juttner: Merge

Lemon HG hg at lemon.cs.elte.hu
Thu Jul 10 16:14:26 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/a5ee729dc1e1
changeset: 202:a5ee729dc1e1
user:      Alpar Juttner <alpar [at] cs.elte.hu>
date:      Thu Jul 10 16:13:50 2008 +0200
description:
	Merge

diffstat:

3 files changed, 22 insertions(+), 2 deletions(-)
doc/lgf.dox        |   12 ++++++++++--
lemon/lgf_reader.h |    6 ++++++
lemon/lgf_writer.h |    6 ++++++

diffs (56 lines):

diff -r c0e2c043c060 -r a5ee729dc1e1 doc/lgf.dox
--- a/doc/lgf.dox	Thu Jul 10 16:05:56 2008 +0200
+++ b/doc/lgf.dox	Thu Jul 10 16:13:50 2008 +0200
@@ -78,10 +78,18 @@
  2   3   18
 \endcode
 
-The \c \@edges is just a synonym of \c \@arcs.
+The \c \@edges is just a synonym of \c \@arcs. The @arcs section can
+also store the edge set of an undirected graph. In such case there is
+a conventional method for store arc maps in the file, if two columns
+has the same caption with \c '+' and \c '-' prefix, then these columns
+can be regarded as the values of an arc map.
 
 The \c \@attributes section contains key-value pairs, each line
-consists of two tokens, an attribute name, and then an attribute value.
+consists of two tokens, an attribute name, and then an attribute
+value. The value of the attribute could be also a label value of a
+node or an edge, or even an edge label prefixed with \c '+' or \c '-',
+which regards to the forward or backward directed arc of the
+corresponding edge.
 
 \code
  @attributes
diff -r c0e2c043c060 -r a5ee729dc1e1 lemon/lgf_reader.h
--- a/lemon/lgf_reader.h	Thu Jul 10 16:05:56 2008 +0200
+++ b/lemon/lgf_reader.h	Thu Jul 10 16:13:50 2008 +0200
@@ -1226,6 +1226,12 @@
   /// 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.
+  ///
+  /// The columns in the \c \@edges (or \c \@arcs) section are the
+  /// edge maps. However, if there are two maps with the same name
+  /// prefixed with \c '+' and \c '-', then these can be read into an
+  /// arc map.  Similarly, an attribute can be read into an arc, if
+  /// it's value is an edge label prefixed with \c '+' or \c '-'.
   template <typename _Graph>
   class GraphReader {
   public:
diff -r c0e2c043c060 -r a5ee729dc1e1 lemon/lgf_writer.h
--- a/lemon/lgf_writer.h	Thu Jul 10 16:05:56 2008 +0200
+++ b/lemon/lgf_writer.h	Thu Jul 10 16:13:50 2008 +0200
@@ -914,6 +914,12 @@
   /// It can be used almost the same way as \c DigraphWriter.
   /// The only difference is that this class can handle edges and
   /// edge maps as well as arcs and arc maps.
+  ///
+  /// The arc maps are written into the file as two columns, the
+  /// caption of the columns are the name of the map prefixed with \c
+  /// '+' and \c '-'. The arcs are written into the \c \@attributes
+  /// section as a \c '+' or a \c '-' prefix (depends on the direction
+  /// of the arc) and the label of corresponding edge.
   template <typename _Graph>
   class GraphWriter {
   public:



More information about the Lemon-commits mailing list