PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
ExplicitAdjacency< Cost > Class Template Reference

the arcs of a weighted graph, on the GraphBuilder and ArrayGraph of ADS More...

#include <PBeFS/astar/structures/ads/ExplicitAdjacency.h>

Public Member Functions

 ExplicitAdjacency (std::size_t n)
 constructor of n nodes and no arc
 ExplicitAdjacency (const ExplicitAdjacency &o)
 copy constructor: the arcs, to be frozen again
ExplicitAdjacency & operator= (const ExplicitAdjacency &o)
 copy assignment: the arcs, to be frozen again
void add (std::uint32_t u, std::uint32_t v, Cost c)
 adds the arc ( u , v ) of cost c
template<class F>
void for_each (std::uint32_t u, F &&f) const
 calls f( v , c ) for each arc ( u , v ) of cost c
std::size_t size (void) const noexcept
 the number of nodes

Detailed Description

template<class Cost>
class PBeFS_di_unipi_it::ExplicitAdjacency< Cost >

the arcs of a weighted graph, on the GraphBuilder and ArrayGraph of ADS

The interface is that of the ExplicitAdjacency of ExplicitGraph.h. The arcs are collected by the GraphBuilder; the first for_each() after an add() freezes them into an ArrayGraph, in compressed rows that keep the order of insertion, under a lock taken only then, so that the searches of many threads may start together. A loop ( u , u ) is not kept, as the GraphBuilder wants two distinct nodes and a loop never shortens a path. An add() must not run with a for_each().

Constructor & Destructor Documentation

◆ ExplicitAdjacency() [1/2]

template<class Cost>
ExplicitAdjacency ( std::size_t n)
inlineexplicit

constructor of n nodes and no arc

◆ ExplicitAdjacency() [2/2]

template<class Cost>
ExplicitAdjacency ( const ExplicitAdjacency< Cost > & o)
inline

copy constructor: the arcs, to be frozen again

Member Function Documentation

◆ add()

template<class Cost>
void add ( std::uint32_t u,
std::uint32_t v,
Cost c )
inline

adds the arc ( u , v ) of cost c

◆ for_each()

template<class Cost>
template<class F>
void for_each ( std::uint32_t u,
F && f ) const
inline

calls f( v , c ) for each arc ( u , v ) of cost c

◆ operator=()

template<class Cost>
ExplicitAdjacency & operator= ( const ExplicitAdjacency< Cost > & o)
inline

copy assignment: the arcs, to be frozen again

◆ size()

template<class Cost>
std::size_t size ( void ) const
inlinenodiscardnoexcept

the number of nodes


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