# HG changeset patch # User athos # Date 1120574170 0 # Node ID 7d028a73d7f2dfea6f69be01f3aa408321acfec4 # Parent 8f589de42c76c5b59d409e9ca2ab45a4acc7a91c Documented Balazs's stuff. Quite enough of that. diff -r 8f589de42c76 -r 7d028a73d7f2 demo/sample.lgf --- a/demo/sample.lgf Mon Jul 04 17:51:07 2005 +0000 +++ b/demo/sample.lgf Tue Jul 05 14:36:10 2005 +0000 @@ -15,6 +15,7 @@ 1 3 2 5 0 2 1 10 0 1 0 10 +#This is a comment here @nodes source 0 target 5 diff -r 8f589de42c76 -r 7d028a73d7f2 doc/graph_io.dox --- a/doc/graph_io.dox Mon Jul 04 17:51:07 2005 +0000 +++ b/doc/graph_io.dox Tue Jul 05 14:36:10 2005 +0000 @@ -4,8 +4,10 @@ \page graph-io-page Graph Input-Output -The standard graph IO enables to store graphs and additional maps -in a flexible and efficient way. +The standard graph IO enables one to store graphs and additional maps +(i.e. functions on the nodes or edges) in a flexible and efficient way. +Before you read this page you should be familiar with LEMON +\ref graphs "graphs" and \ref maps-page "maps". \section format The general file format @@ -17,14 +19,21 @@ \li edges \li attributes -The nodeset section starts with the following line: +Some of these sections can be omitted, but you will basicly need the nodeset +section (unless your graph has no nodes at all) and the edgeset section +(unless your graph has no edges at all). + +The nodeset section describes the nodes of your graph: it identifies the nodes +and gives the maps defined on them, if any. It 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: +because it is regarded as an ID-map. These ids need not be numbers but they +must identify the nodes uniquely for later reference. For example: \code @nodeset @@ -39,10 +48,12 @@ \@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 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. +The next line contains the whitespace separated list of names of the edge +maps. Each of the next lines describes one edge. The first two elements in +the line are the IDs of the source and target (or tail and head) nodes of the +edge as they occur in the ID node map of the nodeset section. You can also +have an optional ID map on the edges for later reference (which has to be +unique in this case). \code @edgeset @@ -52,13 +63,14 @@ 3 12 g 3.4 g-edge \endcode -The next section contains labeled nodes (i.e. nodes having a special +The \e nodes section contains labeled (distinguished) nodes +(i.e. nodes having a special label on them). The section starts with \@nodes Each of the next lines contains a label for a node in the graph -and then the ID described in the nodeset section. +and then the ID as described in the \e nodeset section. \code @nodes @@ -66,12 +78,12 @@ target 12 \endcode -The last section describes the labeled edges +The last section describes the labeled (distinguished) edges (i.e. edges having a special label on them). It starts with \c \@edges and then each line contains the name of the edge and the ID. \code -@nodes +@edges observed c \endcode @@ -80,8 +92,8 @@ start with an \c # character. The attributes section can handle some information about the graph. It -contains in each line an key and the mapped value to key. The key should -be a string without whitespace, the value can be from various type. +contains key-value pairs in each line (a key and the mapped value to key). The +key should be a string without whitespaces, the value can be of various types. \code @attributes @@ -91,27 +103,28 @@ version 12 \endcode -\code -@end -\endcode -======= -The file ends with the - \@end line. \section use Using graph input-output -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. + +The easiest way of using graph input and output is using the versions of the + public \ref readGraph() and \ref writeGraph() functions; if you don't need + very sophisticated behaviour then you might be satisfied with + those. Otherwise go on reading this page. + +The graph input and output is based on reading and writing +commands. The user gives 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 The \c GraphWriter class provides the graph output. To write a graph you should first give writing commands to the writer. You can declare -write command as \c NodeMap or \c EdgeMap writing and labeled Node and +writing command as \c NodeMap or \c EdgeMap writing and labeled Node and Edge writing. \code @@ -119,9 +132,9 @@ \endcode The \c writeNodeMap() function declares a \c NodeMap writing command in the -\c GraphWriter. You should give a name of the map and the map +\c GraphWriter. You should give a name to 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. +unique map because it will be regarded as an ID map. \see IdMap, DescriptorMap @@ -174,7 +187,7 @@ \subsection reading Reading a graph -The given file format may contain several maps and labeled nodes or edges. +The file to be read 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 of the @@ -188,7 +201,7 @@ GraphReader reader(std::cin, graph); \endcode -The \c readNodeMap() function reads a map from the \c \@nodeset section. +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 are whitespaces in the string represenation of the values then you should call the \c skipNodeMap() template member function with proper parameters. @@ -239,14 +252,17 @@ reader.run(); \endcode +\anchor rwbackground \section types Background of Reading and Writing + + To read a map (on the nodes or edges) 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 want to store it in a map, the reader skips a character sequence without -whitespace. +whitespaces. If you want to change the functionality of the reader, you can use template parameters to specialize it. When you give a reading @@ -264,7 +280,7 @@ \endcode For example, the \c "strings" nodemap contains strings and you do not need -the value of the string just the length. Then you can implement own Reader +the value of the string just the length. Then you can implement an own Reader struct. \code @@ -284,21 +300,22 @@ The global functionality of the reader class can be changed by giving a special template parameter to the GraphReader class. By default, the template parameter is \c DefaultReaderTraits. A reader traits class -should provide an inner template class Reader for each type, and an +should provide an inner template class Reader for each type, and a DefaultReader for skipping a value. -The specialization of writing should be very similar to that of reading. +The specialization of writing is very similar to that of reading. -\section undir Undir graphs +\section undir Undirected graphs -In the undir graph format there is an \c undiredgeset section instead of -the \c edgeset section. The first line of the section describes the -undirected egdes' names and all next lines describes one undirected edge -with the the incident nodes and the values of the map. +In a file describing an undirected graph (undir graph, for short) you find an +\c undiredgeset section instead of the \c edgeset section. The first line of +the section describes the names of the maps on the undirected egdes and all +next lines describe one undirected edge with the the incident nodes and the +values of the map. -The format handles the directed edge maps as a syntactical sugar, if there -is two map which names are the same with a \c '+' and a \c '-' prefix -then it can be read as an directed map. +The format handles directed edge maps as a syntactical sugar???, if there +are two maps with names being the same with a \c '+' and a \c '-' prefix +then this will be read as a directed map. \code @undiredgeset @@ -308,9 +325,9 @@ 21 12 8 3.4 0.0 0.0 \endcode -The \c edges section changed to \c undiredges section. This section +The \c edges section is changed to \c undiredges section. This section describes labeled edges and undirected edges. The directed edge label -should start with a \c '+' and a \c '-' prefix what decide the direction +should start with a \c '+' or a \c '-' prefix to decide the direction of the edge. \code @@ -337,12 +354,13 @@ \section advanced Advanced features -The graph reader and writer classes gives an easy way to read and write -graphs. But sometimes we want more advanced features. This way we can -use the more general lemon reader and writer interface. +The graph reader and writer classes give an easy way to read and write +graphs. But sometimes we want more advanced features. In this case we can +use the more general lemon reader and writer interface. -The lemon format is an section oriented file format. It contains one or -more section, each starts with a line with \c \@ first character. +The LEMON file format is a section oriented file format. It contains one or +more sections, each starting with a line identifying its type +(the word starting with the \c \@ character). The content of the section this way cannot contain line with \c \@ first character. The file may contains comment lines with \c # first character. @@ -351,7 +369,7 @@ classes which can be attached to a \c LemonReader or a \c LemonWriter. There are default section readers and writers for reading and writing -item sets, and labeled items in the graph. These reads and writes +item sets, and labeled items in the graph. These read and write the format described above. Other type of data can be handled with own section reader and writer classes which are inherited from the \c LemonReader::SectionReader or the \c LemonWriter::SectionWriter classes. @@ -392,11 +410,11 @@ The other advanced stuff of the generalized file format is that multiple edgesets can be stored to the same nodeset. It can be used -by example as a network traffic matrix. +for example as a network traffic matrix. -In example there is a network with symmetric links and there are assymetric +In our example there is a network with symmetric links and there are assymetric traffic request on the network. This construction can be stored in an -undirected graph and in an directed NewEdgeSetAdaptor class. The example +undirected graph and in a directed NewEdgeSetAdaptor class. The example shows the input with the LemonReader class: \code @@ -417,7 +435,7 @@ Because the GraphReader and the UndirGraphReader can be converted to LemonReader and it can resolve the ID's of the items, the previous -result can be achived with the UndirGraphReader class also. +result can be achived with the UndirGraphReader class, too. \code diff -r 8f589de42c76 -r 7d028a73d7f2 lemon/dfs.h --- a/lemon/dfs.h Mon Jul 04 17:51:07 2005 +0000 +++ b/lemon/dfs.h Tue Jul 05 14:36:10 2005 +0000 @@ -644,7 +644,7 @@ /// ///\return The length of the %DFS s---t path if there exists one, ///0 otherwise. - ///\note Apart from the return value, d.run(s) is + ///\note Apart from the return value, d.run(s,t) is ///just a shortcut of the following code. ///\code /// d.init(); diff -r 8f589de42c76 -r 7d028a73d7f2 lemon/graph_reader.h --- a/lemon/graph_reader.h Mon Jul 04 17:51:07 2005 +0000 +++ b/lemon/graph_reader.h Tue Jul 05 14:36:10 2005 +0000 @@ -36,19 +36,21 @@ /// The \c GraphReader class provides the graph input. /// Before you read this documentation it might be useful to read the general /// description of \ref graph-io-page "Graph Input-Output". + /// /// If you don't need very sophisticated /// behaviour then you can use the versions of the public function /// \ref readGraph() to read a graph (or a max flow instance etc). /// - /// The given file format may contain several maps and labeled nodes or + /// The file to be read 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 - /// given commands. + /// given commands (i.e. you don't have to insist on the order in which the + /// maps are given in the file). /// - /// The reader object suppose that each not readed value does not contain + /// The reader object assumes that not readed values do not contain /// whitespaces, therefore it has some extra possibilities to control how /// it should skip the values when the string representation contains spaces. /// @@ -90,11 +92,11 @@ /// \endcode /// /// With the \c readAttribute() functions you can read an attribute - /// in a variable. You can specify the reader for the attribute as + /// into a variable. You can specify the reader for the attribute as /// the nodemaps. /// /// 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(); @@ -119,7 +121,7 @@ /// \brief Construct a new GraphReader. /// /// Construct a new GraphReader. It reads into the given graph - /// and it use the given reader as the default skipper. + /// and it uses the given reader as the default skipper. GraphReader(std::istream& _is, typename SmartParameter::Type _graph, const DefaultSkipper& _skipper = DefaultSkipper()) @@ -134,7 +136,7 @@ /// \brief Construct a new GraphReader. /// /// Construct a new GraphReader. It reads into the given graph - /// and it use the given reader as the default skipper. + /// and it uses the given reader as the default skipper. GraphReader(const std::string& _filename, typename SmartParameter::Type _graph, const DefaultSkipper& _skipper = DefaultSkipper()) @@ -150,7 +152,7 @@ /// \brief Construct a new GraphReader. /// /// Construct a new GraphReader. It reads into the given graph - /// and it use the given reader as the default skipper. + /// and it uses the given reader as the default skipper. GraphReader(LemonReader& _reader, typename SmartParameter::Type _graph, const DefaultSkipper& _skipper = DefaultSkipper()) @@ -170,9 +172,9 @@ delete reader; } - /// \brief Add a new node map reader command for the reader. + /// \brief Give a new node map reading command to the reader. /// - /// Add a new node map reader command for the reader. + /// Give a new node map reading command to the reader. template GraphReader& readNodeMap(std::string name, Map& map) { nodeset_reader.readNodeMap(name, map); @@ -185,9 +187,9 @@ return *this; } - /// \brief Add a new node map reader command for the reader. + /// \brief Give a new node map reading command to the reader. /// - /// Add a new node map reader command for the reader. + /// Give a new node map reading command to the reader. template GraphReader& readNodeMap(std::string name, Map& map, const Reader& reader = Reader()) { @@ -202,9 +204,9 @@ return *this; } - /// \brief Add a new node map skipper command for the reader. + /// \brief Give a new node map skipping command to the reader. /// - /// Add a new node map skipper command for the reader. + /// Give a new node map skipping command to the reader. template GraphReader& skipNodeMap(std::string name, const Reader& reader = Reader()) { @@ -212,9 +214,9 @@ return *this; } - /// \brief Add a new edge map reader command for the reader. + /// \brief Give a new edge map reading command to the reader. /// - /// Add a new edge map reader command for the reader. + /// Give a new edge map reading command to the reader. template GraphReader& readEdgeMap(std::string name, Map& map) { edgeset_reader.readEdgeMap(name, map); @@ -228,9 +230,9 @@ } - /// \brief Add a new edge map reader command for the reader. + /// \brief Give a new edge map reading command to the reader. /// - /// Add a new edge map reader command for the reader. + /// Give a new edge map reading command to the reader. template GraphReader& readEdgeMap(std::string name, Map& map, const Reader& reader = Reader()) { @@ -245,9 +247,9 @@ return *this; } - /// \brief Add a new edge map skipper command for the reader. + /// \brief Give a new edge map skipping command to the reader. /// - /// Add a new edge map skipper command for the reader. + /// Give a new edge map skipping command to the reader. template GraphReader& skipEdgeMap(std::string name, const Reader& reader = Reader()) { @@ -255,34 +257,34 @@ return *this; } - /// \brief Add a new labeled node reader for the reader. + /// \brief Give a new labeled node reading command to the reader. /// - /// Add a new labeled node reader for the reader. + /// Give a new labeled node reading command to the reader. GraphReader& readNode(std::string name, Node& node) { node_reader.readNode(name, node); return *this; } - /// \brief Add a new labeled edge reader for the reader. + /// \brief Give a new labeled edge reading command to the reader. /// - /// Add a new labeled edge reader for the reader. + /// Give a new labeled edge reading command to the reader. GraphReader& readEdge(std::string name, Edge& edge) { edge_reader.readEdge(name, edge); return *this; } - /// \brief Add a new attribute reader command. + /// \brief Give a new attribute reading command. /// - /// Add a new attribute reader command. + /// Give a new attribute reading command. template GraphReader& readAttribute(std::string name, Value& value) { attribute_reader.readAttribute(name, value); return *this; } - /// \brief Add a new attribute reader command. + /// \brief Give a new attribute reading command. /// - /// Add a new attribute reader command. + /// Give a new attribute reading command. template GraphReader& readAttribute(std::string name, Value& value, const Reader& reader) { @@ -292,17 +294,17 @@ /// \brief Conversion operator to LemonReader. /// - /// Conversion operator to LemonReader. It make possible - /// to access the encapsulated \e LemonReader, this way - /// you can attach to this reader new instances of - /// \e LemonReader::SectionReader. + /// Conversion operator to LemonReader. It makes possible to access the + /// encapsulated \e LemonReader, this way you can attach to this reader + /// new instances of \e LemonReader::SectionReader. For more details see + /// the \ref rwbackground "Background of Reading and Writing". operator LemonReader&() { return *reader; } - /// \brief Executes the reader commands. + /// \brief Executes the reading commands. /// - /// Executes the reader commands. + /// Executes the reading commands. void run() { reader->run(); } @@ -432,13 +434,21 @@ /// \brief The undir graph reader class. /// + /// The \c UndirGraphReader class provides the graph input. + /// Before you read this documentation it might be useful to read the general + /// description of \ref graph-io-page "Graph Input-Output". + /// + /// If you don't need very sophisticated + /// behaviour then you can use the versions of the public function + /// \ref readGraph() to read a graph (or a max flow instance etc). + /// /// 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 - /// given commands. + /// that you need. The interface of the \c UndirGraphReader is very similar + /// to the UndirGraphWriter 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 /// whitespaces, therefore it has some extra possibilities to control how @@ -569,9 +579,9 @@ delete reader; } - /// \brief Add a new node map reader command for the reader. + /// \brief Give a new node map reading command to the reader. /// - /// Add a new node map reader command for the reader. + /// Give a new node map reading command to the reader. template UndirGraphReader& readNodeMap(std::string name, Map& map) { nodeset_reader.readNodeMap(name, map); @@ -584,9 +594,9 @@ return *this; } - /// \brief Add a new node map reader command for the reader. + /// \brief Give a new node map reading command to the reader. /// - /// Add a new node map reader command for the reader. + /// Give a new node map reading command to the reader. template UndirGraphReader& readNodeMap(std::string name, Map& map, const Reader& reader = Reader()) { @@ -601,9 +611,9 @@ return *this; } - /// \brief Add a new node map skipper command for the reader. + /// \brief Give a new node map skipping command to the reader. /// - /// Add a new node map skipper command for the reader. + /// Give a new node map skipping command to the reader. template UndirGraphReader& skipNodeMap(std::string name, const Reader& reader = Reader()) { @@ -611,9 +621,9 @@ return *this; } - /// \brief Add a new undirected edge map reader command for the reader. + /// \brief Give a new undirected edge map reading command to the reader. /// - /// Add a new undirected edge map reader command for the reader. + /// Give a new undirected edge map reading command to the reader. template UndirGraphReader& readUndirEdgeMap(std::string name, Map& map) { undir_edgeset_reader.readUndirEdgeMap(name, map); @@ -627,9 +637,9 @@ } - /// \brief Add a new undirected edge map reader command for the reader. + /// \brief Give a new undirected edge map reading command to the reader. /// - /// Add a new undirected edge map reader command for the reader. + /// Give a new undirected edge map reading command to the reader. template UndirGraphReader& readUndirEdgeMap(std::string name, Map& map, const Reader& reader = Reader()) { @@ -644,9 +654,9 @@ return *this; } - /// \brief Add a new undirected edge map skipper command for the reader. + /// \brief Give a new undirected edge map skipping command to the reader. /// - /// Add a new undirected edge map skipper command for the reader. + /// Give a new undirected edge map skipping command to the reader. template UndirGraphReader& skipUndirEdgeMap(std::string name, const Reader& reader = Reader()) { @@ -655,9 +665,9 @@ } - /// \brief Add a new edge map reader command for the reader. + /// \brief Give a new edge map reading command to the reader. /// - /// Add a new edge map reader command for the reader. + /// Give a new edge map reading command to the reader. template UndirGraphReader& readEdgeMap(std::string name, Map& map) { undir_edgeset_reader.readEdgeMap(name, map); @@ -671,9 +681,9 @@ } - /// \brief Add a new edge map reader command for the reader. + /// \brief Give a new edge map reading command to the reader. /// - /// Add a new edge map reader command for the reader. + /// Give a new edge map reading command to the reader. template UndirGraphReader& readEdgeMap(std::string name, Map& map, const Reader& reader = Reader()) { @@ -688,9 +698,9 @@ return *this; } - /// \brief Add a new edge map skipper command for the reader. + /// \brief Give a new edge map skipping command to the reader. /// - /// Add a new edge map skipper command for the reader. + /// Give a new edge map skipping command to the reader. template UndirGraphReader& skipEdgeMap(std::string name, const Reader& reader = Reader()) { @@ -698,40 +708,41 @@ return *this; } - /// \brief Add a new labeled node reader for the reader. + /// \brief Give a new labeled node reading command to the reader. /// - /// Add a new labeled node reader for the reader. + /// Give a new labeled node reading command to the reader. UndirGraphReader& readNode(std::string name, Node& node) { node_reader.readNode(name, node); return *this; } - /// \brief Add a new labeled edge reader for the reader. + /// \brief Give a new labeled edge reading command to the reader. /// - /// Add a new labeled edge reader for the reader. + /// Give a new labeled edge reading command to the reader. UndirGraphReader& readEdge(std::string name, Edge& edge) { undir_edge_reader.readEdge(name, edge); } - /// \brief Add a new labeled undirected edge reader for the reader. + /// \brief Give a new labeled undirected edge reading command to the + /// reader. /// - /// Add a new labeled undirected edge reader for the reader. + /// Give a new labeled undirected edge reading command to the reader. UndirGraphReader& readUndirEdge(std::string name, UndirEdge& edge) { undir_edge_reader.readUndirEdge(name, edge); } - /// \brief Add a new attribute reader command. + /// \brief Give a new attribute reading command. /// - /// Add a new attribute reader command. + /// Give a new attribute reading command. template UndirGraphReader& readAttribute(std::string name, Value& value) { attribute_reader.readAttribute(name, value); return *this; } - /// \brief Add a new attribute reader command. + /// \brief Give a new attribute reading command. /// - /// Add a new attribute reader command. + /// Give a new attribute reading command. template UndirGraphReader& readAttribute(std::string name, Value& value, const Reader& reader) { @@ -749,9 +760,9 @@ return *reader; } - /// \brief Executes the reader commands. + /// \brief Executes the reading commands. /// - /// Executes the reader commands. + /// Executes the reading commands. void run() { reader->run(); } diff -r 8f589de42c76 -r 7d028a73d7f2 lemon/graph_utils.h --- a/lemon/graph_utils.h Mon Jul 04 17:51:07 2005 +0000 +++ b/lemon/graph_utils.h Tue Jul 05 14:36:10 2005 +0000 @@ -30,8 +30,6 @@ ///\file ///\brief Graph utilities. /// -///\todo Please -///revise the documentation. /// @@ -42,7 +40,7 @@ /// \brief Function to count the items in the graph. /// - /// This function counts the items in the graph. + /// This function counts the items (nodes, edges etc) in the graph. /// The complexity of the function is O(n) because /// it iterates on all of the items. @@ -125,7 +123,7 @@ /// /// This function counts the undirected edges in the graph. /// The complexity of the function is O(e) but for some - /// graph structure it is specialized to run in O(1). + /// graph structures it is specialized to run in O(1). template inline int countUndirEdges(const Graph& g) { @@ -193,11 +191,11 @@ return e; } - /// \brief Copy the source map to the target map. + /// \brief Copy a map. /// - /// Copy the \c source map to the \c target map. It uses the given iterator - /// to iterate on the data structure and it use the \c ref mapping to - /// convert the source's keys to the target's keys. + /// Thsi function copies the \c source map to the \c target map. It uses the + /// given iterator to iterate on the data structure and it uses the \c ref + /// mapping to convert the source's keys to the target's keys. template void copyMap(Target& target, const Source& source, @@ -220,10 +218,10 @@ } - /// \brief Class to copy a graph to an other graph. + /// \brief Class to copy a graph. /// - /// Class to copy a graph to an other graph. It can be used easier - /// with the \c copyGraph() function. + /// Class to copy a graph to an other graph (duplicate a graph). The + /// simplest way of using it is through the \c copyGraph() function. template class GraphCopy { public: @@ -354,7 +352,7 @@ /// /// After the copy the \c nr map will contain the mapping from the /// source graph's nodes to the target graph's nodes and the \c ecr will - /// contain the mapping from the target graph's edge to the source's + /// contain the mapping from the target graph's edges to the source's /// edges. template GraphCopy copyGraph(Target& target, const Source& source) { @@ -458,8 +456,13 @@ /// Provides an immutable and unique id for each item in the graph. - /// The IdMap class provides a unique and immutable mapping for each item - /// in the graph. + /// The IdMap class provides a unique and immutable id for each item of the + /// same type (e.g. node) in the graph. This id is
  • \b unique: + /// different items (nodes) get different ids
  • \b immutable: the id of an + /// item (node) does not change (even if you delete other nodes).
