# HG changeset patch # User athos # Date 1119980795 0 # Node ID 3216612781375a06c274f984aacffacba142d15c # Parent 5815b382421b82dfe07e2b555a16638de3a2a570 Some corrections to graph_io.dox (mainly language corrections). Improvements on quicktour. diff -r 5815b382421b -r 321661278137 doc/graph_io.dox --- a/doc/graph_io.dox Tue Jun 28 13:47:16 2005 +0000 +++ b/doc/graph_io.dox Tue Jun 28 17:46:35 2005 +0000 @@ -4,23 +4,26 @@ \page graph-io-page Graph Input-Output -The standard graph IO makes possible to store graphs and additional maps +The standard graph IO enables to store graphs and additional maps in a flexible and efficient way. \section format The general file format -The graph file contains at most four section in the next order: +The file contains at most four sections in the following order: \li nodeset \li edgeset \li nodes \li edges -The nodeset section starts with the \c \@nodeset line. -The next line contains the names of the maps separated by whitespaces. -Each following line describes a node in the graph, it contains -in the right order the values of the maps. The map named "id" should contain -unique values because it regarded as ID-map. +The nodeset section starts with the following line: + +\@nodeset + +The next line contains the names of the nodemaps, separated by whitespaces. Each +following line describes a node in the graph: it contains the values of the +maps in the right order. The map named "id" should contain unique values +because it is regarded as an ID-map. For example: \code @nodeset @@ -31,10 +34,14 @@ \endcode The edgeset section is very similar to the nodeset section, it has -same coloumn oriented structure. It starts with the line \c \@edgeset -The next line contains the whitespace separated list of names of the map. +the same coloumn oriented structure. It starts with the line + +\@edgeset + +The next line contains the whitespace separated list of names of the maps. Each of the next lines describes one edge. The first two elements in the line -are the ID of the source and target node as they occur in the ID node map. +are the IDs of the source and target (or tail and head) node of the edge as they occur in the ID node +map. You can also have an optional ID map on the edges for later reference. \code @edgeset @@ -46,8 +53,11 @@ The next section contains labeled nodes (i.e. nodes having a special label on them). The section starts with -\c \@nodes. Each of the next lines contains a label for a node in the graph -and then the ID described in the nodeset. + + \@nodes + +Each of the next lines contains a label for a node in the graph +and then the ID described in the nodeset section. \code @nodes @@ -64,18 +74,20 @@ observed c \endcode -The file ends with the \c \@end line. The file may contain empty lines and comment lines. The comment lines start with an \c # character. -\code -@end -\endcode +The file ends with the + + \@end + +line. + \section use Using graph input-output -The graph input and output based on writing and reading commands. The user -adds writing and reading commands for the reader or writer class, then +The graph input and output is based on reading and writing commands. The user +adds reading and writing commands to the reader or writer class, then he calls the \c run() method that executes all the given commands. \subsection write Writing a graph @@ -90,8 +102,8 @@ \endcode The \c writeNodeMap() function declares a \c NodeMap writing command in the -\c GraphWriter. You should give as parameter the name of the map and the map -object. The NodeMap writing command with name "id" should write a +\c GraphWriter. You should give a name of the map and the map +object as parameters. The NodeMap writing command with name "id" should write a unique map because it is regarded as ID map. \see IdMap, DescriptorMap @@ -109,6 +121,7 @@ writing command similar to the NodeMaps. \see IdMap, DescriptorMap + \code DescriptorMap > edgeDescMap(graph); writer.writeEdgeMap("descriptor", edgeDescMap); @@ -117,9 +130,9 @@ writer.writeEdgeMap("label", labelMap); \endcode -With \c writeNode() and \c writeEdge() functions you can point out Nodes and -Edges in the graph. By example, you can write out the source and target -of the graph. +With \c writeNode() and \c writeEdge() functions you can designate Nodes and +Edges in the graph. For example, you can write out the source and target node +of a maximum flow instance. \code writer.writeNode("source", sourceNode); @@ -129,7 +142,7 @@ \endcode After you give all write commands you must call the \c run() member -function, which execute all the writer commands. +function, which executes all the writing commands. \code writer.run(); @@ -140,10 +153,10 @@ The given file format may contain several maps and labeled nodes or edges. If you read a graph you need not read all the maps and items just those that you need. The interface of the \c GraphReader is very similar to -the GraphWriter but the reading method does not depend on the order the +the GraphWriter but the reading method does not depend on the order of the given commands. -The reader object suppose that each not readed value does not contain +The reader object assumes that each not readed value does not contain whitespaces, therefore it has some extra possibilities to control how it should skip the values when the string representation contains spaces. @@ -152,11 +165,12 @@ \endcode The \c readNodeMap() function reads a map from the \c \@nodeset section. -If there is a map that you do not want to read from the file and there is -whitespace in the string represenation of the values then you should +If there is a map that you do not want to read from the file and there are +whitespaces in the string represenation of the values then you should call the \c skipNodeMap() template member function with proper parameters. \see QuotedStringReader + \code reader.readNodeMap("x-coord", xCoordMap); reader.readNodeMap("y-coord", yCoordMap); @@ -186,14 +200,14 @@ \endcode After you give all read commands you must call the \c run() member -function, which execute all the commands. +function, which executes all the commands. \code reader.run(); \endcode -\section types The background of the Reading and Writing -The \c GraphReader should know how can read a Value from the given map. +\section types The background of Reading and Writing +The \c GraphReader should know how to read a Value from the given map. By the default implementation the input operator reads a value from the stream and the type of the readed value is the value type of the given map. When the reader should skip a value in the stream, because you do not diff -r 5815b382421b -r 321661278137 doc/quicktour.dox --- a/doc/quicktour.dox Tue Jun 28 13:47:16 2005 +0000 +++ b/doc/quicktour.dox Tue Jun 28 17:46:35 2005 +0000 @@ -24,14 +24,29 @@ Some examples are the following (you will find links next to the code fragments that help to download full demo programs: save them on your computer and compile them according to the description in the page about \ref getsart How to start using LEMON): -