All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
NetworKit::EdgeListReader Class Reference

A reader for various edge list formats, in which each line contains an edge as two node ids. More...

#include <EdgeListReader.h>

Public Member Functions

 EdgeListReader ()=default
 
 EdgeListReader (const char separator, const node firstNode, const std::string commentPrefix="#", const bool continuous=true, const bool directed=false)
 
Graph read (const std::string &path)
 Given the path of an input file, read the graph contained. More...
 
std::map< std::string, nodegetNodeMap ()
 Write the graph to a file. More...
 
- Public Member Functions inherited from NetworKit::GraphReader
virtual ~GraphReader ()=default
 

Protected Attributes

char separator
 character separating nodes in an edge line More...
 
std::string commentPrefix
 
node firstNode
 
bool continuous
 
std::map< std::string, nodemapNodeIds
 
bool directed
 

Detailed Description

A reader for various edge list formats, in which each line contains an edge as two node ids.

Constructor & Destructor Documentation

NetworKit::EdgeListReader::EdgeListReader ( )
default
NetworKit::EdgeListReader::EdgeListReader ( const char  separator,
const node  firstNode,
const std::string  commentPrefix = "#",
const bool  continuous = true,
const bool  directed = false 
)
Parameters
[in]separatorcharacter used to separate nodes in an edge line
[in]firstNodeindex of the first node in the file
[in]commentCharcharacter used to mark comment lines
[in]continuousboolean to specify, if node ids are continuous
[in]directedtreat graph as directed

Member Function Documentation

std::map< std::string, node > NetworKit::EdgeListReader::getNodeMap ( )

Write the graph to a file.

Parameters
[in]Gthe graph
[in]paththe output file path Return the node map, in case node ids are not continuous
Graph NetworKit::EdgeListReader::read ( const std::string &  path)
virtual

Given the path of an input file, read the graph contained.

Parameters
[in]pathinput file path

Implements NetworKit::GraphReader.

Member Data Documentation

std::string NetworKit::EdgeListReader::commentPrefix
protected
bool NetworKit::EdgeListReader::continuous
protected
bool NetworKit::EdgeListReader::directed
protected
node NetworKit::EdgeListReader::firstNode
protected
std::map<std::string,node> NetworKit::EdgeListReader::mapNodeIds
protected
char NetworKit::EdgeListReader::separator
protected

character separating nodes in an edge line


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