+ /// Through this map you get access (i.e. can read) the inner id values of + /// the items stored in the graph. This map can be inverted with its member + /// class \c InverseMap. /// template class IdMap { @@ -487,9 +490,9 @@ public: - /// \brief The class represents the inverse of the map. + /// \brief The class represents the inverse of its owner (IdMap). /// - /// The class represents the inverse of the map. + /// The class represents the inverse of its owner (IdMap). /// \see inverse() class InverseMap { public: @@ -517,7 +520,7 @@ /// \brief Gives back the inverse of the map. /// - /// Gives back the inverse of the map. + /// Gives back the inverse of the IdMap. InverseMap inverse() const { return InverseMap(*graph);} }; @@ -525,7 +528,7 @@ /// \brief General invertable graph-map type. - /// This type provides simple invertable map functions. + /// This type provides simple invertable graph-maps. /// The InvertableMap wraps an arbitrary ReadWriteMap /// and if a key is set to a new value then store it /// in the inverse map. @@ -658,9 +661,14 @@ /// \brief Provides a mutable, continuous and unique descriptor for each /// item in the graph. /// - /// The DescriptorMap class provides a mutable, continuous and immutable - /// mapping for each item in the graph. The value for an item may mutated - /// on each operation when the an item erased or added to graph. + /// The DescriptorMap class provides a unique and continuous (but mutable) + /// descriptor (id) for each item of the same type (e.g. node) in the + /// graph. This id is
  • \b unique: different items (nodes) get + /// different ids
  • \b continuous: the range of the ids is the set of + /// integers between 0 and \c n-1, where \c n is the number of the items of + /// this type (e.g. nodes) (so the id of a node can change if you delete an + /// other node, i.e. this id is mutable).
