Skip to content

A library to index a mesh data structure in a hash table and make powerfull search queries.

License

Notifications You must be signed in to change notification settings

LoicMarechal/libHash

Repository files navigation

libHash version 1.40

Overview

A hash table library that offers dynamicaly resizing tables and arbitrary number of hash keys insert and queries.

Build

Prerequisites for Linux or macOS

  • Install CMake
  • A valid C99 compiler
  • Open a shell window

Prerequisites for Windows

  • 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)

Build commands for all platforms

  • unarchive the ZIP file
  • cd libHash-master
  • mkdir build
  • cd build
  • cmake ..
  • cmake --build . --target install

Usage

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)

About

A library to index a mesh data structure in a hash table and make powerfull search queries.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published