ADS
Algorithms and Data Structures
Toggle main menu visibility
Loading...
Searching...
No Matches
ParallelGraph.h
Go to the documentation of this file.
1
/*--------------------------------------------------------------------------*/
2
/*-------------------------- File ParallelGraph.h --------------------------*/
3
/*--------------------------------------------------------------------------*/
72
/*--------------------------------------------------------------------------*/
73
/*----------------------------- DEFINITIONS --------------------------------*/
74
/*--------------------------------------------------------------------------*/
75
76
#ifndef __ADS_ParallelGraph
77
#define __ADS_ParallelGraph
78
/* self-identification: #endif constant */
79
80
/*--------------------------------------------------------------------------*/
81
/*------------------------------ INCLUDES ----------------------------------*/
82
/*--------------------------------------------------------------------------*/
83
84
#include "
ADS/Contract.h
"
85
#include "
ADS/concurrent/ConcurrentUnionFind.h
"
86
#include "
ADS/graph/StaticGraph.h
"
87
#include "
ADS/numeric/RandomNumbers.h
"
88
#include "
ADS/parallel/Executor.h
"
89
90
#include <algorithm>
91
#include <atomic>
92
#include <cstddef>
93
#include <cstdint>
94
#include <vector>
95
96
/*--------------------------------------------------------------------------*/
97
/*--------------------------- NAMESPACE ------------------------------------*/
98
/*--------------------------------------------------------------------------*/
99
100
namespace
ADS
101
{
102
145
template
< Executor E ,
class
W , ArcLayout AL >
146
[[nodiscard]] std::vector< int >
147
bfsDistances
( E & ex ,
const
StaticGraph< W , AL >
& g ,
int
s ,
148
const
StaticGraph< W , AL >
* gt =
nullptr
);
149
177
template
< Executor E ,
class
W , ArcLayout AL >
178
[[nodiscard]] std::vector< int >
179
connectedComponents
( E & ex ,
const
StaticGraph< W , AL >
& g );
180
181
/*--------------------------------------------------------------------------*/
182
183
}
// end( namespace ADS )
184
185
/*--------------------------------------------------------------------------*/
186
/*-------------------------- IMPLEMENTATION --------------------------------*/
187
/*--------------------------------------------------------------------------*/
188
189
#include "ADS/parallel/impl/ParallelGraph.tpp"
190
191
/*--------------------------------------------------------------------------*/
192
193
#endif
/* ParallelGraph.h included */
194
195
/*--------------------------------------------------------------------------*/
196
/*------------------------ End File ParallelGraph.h ------------------------*/
197
/*--------------------------------------------------------------------------*/
ConcurrentUnionFind.h
The union-find that many threads change at once, beyond the book [see UnionFind.h for the sequential ...
Contract.h
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
Executor.h
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
RandomNumbers.h
Random numbers as Knuth treats them (chapter 3 of The Art of Computer Programming),...
StaticGraph.h
A static GRAPH for the engineered algorithms, beyond the book [see Graph.h]: the compressed sparse ro...
ADS::StaticGraph
a static graph in compressed sparse rows, the arcs of each node sorted by head, their heads and their...
Definition
StaticGraph.h:275
ADS::bfsDistances
std::vector< int > bfsDistances(E &ex, const StaticGraph< W, AL > &g, int s, const StaticGraph< W, AL > *gt=nullptr)
the distances from by a visit in breadth that optimizes its direction, for the nodes not reached; g...
ADS::connectedComponents
std::vector< int > connectedComponents(E &ex, const StaticGraph< W, AL > &g)
the least node of the component of each node, an oriented graph taken as unoriented
ADS
Definition
ADT.h:96
ADS
parallel
ParallelGraph.h
Generated by
1.17.0