Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions include/boost/graph/adj_list_serialize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,17 @@ namespace serialization
{
typedef adjacency_list< OEL, VL, D, VP, EP, GP, EL > Graph;
typedef typename graph_traits< Graph >::vertex_descriptor Vertex;
typedef typename graph_traits< Graph >::vertices_size_type VerticesSize;
typedef typename graph_traits< Graph >::edges_size_type EdgesSize;

int V = num_vertices(graph);
int E = num_edges(graph);
VerticesSize V = num_vertices(graph);
EdgesSize E = num_edges(graph);
ar << BOOST_SERIALIZATION_NVP(V);
ar << BOOST_SERIALIZATION_NVP(E);

// assign indices to vertices
std::map< Vertex, int > indices;
int num = 0;
std::map< Vertex, size_t > indices;
size_t num = 0;
BGL_FORALL_VERTICES_T(v, graph, Graph)
{
indices[v] = num++;
Expand Down Expand Up @@ -84,14 +86,16 @@ namespace serialization
typedef adjacency_list< OEL, VL, D, VP, EP, GP, EL > Graph;
typedef typename graph_traits< Graph >::vertex_descriptor Vertex;
typedef typename graph_traits< Graph >::edge_descriptor Edge;
typedef typename graph_traits< Graph >::vertices_size_type VerticesSize;
typedef typename graph_traits< Graph >::edges_size_type EdgesSize;

unsigned int V;
VerticesSize V;
ar >> BOOST_SERIALIZATION_NVP(V);
unsigned int E;
EdgesSize E;
ar >> BOOST_SERIALIZATION_NVP(E);

std::vector< Vertex > verts(V);
int i = 0;
size_t i = 0;
while (V-- > 0)
{
Vertex v = add_vertex(graph);
Expand All @@ -101,8 +105,8 @@ namespace serialization
}
while (E-- > 0)
{
int u;
int v;
Vertex u;
Vertex v;
ar >> BOOST_SERIALIZATION_NVP(u);
ar >> BOOST_SERIALIZATION_NVP(v);
Edge e;
Expand Down