|
rippled
|
Directed graph. More...
#include <Digraph.h>
Classes | |
| struct | Edge |
| Vertices and data associated with an Edge. More... | |
Public Member Functions | |
| bool | connect (Vertex source, Vertex target, EdgeData e) |
| Connect two vertices. | |
| bool | connect (Vertex source, Vertex target) |
| Connect two vertices using default constructed edge data. | |
| bool | disconnect (Vertex source, Vertex target) |
| Disconnect two vertices. | |
| std::optional< EdgeData > | edge (Vertex source, Vertex target) const |
| Return edge data between two vertices. | |
| bool | connected (Vertex source, Vertex target) const |
| Check if two vertices are connected. | |
| auto | outVertices () const |
| Range over vertices in the graph. | |
| auto | outVertices (Vertex source) const |
| Range over target vertices. | |
| auto | outEdges (Vertex source) const |
| Range of out edges. | |
| std::size_t | outDegree (Vertex source) const |
| Vertex out-degree. | |
| template<class VertexName > | |
| void | saveDot (std::ostream &out, VertexName &&vertexName) const |
| Save GraphViz dot file. | |
| template<class VertexName > | |
| void | saveDot (std::string const &fileName, VertexName &&vertexName) const |
Private Types | |
| using | Links = boost::container::flat_map< Vertex, EdgeData > |
| using | Graph = boost::container::flat_map< Vertex, Links > |
Private Attributes | |
| Graph | graph_ |
| Links | empty |
Directed graph.
Basic directed graph that uses an adjacency list to represent out edges.
Instances of Vertex uniquely identify vertices in the graph. Instances of EdgeData is any data to store in the edge connecting two vertices.
Both Vertex and EdgeData should be lightweight and cheap to copy.
|
private |
|
private |
| bool xrpl::test::csf::Digraph< Vertex, EdgeData >::connect | ( | Vertex | source, |
| Vertex | target, | ||
| EdgeData | e | ||
| ) |
| bool xrpl::test::csf::Digraph< Vertex, EdgeData >::connect | ( | Vertex | source, |
| Vertex | target | ||
| ) |
| bool xrpl::test::csf::Digraph< Vertex, EdgeData >::disconnect | ( | Vertex | source, |
| Vertex | target | ||
| ) |
| std::optional< EdgeData > xrpl::test::csf::Digraph< Vertex, EdgeData >::edge | ( | Vertex | source, |
| Vertex | target | ||
| ) | const |
Return edge data between two vertices.
| source | The source vertex |
| target | The target vertex |
| bool xrpl::test::csf::Digraph< Vertex, EdgeData >::connected | ( | Vertex | source, |
| Vertex | target | ||
| ) | const |
| auto xrpl::test::csf::Digraph< Vertex, EdgeData >::outVertices | ( | ) | const |
| auto xrpl::test::csf::Digraph< Vertex, EdgeData >::outVertices | ( | Vertex | source | ) | const |
| auto xrpl::test::csf::Digraph< Vertex, EdgeData >::outEdges | ( | Vertex | source | ) | const |
| std::size_t xrpl::test::csf::Digraph< Vertex, EdgeData >::outDegree | ( | Vertex | source | ) | const |
| void xrpl::test::csf::Digraph< Vertex, EdgeData >::saveDot | ( | std::ostream & | out, |
| VertexName && | vertexName | ||
| ) | const |
| void xrpl::test::csf::Digraph< Vertex, EdgeData >::saveDot | ( | std::string const & | fileName, |
| VertexName && | vertexName | ||
| ) | const |
|
private |
|
private |