Galois::Graph::FileGraphWriter Class Reference

Simplifies writing graphs. More...

#include <FileGraph.h>

Inheritance diagram for Galois::Graph::FileGraphWriter:
Galois::Graph::FileGraph

List of all members.

Public Member Functions

 FileGraphWriter ()
 ~FileGraphWriter ()
void setNumNodes (uint64_t n)
void setNumEdges (uint64_t n)
void setSizeofEdgeData (size_t n)
void phase1 ()
 Marks the transition to next phase of parsing, counting the degree of nodes.
void incrementDegree (size_t id, int delta=1)
 Increments degree of id by delta.
void phase2 ()
 Marks the transition to next phase of parsing, adding edges.
size_t addNeighbor (size_t src, size_t dst)
 Adds a neighbor between src and dst.
template<typename T >
T * finish ()
 Finish making graph.

Private Attributes

uint64_t * outIdx
uint32_t * starts
uint32_t * outs
size_t sizeofEdgeData

Detailed Description

Simplifies writing graphs.

Writer your file in rounds:

  1. setNumNodes(), setNumEdges(), setSizeofEdgeData()
  2. phase1(), for each node, incrementDegree(Node x)
  3. phase2(), add neighbors for each node, addNeighbor(Node src, Node dst)
  4. finish(), use as FileGraph

Constructor & Destructor Documentation

Galois::Graph::FileGraphWriter::FileGraphWriter (  )  [inline]
Galois::Graph::FileGraphWriter::~FileGraphWriter (  )  [inline]

Member Function Documentation

size_t Galois::Graph::FileGraphWriter::addNeighbor ( size_t  src,
size_t  dst 
) [inline]

Adds a neighbor between src and dst.

template<typename T >
T* Galois::Graph::FileGraphWriter::finish (  )  [inline]

Finish making graph.

Returns pointer to block of memory that should be used to store edge data.

void Galois::Graph::FileGraphWriter::incrementDegree ( size_t  id,
int  delta = 1 
) [inline]

Increments degree of id by delta.

void Galois::Graph::FileGraphWriter::phase1 (  )  [inline]

Marks the transition to next phase of parsing, counting the degree of nodes.

void Galois::Graph::FileGraphWriter::phase2 (  )  [inline]

Marks the transition to next phase of parsing, adding edges.

void Galois::Graph::FileGraphWriter::setNumEdges ( uint64_t  n  )  [inline]
void Galois::Graph::FileGraphWriter::setNumNodes ( uint64_t  n  )  [inline]
void Galois::Graph::FileGraphWriter::setSizeofEdgeData ( size_t  n  )  [inline]

Member Data Documentation

Reimplemented from Galois::Graph::FileGraph.

Reimplemented from Galois::Graph::FileGraph.


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

Generated on 2 Nov 2013 for Galois by  doxygen 1.6.1