cbits 0.3.0
High-performance BitVector C-API & Python binding
 
Loading...
Searching...
No Matches
bitvector_internal.h File Reference

Internal inline helpers for BitVector operations. More...

#include "bitvector.h"
Include dependency graph for bitvector_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static size_t bv_word (const size_t pos)
 Compute the word index for a given bit position.
 
static size_t bv_bit (const size_t pos)
 Compute the bit offset within its 64-bit word.
 
static int bv__get_inline (const BitVector *bv, const size_t pos)
 Internal inline version of bv_get().
 
static void bv__set_inline (BitVector *bv, const size_t pos)
 Internal inline version of bv_set().
 
static void bv__clear_inline (BitVector *bv, const size_t pos)
 Internal inline version of bv_clear().
 
static void bv__flip_inline (BitVector *bv, const size_t pos)
 Internal inline version of bv_flip().
 
static void bv_apply_tail_mask (BitVector *bv)
 Mask off any excess bits in the last word of a BitVector.
 

Detailed Description

Internal inline helpers for BitVector operations.

Provides inline functions used by the C backend and Python bindings:

See also
bitvector.h
Author
lambdaphoenix
Version
0.3.0

Function Documentation

◆ bv__clear_inline()

static void bv__clear_inline ( BitVector bv,
const size_t  pos 
)
inlinestatic

Internal inline version of bv_clear().

Parameters
bvPointer to the BitVector
posBit index
Since
0.2.1

◆ bv__flip_inline()

static void bv__flip_inline ( BitVector bv,
const size_t  pos 
)
inlinestatic

Internal inline version of bv_flip().

Parameters
bvPointer to the BitVector
posBit index
Since
0.2.1

◆ bv__get_inline()

static int bv__get_inline ( const BitVector bv,
const size_t  pos 
)
inlinestatic

Internal inline version of bv_get().

Parameters
bvPointer to the BitVector
posBit index
Returns
0 or 1 depending on the bit value
Since
0.2.1

◆ bv__set_inline()

static void bv__set_inline ( BitVector bv,
const size_t  pos 
)
inlinestatic

Internal inline version of bv_set().

Parameters
bvPointer to the BitVector
posBit index
Since
0.2.1

◆ bv_apply_tail_mask()

static void bv_apply_tail_mask ( BitVector bv)
inlinestatic

Mask off any excess bits in the last word of a BitVector.

Parameters
bvPointer to an allocated BitVector.
Since
0.1.2

◆ bv_bit()

static size_t bv_bit ( const size_t  pos)
inlinestatic

Compute the bit offset within its 64-bit word.

Parameters
posbit index
Returns
Offset in [0...63] inside the 64-bit word.

◆ bv_word()

static size_t bv_word ( const size_t  pos)
inlinestatic

Compute the word index for a given bit position.

Parameters
posbit index
Returns
Index of the 64-bit word containing that bit.