| ... | ... |
@@ -22,5 +22,5 @@ |
| 22 | 22 |
/// |
| 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 |
/// |
|
| 23 |
/// This program gives an example of how to read and write a digraph |
|
| 24 |
/// and additional maps from/to a stream or a file using the |
|
| 25 |
/// \ref lgf-format "LGF" format. |
|
| 26 | 26 |
/// |
| ... | ... |
@@ -29,3 +29,4 @@ |
| 29 | 29 |
/// |
| 30 |
/// And the program which reads it |
|
| 30 |
/// And the program which reads it and prints the digraph to the |
|
| 31 |
/// standard output: |
|
| 31 | 32 |
/// \include lgf_demo.cc |
| ... | ... |
@@ -36,4 +37,2 @@ |
| 36 | 37 |
#include <lemon/lgf_writer.h> |
| 37 |
#include <lemon/random.h> |
|
| 38 |
|
|
| 39 | 38 |
|
| ... | ... |
@@ -46,3 +45,4 @@ |
| 46 | 45 |
|
| 47 |
|
|
| 46 |
try {
|
|
| 47 |
digraphReader("digraph.lgf", g). // read the directed graph into g
|
|
| 48 | 48 |
arcMap("capacity", cap). // read the 'capacity' arc map into cap
|
| ... | ... |
@@ -51,4 +51,8 @@ |
| 51 | 51 |
run(); |
| 52 |
} catch (DataFormatError& error) { // check if there was any error
|
|
| 53 |
std::cerr << "Error: " << error.what() << std::endl; |
|
| 54 |
return -1; |
|
| 55 |
} |
|
| 52 | 56 |
|
| 53 |
std::cout << " |
|
| 57 |
std::cout << "A digraph is read from 'digraph.lgf'." << std::endl; |
|
| 54 | 58 |
std::cout << "Number of nodes: " << countNodes(g) << std::endl; |
0 comments (0 inline)