ADS
Algorithms and Data Structures
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"
89
90#include <algorithm>
91#include <atomic>
92#include <cstddef>
93#include <cstdint>
94#include <vector>
95
96/*--------------------------------------------------------------------------*/
97/*--------------------------- NAMESPACE ------------------------------------*/
98/*--------------------------------------------------------------------------*/
99
100namespace ADS
101{
102
145template< Executor E , class W , ArcLayout AL >
146[[nodiscard]] std::vector< int >
147bfsDistances( E & ex , const StaticGraph< W , AL > & g , int s ,
148 const StaticGraph< W , AL > * gt = nullptr );
149
177template< Executor E , class W , ArcLayout AL >
178[[nodiscard]] std::vector< int >
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/*--------------------------------------------------------------------------*/
The union-find that many threads change at once, beyond the book [see UnionFind.h for the sequential ...
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
Random numbers as Knuth treats them (chapter 3 of The Art of Computer Programming),...
A static GRAPH for the engineered algorithms, beyond the book [see Graph.h]: the compressed sparse ro...
a static graph in compressed sparse rows, the arcs of each node sorted by head, their heads and their...
Definition StaticGraph.h:275
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...
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
Definition ADT.h:96