Changeset 2200:2f2ac1b1ca1e in lemon-0.x
- Timestamp:
- 09/06/06 12:01:15 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2925
- Location:
- lemon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/graph_reader.h
r2100 r2200 345 345 346 346 347 /// \brief Read a graph from the input.348 ///349 /// It is a helper function to read a graph from the given input350 /// stream. It gives back an GraphReader object and this object351 /// can read more maps, labeled nodes, edges and attributes.352 ///353 /// \warning Do not forget to call the \c run() function.354 ///355 /// \param is The input stream.356 /// \param g The graph.357 template<typename Graph>358 GraphReader<Graph> graphReader(std::istream& is, Graph &g) {359 return GraphReader<Graph>(is, g);360 }361 362 /// \brief Read a graph from the input.363 ///364 /// It is a helper function to read a graph from the given input365 /// file. It gives back an GraphReader object and this object366 /// can read more maps, labeled nodes, edges and attributes.367 ///368 /// \warning Do not forget to call the \c run() function.369 ///370 /// \param fn The input filename.371 /// \param g The graph.372 template<typename Graph>373 GraphReader<Graph> graphReader(const std::string& fn, Graph &g) {374 return GraphReader<Graph>(fn, g);375 }376 377 347 /// \brief The undirected graph reader class. 378 348 /// … … 756 726 }; 757 727 758 /// \brief Read an undirected graph from the input.759 ///760 /// It is a helper function to read an undirected graph from the given input761 /// stream. It gives back an UGraphReader object and this object762 /// can read more maps, labeled nodes, edges, undirected edges and763 /// attributes.764 ///765 /// \warning Do not forget to call the \c run() function.766 ///767 /// \param is The input stream.768 /// \param g The graph.769 template<typename Graph>770 UGraphReader<Graph> uGraphReader(std::istream& is, Graph &g) {771 return GraphReader<Graph>(is, g);772 }773 774 /// \brief Read an undirected graph from the input.775 ///776 /// It is a helper function to read an undirected graph from the given input777 /// file. It gives back an UGraphReader object and this object778 /// can read more maps, labeled nodes, edges, undirected edges and779 /// attributes.780 ///781 /// \warning Do not forget to call the \c run() function.782 ///783 /// \param fn The input filename.784 /// \param g The graph.785 template<typename Graph>786 UGraphReader<Graph> uGraphReader(const std::string& fn, Graph &g) {787 return GraphReader<Graph>(fn, g);788 }789 728 790 729 /// @} -
lemon/graph_writer.h
r2083 r2200 37 37 /// \brief The graph writer class. 38 38 /// 39 /// The \c GraphWriter class provides the graph output. 40 /// Before you read this documentation it might be useful to read the general 41 /// description of \ref graph-io-page "Graph Input-Output". 42 /// 43 /// To write a graph 44 /// you should first give writing commands to the writer. You can declare 45 /// write commands as \c NodeMap or \c EdgeMap writing and labeled Node and 46 /// Edge writing. 39 /// The \c GraphWriter class provides the graph output. Before you 40 /// read this documentation it might be useful to read the general 41 /// description of \ref graph-io-page "Graph Input-Output". 42 /// 43 /// To write a graph you should first give writing commands to the 44 /// writer. You can declare write commands as \c NodeMap or \c 45 /// EdgeMap writing and labeled Node and Edge writing. 47 46 /// 48 47 ///\code … … 50 49 ///\endcode 51 50 /// 52 /// The \c writeNodeMap() function declares a \c NodeMap writing 53 /// command in the \c GraphWriter. You should give as parameter 54 /// the name of the map and the map object. The NodeMap writing 55 /// command with name "label" should write a unique map because it 56 /// is regarded as label map (such a map is essential if the graph has edges). 51 /// The \c writeNodeMap() function declares a \c NodeMap writing 52 /// command in the \c GraphWriter. You should give as parameter the 53 /// name of the map and the map object. The NodeMap writing command 54 /// with name "label" should write a unique map because it is 55 /// regarded as label map (such a map is essential if the graph has 56 /// edges). 57 57 /// 58 58 ///\code … … 282 282 }; 283 283 284 285 286 /// \brief Write a graph to the output.287 ///288 /// It is a helper function to write a graph to the given output289 /// stream. It gives back a GraphWriter object and this object290 /// can write more maps, labeled nodes and edges and attributes.291 /// \warning Do not forget to call the \c run() function.292 ///293 /// \param os The output stream.294 /// \param g The graph.295 template <typename Graph>296 GraphWriter<Graph> graphWriter(std::ostream& os, const Graph &g) {297 return GraphWriter<Graph>(os, g);298 }299 300 /// \brief Write a graph to the output.301 ///302 /// It is a helper function to write a graph to the given output303 /// file. It gives back a GraphWriter object and this object304 /// can write more maps, labeled nodes and edges and attributes.305 /// \warning Do not forget to call the \c run() function.306 ///307 /// \param fn The filename.308 /// \param g The graph.309 template <typename Graph>310 GraphWriter<Graph> graphWriter(const std::string& fn, const Graph &g) {311 return GraphWriter<Graph>(fn, g);312 }313 284 314 285 /// \brief The undirected graph writer class. … … 439 410 /// \brief Issue a new node map writing command to the writer. 440 411 /// 441 /// This function issues a new <i> node map writing command</i> to the writer. 412 /// This function issues a new <i> node map writing command</i> to 413 /// the writer. 442 414 template <typename Map> 443 415 UGraphWriter& writeNodeMap(std::string name, const Map& map) { … … 448 420 /// \brief Issue a new node map writing command to the writer. 449 421 /// 450 /// This function issues a new <i> node map writing command</i> to the writer. 422 /// This function issues a new <i> node map writing command</i> to 423 /// the writer. 451 424 template <typename Writer, typename Map> 452 425 UGraphWriter& writeNodeMap(std::string name, const Map& map, … … 458 431 /// \brief Issue a new edge map writing command to the writer. 459 432 /// 460 /// This function issues a new <i> edge map writing command</i> to the writer. 433 /// This function issues a new <i> edge map writing command</i> to 434 /// the writer. 461 435 template <typename Map> 462 436 UGraphWriter& writeEdgeMap(std::string name, const Map& map) { … … 467 441 /// \brief Issue a new edge map writing command to the writer. 468 442 /// 469 /// This function issues a new <i> edge map writing command</i> to the writer. 443 /// This function issues a new <i> edge map writing command</i> to 444 /// the writer. 470 445 template <typename Writer, typename Map> 471 446 UGraphWriter& writeEdgeMap(std::string name, const Map& map, … … 578 553 /// \brief Write the label of the given undirected edge. 579 554 /// 580 /// It writes the label of the given undirected edge. If there was written581 /// an "label" named edge map then it will write the map value belonging to582 /// the edge.555 /// It writes the label of the given undirected edge. If there was 556 /// written an "label" named edge map then it will write the map 557 /// value belonging to the edge. 583 558 void writeLabel(std::ostream& os, const UEdge& item) const { 584 559 u_edgeset_writer.writeLabel(os, item); … … 600 575 }; 601 576 602 /// \brief Write an undirected graph to the output.603 ///604 /// It is a helper function to write an undirected graph to the given output605 /// stream. It gives back an UGraphWriter object and this object606 /// can write more maps, labeled nodes and edges and attributes.607 /// \warning Do not forget to call the \c run() function.608 ///609 /// \param os The output stream.610 /// \param g The graph.611 template <typename Graph>612 UGraphWriter<Graph> uGraphWriter(std::ostream& os, const Graph &g) {613 return UGraphWriter<Graph>(os, g);614 }615 616 /// \brief Write an undirected graph to the output.617 ///618 /// It is a helper function to write an undirected graph to the given output619 /// file. It gives back an UGraphWriter object and this object620 /// can write more maps, labeled nodes, edges, undirected edges and621 /// attributes.622 ///623 /// \warning Do not forget to call the \c run() function.624 ///625 /// \param fn The output file.626 /// \param g The graph.627 template <typename Graph>628 UGraphWriter<Graph> uGraphWriter(const std::string& fn,629 const Graph &g) {630 return UGraphWriter<Graph>(fn, g);631 }632 633 577 /// @} 634 578
Note: See TracChangeset
for help on using the changeset viewer.