remove comments in output routine

This commit is contained in:
Maximilian Keßler 2023-11-04 19:44:42 +01:00
parent ca214a281c
commit 750ab37457
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -150,10 +150,7 @@ std::ostream & operator<<(std::ostream & output, Graph const & graph)
{ {
// We use std::endl to write new lines here. // We use std::endl to write new lines here.
// If you prefer the new line character, \n on linux, that one works fine, too. // If you prefer the new line character, \n on linux, that one works fine, too.
output << "c Recall each line starting with c encodes a comment in DIMACS format!" << std::endl output << "p edge " << graph.num_nodes() << " " << graph.num_edges() << std::endl;
<< "c The first non-comment line specifies the number of nodes and edges:" << std::endl
<< "p edge " << graph.num_nodes() << " " << graph.num_edges() << std::endl
<< "c Each of the remaining non-comment lines specifys an edge by two nodes:" << std::endl;
// We will need the id of the node we are at, so we write a plain old loop here. // We will need the id of the node we are at, so we write a plain old loop here.
for (NodeId node_id = 0; node_id < graph.num_nodes(); ++node_id) for (NodeId node_id = 0; node_id < graph.num_nodes(); ++node_id)
@ -171,7 +168,6 @@ std::ostream & operator<<(std::ostream & output, Graph const & graph)
} }
} }
} }
output << "c If you use this graph class in your solution, you should probably remove this comments!" << std::endl;
// Streams sometimes buffer their output. // Streams sometimes buffer their output.
// Once one is done with some output routine, it can make sense to flush them, // Once one is done with some output routine, it can make sense to flush them,