Skip to content

lemire/cbitset

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

cbitset

Build Status Ubuntu 20.04 CI (GCC 9) Ubuntu 18.04 CI (GCC 7) MSYS2-CI Visual Studio-CI

Simple bitset library in C. It includes fast functions to compute cardinalities, unions, intersections...

  • It is tiny: it is made of three files (two header files and one source file).
  • It is tested.
  • It is fast.
  • It is straight C.

Usage in C:

bitset_t * b = bitset_create();
bitset_set(b,10);
bitset_get(b,10);// returns true
bitset_free(b); // frees memory

CMake

mkdir build
cd build
cmake ..
cmake --build . --config Release  
ctest .

The cmake build also supports installation. The header files will be installed in a distinct subdirectory (cbitset).

Old-school Makefiles

To run tests:

make
./unit

Prerequisites

C11-compatible compiler.

Visual Studio now supports the C11 and C17 standards.