Class MTXParser

Nested Relationships

Nested Types

Class Documentation

class MTXParser

Parser for the MTX file format.

Public Types

enum class Object

Values:

enumerator Matrix
enumerator Vector
enum class Format

Values:

enumerator Coordinate
enumerator Array
enum class Field

Values:

enumerator Real
enumerator Double
enumerator Complex
enumerator Integer
enumerator Pattern
enum class Symmetry

Values:

enumerator General
enumerator Symmetric
enumerator SkewSymmetric
enumerator Hermitian

Public Functions

MTXParser(const std::string &path)
MTXHeader getHeader()

Get the MTX graph file header.

MatrixSize getMatrixSize()

Get the MTX graph file matrix size header.

std::optional<NetworKit::WeightedEdge> getNext(bool weighted)

Get the (weighted) edge from the next line in the MTX graph file if present.

Parameters:

weighted

Returns:

std::optional<std::pair<NetworKit::Edge, NetworKit::edgeweight>>

Public Members

std::unordered_map<std::string, Object> objectMap = {{"matrix", Object::Matrix}, {"vector", Object::Vector}}
std::unordered_map<std::string, Format> formatMap = {{"coordinate", Format::Coordinate}, {"array", Format::Array}}
std::unordered_map<std::string, Field> fieldMap = {{"real", Field::Real}, {"double", Field::Double}, {"integer", Field::Integer}, {"pattern", Field::Pattern}}
std::unordered_map<std::string, Symmetry> symmetryMap = {{"general", Symmetry::General}, {"symmetric", Symmetry::Symmetric}, {"skew-symmetric", Symmetry::SkewSymmetric}}
struct Edge

Public Functions

inline Edge(node f, node t, std::optional<double> w)

Public Members

node from
node to
std::optional<double> weight
struct MatrixSize

Public Functions

inline MatrixSize(count r, count c, count nz)

Public Members

count rows
count columns
count nonzeros
struct MTXHeader

Public Members

Object object
Format format
Field field
Symmetry symmetry