This map can be inverted + /// with its member class \c InverseMap. /// /// \param _Graph The graph class the \c DescriptorMap belongs to. /// \param _Item The Item is the Key of the Map. It may be Node, Edge or @@ -754,9 +762,9 @@ Container invMap; public: - /// \brief The inverse map type. + /// \brief The inverse map type of DescriptorMap. /// - /// The inverse map type. + /// The inverse map type of DescriptorMap. class InverseMap { public: /// \brief Constructor of the InverseMap. @@ -873,16 +881,16 @@ /// \brief Returns a \ref TargetMap class /// - /// This function just returns an \ref TargetMap class. + /// This function just returns a \ref TargetMap class. /// \relates TargetMap template inline TargetMap targetMap(const Graph& graph) { return TargetMap(graph); } - /// \brief Returns the "forward" directed edge view of undirected edge. + /// \brief Returns the "forward" directed edge view of an undirected edge. /// - /// Returns the "forward" directed edge view of undirected edge. + /// Returns the "forward" directed edge view of an undirected edge. /// \author Balazs Dezso template class ForwardMap { @@ -921,9 +929,9 @@ return ForwardMap(graph); } - /// \brief Returns the "backward" directed edge view of undirected edge. + /// \brief Returns the "backward" directed edge view of an undirected edge. /// - /// Returns the "backward" directed edge view of undirected edge. + /// Returns the "backward" directed edge view of an undirected edge. /// \author Balazs Dezso template class BackwardMap { @@ -954,7 +962,7 @@ /// \brief Returns a \ref BackwardMap class - /// This function just returns an \ref BackwardMap class. + /// This function just returns a \ref BackwardMap class. /// \relates BackwardMap template inline BackwardMap backwardMap(const Graph& graph) { @@ -975,9 +983,9 @@ /// \brief Map of the node in-degrees. /// - /// This map returns the in-degree of a node. Ones it is constructed, + /// This map returns the in-degree of a node. Once it is constructed, /// the degrees are stored in a standard NodeMap, so each query is done - /// in constant time. On the other hand, the values updates automatically + /// in constant time. On the other hand, the values are updated automatically /// whenever the graph changes. /// /// \sa OutDegMap @@ -1067,9 +1075,9 @@ /// \brief Map of the node out-degrees. /// - /// This map returns the out-degree of a node. One it is constructed, + /// This map returns the out-degree of a node. Once it is constructed, /// the degrees are stored in a standard NodeMap, so each query is done - /// in constant time. On the other hand, the values updates automatically + /// in constant time. On the other hand, the values are updated automatically /// whenever the graph changes. /// /// \sa OutDegMap diff -r 8f589de42c76 -r 7d028a73d7f2 lemon/graph_writer.h --- a/lemon/graph_writer.h Mon Jul 04 17:51:07 2005 +0000 +++ b/lemon/graph_writer.h Tue Jul 05 14:36:10 2005 +0000 @@ -37,6 +37,7 @@ /// The \c GraphWriter class provides the graph output. /// Before you read this documentation it might be useful to read the general /// description of \ref graph-io-page "Graph Input-Output". + /// /// If you don't need very sophisticated /// behaviour then you can use the versions of the public function /// \ref writeGraph() to output a graph (or a max flow instance etc). @@ -164,6 +165,7 @@ return *this; } + /// \brief Issue a new node map writing command for the writer. /// /// This function issues a new node map writing command to the writer. @@ -238,7 +240,8 @@ /// Conversion operator to LemonWriter. It makes possible /// to access the encapsulated \e LemonWriter, this way /// you can attach to this writer new instances of - /// \e LemonWriter::SectionWriter. + /// \e LemonWriter::SectionWriter. For more details see + /// the \ref rwbackground "Background of Reading and Writing". operator LemonWriter&() { return *writer; } @@ -568,7 +571,7 @@ /// /// This function issues a new undirected edge map writing /// command to the writer. - template + template UndirGraphWriter& writeUndirEdgeMap(std::string name, const Map& map, const Writer& writer = Writer()) { undir_edgeset_writer.writeUndirEdgeMap(name, map, writer); diff -r 8f589de42c76 -r 7d028a73d7f2 lemon/lp_glpk.cc --- a/lemon/lp_glpk.cc Mon Jul 04 17:51:07 2005 +0000 +++ b/lemon/lp_glpk.cc Tue Jul 05 14:36:10 2005 +0000 @@ -445,7 +445,7 @@ switch (lpx_get_dual_stat(lp)) { case LPX_D_UNDEF://Undefined (no solve has been run yet) return UNDEFINED; - case LPX_D_NOFEAS://There is no feasible solution (primal, I guess) + case LPX_D_NOFEAS://There is no dual feasible solution // case LPX_D_INFEAS://Infeasible return INFEASIBLE; case LPX_D_FEAS://Feasible