lemon/graph_writer.h
changeset 1952 6150d1cf0825
parent 1909 2d806130e700
child 1956 a055123339d5
equal deleted inserted replaced
7:a9c4cee68f43 8:4abaea55158f
    45   /// To write a graph
    45   /// To write a graph
    46   /// you should first give writing commands to the writer. You can declare
    46   /// you should first give writing commands to the writer. You can declare
    47   /// write commands as \c NodeMap or \c EdgeMap writing and labeled Node and
    47   /// write commands as \c NodeMap or \c EdgeMap writing and labeled Node and
    48   /// Edge writing.
    48   /// Edge writing.
    49   ///
    49   ///
    50   /// \code
    50   ///\code
    51   /// GraphWriter<ListGraph> writer(std::cout, graph);
    51   /// GraphWriter<ListGraph> writer(std::cout, graph);
    52   /// \endcode
    52   ///\endcode
    53   ///
    53   ///
    54   /// The \c writeNodeMap() function declares a \c NodeMap writing 
    54   /// The \c writeNodeMap() function declares a \c NodeMap writing 
    55   /// command in the \c GraphWriter. You should give as parameter 
    55   /// command in the \c GraphWriter. You should give as parameter 
    56   /// the name of the map and the map object. The NodeMap writing 
    56   /// the name of the map and the map object. The NodeMap writing 
    57   /// command with name "label" should write a unique map because it 
    57   /// command with name "label" should write a unique map because it 
    58   /// is regarded as label map (such a map is essential if the graph has edges).
    58   /// is regarded as label map (such a map is essential if the graph has edges).
    59   ///
    59   ///
    60   /// \code
    60   ///\code
    61   /// IdMap<ListGraph, Node> nodeLabelMap;
    61   /// IdMap<ListGraph, Node> nodeLabelMap;
    62   /// writer.writeNodeMap("label", nodeLabelMap);
    62   /// writer.writeNodeMap("label", nodeLabelMap);
    63   ///
    63   ///
    64   /// writer.writeNodeMap("coords", coords);
    64   /// writer.writeNodeMap("coords", coords);
    65   /// writer.writeNodeMap("color", colorMap);
    65   /// writer.writeNodeMap("color", colorMap);
    66   /// \endcode
    66   ///\endcode
    67   ///
    67   ///
    68   /// With the \c writeEdgeMap() member function you can give an edge map
    68   /// With the \c writeEdgeMap() member function you can give an edge map
    69   /// writing command similar to the NodeMaps.
    69   /// writing command similar to the NodeMaps.
    70   ///
    70   ///
    71   /// \code
    71   ///\code
    72   /// DescriptorMap<ListGraph, Edge, ListGraph::EdgeMap<int> > 
    72   /// DescriptorMap<ListGraph, Edge, ListGraph::EdgeMap<int> > 
    73   ///   edgeDescMap(graph);
    73   ///   edgeDescMap(graph);
    74   /// writer.writeEdgeMap("descriptor", edgeDescMap);
    74   /// writer.writeEdgeMap("descriptor", edgeDescMap);
    75   ///
    75   ///
    76   /// writer.writeEdgeMap("weight", weightMap);
    76   /// writer.writeEdgeMap("weight", weightMap);
    77   /// writer.writeEdgeMap("label", labelMap);
    77   /// writer.writeEdgeMap("label", labelMap);
    78   /// \endcode
    78   ///\endcode
    79   ///
    79   ///
    80   /// With \c writeNode() and \c writeEdge() functions you can 
    80   /// With \c writeNode() and \c writeEdge() functions you can 
    81   /// point out Nodes and Edges in the graph. For example, you can 
    81   /// point out Nodes and Edges in the graph. For example, you can 
    82   /// write out the source and target of a maximum flow instance.
    82   /// write out the source and target of a maximum flow instance.
    83   ///
    83   ///
    84   /// \code
    84   ///\code
    85   /// writer.writeNode("source", sourceNode);
    85   /// writer.writeNode("source", sourceNode);
    86   /// writer.writeNode("target", targetNode);
    86   /// writer.writeNode("target", targetNode);
    87   ///
    87   ///
    88   /// writer.writeEdge("observed", edge);
    88   /// writer.writeEdge("observed", edge);
    89   /// \endcode
    89   ///\endcode
    90   ///
    90   ///
    91   /// After you give all write commands you must call the \c run() member
    91   /// After you give all write commands you must call the \c run() member
    92   /// function, which executes all the writing commands.
    92   /// function, which executes all the writing commands.
    93   ///
    93   ///
    94   /// \code
    94   ///\code
    95   /// writer.run();
    95   /// writer.run();
    96   /// \endcode
    96   ///\endcode
    97   ///
    97   ///
    98   /// \see DefaultWriterTraits
    98   /// \see DefaultWriterTraits
    99   /// \see QuotedStringWriter
    99   /// \see QuotedStringWriter
   100   /// \see IdMap
   100   /// \see IdMap
   101   /// \see DescriptorMap
   101   /// \see DescriptorMap
   318   /// The \c UGraphWriter class provides the ugraph output. To write 
   318   /// The \c UGraphWriter class provides the ugraph output. To write 
   319   /// a graph you should first give writing commands to the writer. You can 
   319   /// a graph you should first give writing commands to the writer. You can 
   320   /// declare write command as \c NodeMap, \c EdgeMap or \c UEdgeMap 
   320   /// declare write command as \c NodeMap, \c EdgeMap or \c UEdgeMap 
   321   /// writing and labeled Node, Edge or UEdge writing.
   321   /// writing and labeled Node, Edge or UEdge writing.
   322   ///
   322   ///
   323   /// \code
   323   ///\code
   324   /// UGraphWriter<ListUGraph> writer(std::cout, graph);
   324   /// UGraphWriter<ListUGraph> writer(std::cout, graph);
   325   /// \endcode
   325   ///\endcode
   326   ///
   326   ///
   327   /// The \c writeNodeMap() function declares a \c NodeMap writing 
   327   /// The \c writeNodeMap() function declares a \c NodeMap writing 
   328   /// command in the \c UGraphWriter. You should give as parameter 
   328   /// command in the \c UGraphWriter. You should give as parameter 
   329   /// the name of the map and the map object. The NodeMap writing 
   329   /// the name of the map and the map object. The NodeMap writing 
   330   /// command with name "label" should write a unique map because it 
   330   /// command with name "label" should write a unique map because it 
   331   /// is regarded as label map.
   331   /// is regarded as label map.
   332   ///
   332   ///
   333   /// \code
   333   ///\code
   334   /// IdMap<ListUGraph, Node> nodeLabelMap;
   334   /// IdMap<ListUGraph, Node> nodeLabelMap;
   335   /// writer.writeNodeMap("label", nodeLabelMap);
   335   /// writer.writeNodeMap("label", nodeLabelMap);
   336   ///
   336   ///
   337   /// writer.writeNodeMap("coords", coords);
   337   /// writer.writeNodeMap("coords", coords);
   338   /// writer.writeNodeMap("color", colorMap);
   338   /// writer.writeNodeMap("color", colorMap);
   339   /// \endcode
   339   ///\endcode
   340   ///
   340   ///
   341   /// With the \c writeUEdgeMap() member function you can give an 
   341   /// With the \c writeUEdgeMap() member function you can give an 
   342   /// undirected edge map writing command similar to the NodeMaps.
   342   /// undirected edge map writing command similar to the NodeMaps.
   343   ///
   343   ///
   344   /// \code
   344   ///\code
   345   /// DescriptorMap<ListGraph, Edge, ListGraph::EdgeMap<int> > 
   345   /// DescriptorMap<ListGraph, Edge, ListGraph::EdgeMap<int> > 
   346   ///   edgeDescMap(graph);
   346   ///   edgeDescMap(graph);
   347   /// writer.writeUEdgeMap("descriptor", edgeDescMap);
   347   /// writer.writeUEdgeMap("descriptor", edgeDescMap);
   348   ///
   348   ///
   349   /// writer.writeUEdgeMap("weight", weightMap);
   349   /// writer.writeUEdgeMap("weight", weightMap);
   350   /// writer.writeUEdgeMap("label", labelMap);
   350   /// writer.writeUEdgeMap("label", labelMap);
   351   /// \endcode
   351   ///\endcode
   352   /// 
   352   /// 
   353   /// The EdgeMap handling is just a syntactical sugar. It writes
   353   /// The EdgeMap handling is just a syntactical sugar. It writes
   354   /// two undirected edge map with '+' and '-' prefix in the name.
   354   /// two undirected edge map with '+' and '-' prefix in the name.
   355   ///
   355   ///
   356   /// \code
   356   ///\code
   357   /// writer.writeEdgeMap("capacity", capacityMap);
   357   /// writer.writeEdgeMap("capacity", capacityMap);
   358   /// \endcode
   358   ///\endcode
   359   ///
   359   ///
   360   ///
   360   ///
   361   /// With \c writeNode() and \c writeUEdge() functions you can 
   361   /// With \c writeNode() and \c writeUEdge() functions you can 
   362   /// designate nodes and undirected edges in the graph. For example, you can 
   362   /// designate nodes and undirected edges in the graph. For example, you can 
   363   /// write out the source and target of the graph.
   363   /// write out the source and target of the graph.
   364   ///
   364   ///
   365   /// \code
   365   ///\code
   366   /// writer.writeNode("source", sourceNode);
   366   /// writer.writeNode("source", sourceNode);
   367   /// writer.writeNode("target", targetNode);
   367   /// writer.writeNode("target", targetNode);
   368   ///
   368   ///
   369   /// writer.writeUEdge("observed", uEdge);
   369   /// writer.writeUEdge("observed", uEdge);
   370   /// \endcode
   370   ///\endcode
   371   ///
   371   ///
   372   /// After you give all write commands you must call the \c run() member
   372   /// After you give all write commands you must call the \c run() member
   373   /// function, which executes all the writing commands.
   373   /// function, which executes all the writing commands.
   374   ///
   374   ///
   375   /// \code
   375   ///\code
   376   /// writer.run();
   376   /// writer.run();
   377   /// \endcode
   377   ///\endcode
   378   ///
   378   ///
   379   /// \see DefaultWriterTraits
   379   /// \see DefaultWriterTraits
   380   /// \see QuotedStringWriter
   380   /// \see QuotedStringWriter
   381   /// \see IdMap
   381   /// \see IdMap
   382   /// \see DescriptorMap
   382   /// \see DescriptorMap