BitVecEmpty

Table of Contents

BitVecEmpty

Description

Check if bitvector is empty.

Parameters

NameDirectionDescription
bvinBitvector to check

Usage example (from documentation)

  if (BitVecEmpty(&flags)) { /* handle empty case */ }

Usage example (Cross-references)

    
    // Test empty check
    result = result && !BitVecEmpty(&bv);
    
    // Clear and check empty
    // Clear and check empty
    BitVecClear(&bv);
    result = result && BitVecEmpty(&bv);
    result = result && (BitVecLen(&bv) == 0);
    result = result && (BitVecLen(&bv) == 0);
    result = result && (BitVecCapacity(&bv) == 0);
    result = result && BitVecEmpty(&bv);
    result = result && (BitVecByteSize(&bv) == 0);
    result = result && (BitVecLen(&bv) == 65);
    result = result && (BitVecCapacity(&bv) >= 65);
    result = result && !BitVecEmpty(&bv);
    result = result && (BitVecByteSize(&bv) >= 9); // At least 9 bytes for 65 bits

Share :

Related Posts

BitVecRunLengths

BitVecRunLengths Description Analyze run lengths in a bitvector. A run is a sequence of consecutive identical bits. Results array must be pre-allocated with sufficient space.

Read More

BitVecLen

BitVecLen Description Get number of bits currently in bitvector.

Read More

BitVecIsSorted

BitVecIsSorted Description Check if bits in bitvector are in sorted order. Useful for certain algorithms and data structures.

Read More