A hash table library that offers dynamicaly resizing tables and arbitrary number of hash keys insert and queries.
- Install CMake
- A valid C99 compiler
- Open a shell window
- You first need to install CMake. Do not forget to choose "add cmake to the path for all users", from the install panel.
- Then you need a valid C compiler like the free Visual Studio Community 2019
- Open the x64 Native Tools Command Prompt for VS (or x86 if you need to build a 32-bit version)
- unarchive the ZIP file
cd libHash-master
mkdir build
cd build
cmake ..
cmake --build . --target install
The libHash library is written in ANSI C.
It is made of a single C file and a header file to be compiled and linked alongside the calling program.
It may be used in C, C++, F77 and F90 programs (Fortran 77 and 90 APIs are provided).
Tested on Linux, macOS, and Windows 7->10.
int i, j, vertex, ball[100];
int64_t LibIdx;
LibIdx = hsh_NewTable();
// Hash each tet with their four vertices
for(i=1;i<=NmbTet;i++)
for(j=0;j<4;j++)
hsh_AddItem(LibIdx, HshTet, TetTab[i][j], i, 1);
// Find and print the ball of vertex 150
vertex = 150;
degree = hsh_GetItem(LibIdx, 0, HshAny, 1, &vertex, &ball, NULL);
for(i=0;i<degree;i++)
printf("%d\n", ball[i]);
hsh_FreeTable(HshIdx)