Public Types | Public Member Functions

graphlab::igraph_constructor< VertexData, EdgeData > Class Template Reference

#include <mr_disk_graph_construction.hpp>

List of all members.

Public Types

enum  iterate_return_type { Vertex, Edge, NoMoreData = -1 }

Public Member Functions

 igraph_constructor ()
 constructor
virtual ~igraph_constructor ()
 destructor
virtual void begin (size_t i, size_t max)=0
virtual iterate_return_type iterate (vertex_id_t &vtx, VertexData &vdata, uint32_t &color, std::pair< vertex_id_t, vertex_id_t > &edge, EdgeData &edata)=0
virtual uint16_t vertex_to_atomid (vertex_id_t vtx, uint16_t numatoms)=0
void mr_disk_graph_construction_map (disk_graph< VertexData, EdgeData > &dg, size_t i, size_t max)

Detailed Description

template<typename VertexData, typename EdgeData>
class graphlab::igraph_constructor< VertexData, EdgeData >

Standard interface for full parallel/distributed construction of a disk_graph. User first subclasses the igraph_constructor, implementing the begin(), iterate() and vertex_to_atomid() methods. See mr_disk_graph_construction for details.

The subclass must be copy-constructable.

Definition at line 40 of file mr_disk_graph_construction.hpp.


Member Function Documentation

template<typename VertexData, typename EdgeData>
virtual void graphlab::igraph_constructor< VertexData, EdgeData >::begin ( size_t  i,
size_t  max 
) [pure virtual]

'max' (possibly distributed instances) of the user subclass is created using the copy constructor. (max is defined by the arguments into mr_disk_graph_construction ) begin() is then called on each instance with a unique 'i' from 0 to max - 1.

template<typename VertexData, typename EdgeData>
virtual iterate_return_type graphlab::igraph_constructor< VertexData, EdgeData >::iterate ( vertex_id_t vtx,
VertexData &  vdata,
uint32_t &  color,
std::pair< vertex_id_t, vertex_id_t > &  edge,
EdgeData &  edata 
) [pure virtual]

after begin() is called, iterate() is called repeatedly. Each call to iterate() must return either a vertex or an edge through its arguments which are passed by reference.

Parameters:
irt 
vtx If return_value == Vertex, this is the vertex ID returned. This parameter is ignored if return_value == Edge.
vdata If return_value == Vertex, the vertexdata to be created on vertex 'vtx' is returned here.
color If return_value == Vertex, this should contain the vertex color of 'vtx'
edge If return_value == Edge, this is the edge to be inserted. This parameter is ignored if return_value == Vertex.
edata if return_value == Edge, the edgedata to be created on the edge 'edge' is returned here.
Returns:
if return value is Vertex or Edge, the actual data will be read from the arguments. If return value is NoMoreData, no data is read, and the construction loop is terminated.
template<typename VertexData, typename EdgeData>
void graphlab::igraph_constructor< VertexData, EdgeData >::mr_disk_graph_construction_map ( disk_graph< VertexData, EdgeData > &  dg,
size_t  i,
size_t  max 
) [inline]

Used by mr_disk_graph_construction. Creates a section of the disk graph using the information generated by this class.

Definition at line 98 of file mr_disk_graph_construction.hpp.

template<typename VertexData, typename EdgeData>
virtual uint16_t graphlab::igraph_constructor< VertexData, EdgeData >::vertex_to_atomid ( vertex_id_t  vtx,
uint16_t  numatoms 
) [pure virtual]

This function provides the mapping from vertex to atom ID. The behavior of this function must be consistent across all (distributed) instances.


The documentation for this class was generated from the following file: