Template Numerical Library: TNL::Graphs::Readers::EdgeListReader< Graph > Struct Template Reference

Template Numerical Library version\ main:c7077e4fd

Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
TNL::Graphs::Readers::EdgeListReader< Graph > Struct Template Reference

Reader for graphs in edge list format. More...

`#include <TNL/Graphs/Readers/EdgeListReader.h>`

## Public Types
using | DeviceType = typename Graph::DeviceType
using | IndexType = typename Graph::IndexType
using | ValueType = typename Graph::ValueType

## Static Public Member Functions
static void | read (const std::string &file_name, Graph &graph)
| Reads a graph from an edge list file.

## Detailed Description

template<typename Graph>
struct TNL::Graphs::Readers::EdgeListReader< Graph >

Reader for graphs in edge list format.

This reader reads a graph from a file in edge list format, where each line represents an edge between two vertices, optionally with a weight. Lines starting with '#' are treated as comments and ignored.

Example of weighted edge list format:

# This is a comment
0 1 2.5
1 2 1.0
2 0 3.0

Example of unweighted edge list format:

# This is a comment
0 1
1 2
2 0

Template Parameters

  Graph | The type of the graph to be read.

## Member Function Documentation

## ◆ read()

template<typename Graph>

void TNL::Graphs::Readers::EdgeListReader< Graph >::read | ( | const std::string & | file_name,
|  | Graph & | graph )
| inlinestatic

Reads a graph from an edge list file.

Parameters

  file_name | is the name of the file containing the edge list.
  graph | is the graph object to be populated.

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

- src/TNL/Graphs/Readers/EdgeListReader.h