Graph
Functions
graph.cpp File Reference
#include "graph.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>

Go to the source code of this file.

Functions

ostream & operator<< (ostream &s, graph const &rhs)
 

Function Documentation

ostream& operator<< ( ostream &  s,
graph const &  rhs 
)

Definition at line 81 of file graph.cpp.

82 {
83  auto &edges=rhs._edges;
84  s << "\n -- Edges --\n";
85  for (size_t k=0; k<edges.size(); ++k)
86  {
87  s << k << " : ";
88  for (size_t j=0; j<edges[k].size(); ++j)
89  {
90  s << edges[k][j] << " ";
91  }
92  s << endl;
93  }
94 
95  s << "Graph with " << rhs.Nedges() << " edges and " << rhs.Nvertices() << " vertices" << endl;
96 
97  return s;
98 }