Changes in / [193:65cba1032f90:192:7bf5f97d574f] in lemon-main
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
demo/lgf_demo.cc
r193 r192 21 21 ///\brief Demonstrating graph input and output 22 22 /// 23 /// This program gives an example of how to read and write a digraph24 /// an d additional maps from/to a stream or a file using the25 /// \ref lgf-format "LGF" format.23 /// This program gives an example of how to load a directed graph from 24 /// an \ref lgf-format "LGF" file with the \ref lemon::DigraphReader 25 /// "DigraphReader" class. 26 26 /// 27 27 /// The \c "digraph.lgf" file: 28 28 /// \include digraph.lgf 29 29 /// 30 /// And the program which reads it and prints the digraph to the 31 /// standard output: 30 /// And the program which reads it: 32 31 /// \include lgf_demo.cc 33 32 … … 43 42 SmartDigraph::ArcMap<int> cap(g); 44 43 SmartDigraph::Node s, t; 45 46 try { 47 digraphReader("digraph.lgf", g). // read the directed graph into g 48 arcMap("capacity", cap). // read the 'capacity' arc map into cap 49 node("source", s). // read 'source' node to s 50 node("target", t). // read 'target' node to t 51 run(); 52 } catch (DataFormatError& error) { // check if there was any error 53 std::cerr << "Error: " << error.what() << std::endl; 54 return -1; 55 } 44 45 digraphReader("digraph.lgf", g). // read the directed graph into g 46 arcMap("capacity", cap). // read the 'capacity' arc map into cap 47 node("source", s). // read 'source' node to s 48 node("target", t). // read 'target' node to t 49 run(); 56 50 57 51 std::cout << "A digraph is read from 'digraph.lgf'." << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.