PBeFS
Parallel Best-First Search
Loading...
Searching...
No Matches
NodeTable.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------*/
2/*---------------------------- File NodeTable.h ----------------------------*/
3/*--------------------------------------------------------------------------*/
15/*--------------------------------------------------------------------------*/
16/*------------------------------ DEFINITIONS -------------------------------*/
17/*--------------------------------------------------------------------------*/
18
19#ifndef __PBeFS_ads_NodeTable
20 #define __PBeFS_ads_NodeTable
21 /* self-identification: #endif at the end of the file */
22
23/*--------------------------------------------------------------------------*/
24/*-------------------------------- INCLUDES --------------------------------*/
25/*--------------------------------------------------------------------------*/
26
27#include <cstddef>
28
29#include "ADS/dictionary/PointerTable.h"
30
32
33/*--------------------------------------------------------------------------*/
34/*------------------------------- NAMESPACE --------------------------------*/
35/*--------------------------------------------------------------------------*/
36
38namespace PBeFS_di_unipi_it
39{
40
41/*--------------------------------------------------------------------------*/
42/*---------------------------- CLASS NodeTable -----------------------------*/
43/*--------------------------------------------------------------------------*/
45
46template< class NodeT >
48 : public ADS::PointerTable< NodeT , ADS::StateEqual ,
49 ADS::HugePageAllocator< std::byte > > {
50
51 public:
52
54
55 [[nodiscard]] static std::size_t slots_for( std::size_t n ) noexcept {
56 return( n / 7 * 10 + 16 );
57 }
58
60
61 explicit NodeTable( std::size_t capacity = 1024 )
62 : ADS::PointerTable< NodeT , ADS::StateEqual ,
63 ADS::HugePageAllocator< std::byte > >( capacity ) {}
64
65 }; // end( class( NodeTable ) )
66
67/*--------------------------------------------------------------------------*/
68
69} // end( namespace PBeFS_di_unipi_it )
70
71/*--------------------------------------------------------------------------*/
72
73#endif /* __PBeFS_ads_NodeTable */
74
75/*--------------------------------------------------------------------------*/
76/*-------------------------- End File NodeTable.h --------------------------*/
77/*--------------------------------------------------------------------------*/
Header file for the small helpers shared by the searches: a stopwatch, the placement of the workers o...
static std::size_t slots_for(std::size_t n) noexcept
the number of slots that holds n nodes without growing
Definition NodeTable.h:55
NodeTable(std::size_t capacity=1024)
constructor, taking the initial number of slots
Definition NodeTable.h:61
namespace for the Parallel Best-First Search library
Definition AStar.h:83