dispenso 1.6.2
A library for task parallelism
Loading...
Searching...
No Matches
graph_dot.h File Reference
#include <cstdint>
#include <fstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <dispenso/graph.h>

Go to the source code of this file.

Functions

template<typename G >
void dispenso::graphsToDot (const char *filename, const G &graph, const std::unordered_map< uintptr_t, std::string > *nodeNames)
 

Detailed Description

Utility for writing a Graph or BiPropGraph as a Graphviz DOT file.

Definition in file graph_dot.h.

Function Documentation

◆ graphsToDot()

template<typename G >
void dispenso::graphsToDot ( const char * filename,
const G & graph,
const std::unordered_map< uintptr_t, std::string > * nodeNames )

Write graph to filename in Graphviz DOT format, for example to render with dot -Tsvg. Each subgraph after the first is drawn as a cluster, completed nodes are coloured differently from incomplete ones, and for a BiPropGraph edges within a bidirectional-propagation set are drawn with open arrowheads.

Parameters
filenamepath of the file to write; it is overwritten.
graphthe graph to write.
nodeNamesoptional labels, keyed by the address of a node or subgraph cast to uintptr_t. Nodes and subgraphs without an entry are labelled by their index.

Definition at line 53 of file graph_dot.h.