scram::core::UniqueTable
A hash table for keeping BDD reduced. More...
#include <bdd.h>
Public Functions
| Name | |
|---|---|
| UniqueTable(int init_capacity =1000)<br>Constructor for small graphs. | |
| int | size() const |
| void | clear()<br>Erases all entries. |
| void | Release()<br>Releases all the memory associated with managing this table with BDD. |
| WeakIntrusivePtr< T > & | FindOrAdd(int index, int high_id, int low_id)<br>Finds an existing BDD vertex or inserts a default constructed weak pointer for a new vertex. |
Detailed Description
template <class T >
class scram::core::UniqueTable;A hash table for keeping BDD reduced.
Template Parameters:
- T The type of the main functional BDD vertex.
The management of the hash table is intrusive; that is, it relies on BDD vertices to provide necessary information.
Each vertex must have a unique signature consisting of its index, special high and low ids. This signature is the key of the hash table; however, it is not duplicated in the table. The key is retrieved from the vertex as needed.
High and low ids are retrieved through unqualified calls to get_high_id(const T&) and get_low_id(const T&). This allows specialization of id calculations with attributed edges where simple calls for high/low ids may miss the edge information.
Public Functions Documentation
function UniqueTable
inline explicit UniqueTable(
int init_capacity =1000
)Constructor for small graphs.
Parameters:
- init_capacity The starting capacity for the table.
function size
inline int size() constReturn: The current number of entries.
function clear
inline void clear()Erases all entries.
function Release
inline void Release()Releases all the memory associated with managing this table with BDD.
Note: The call for release is not mandatory. This functionality is experimental to discover best points that minimize memory usage considering the responsibilities of the BDD. The release keeps the data about the table, such as its size and capacity.
Postcondition: No use after release.
function FindOrAdd
inline WeakIntrusivePtr< T > & FindOrAdd(
int index,
int high_id,
int low_id
)Finds an existing BDD vertex or inserts a default constructed weak pointer for a new vertex.
Parameters:
- index Index of the variable.
- high_id The id of the high vertex.
- low_id The id of the low vertex.
Return: Reference to the weak pointer.
Proper initialization of the new vertex is responsibility of the BDD.
Insertion operation may trigger resizing and rehashing. Rehashing eliminates expired weak pointers.
Collision resolution may also (opportunistically) remove expired pointers in the chain.
Updated on 2025-11-11 at 16:51:08 +0000
