parcel | Lucy |
class variable | LUCY_BITVECTOR |
struct symbol | lucy_BitVector |
class nickname | lucy_BitVec |
header file | Lucy/Object/BitVector.h |
Lucy::Object::BitVector – An array of bits.
BitVector is a growable array of bits. All bits are initially zero.
lucy_BitVector* // incremented
lucy_BitVec_new(
size_t capacity
);
Create a new BitVector.
The number of bits that the initial array should be able to hold.
lucy_BitVector*
lucy_BitVec_init(
lucy_BitVector *self,
size_t capacity
);
Initialize a BitVector.
The number of bits that the initial array should be able to hold.
bool
lucy_BitVec_Get(
lucy_BitVector *self,
size_t tick
);
Return true if the bit at tick
has been set, false if it
hasn’t (regardless of whether it lies within the bounds of the
object’s capacity).
The requested bit.
void
lucy_BitVec_Set(
lucy_BitVector *self,
size_t tick
);
Set the bit at tick
to 1.
The bit to be set.
int32_t
lucy_BitVec_Next_Hit(
lucy_BitVector *self,
size_t tick
);
Returns the next set bit equal to or greater than tick
,
or -1 if no such bit exists.
void
lucy_BitVec_Clear(
lucy_BitVector *self,
size_t tick
);
Clear the indicated bit. (i.e. set it to 0).
The bit to be cleared.
void
lucy_BitVec_Clear_All(
lucy_BitVector *self
);
Clear all bits.
void
lucy_BitVec_Grow(
lucy_BitVector *self,
size_t capacity
);
If the BitVector does not already have enough room to hold the indicated number of bits, allocate more memory so that it can.
Least number of bits the BitVector should accomodate.
void
lucy_BitVec_And(
lucy_BitVector *self,
const lucy_BitVector *other
);
Modify the BitVector so that only bits which remain set are those which 1) were already set in this BitVector, and 2) were also set in the other BitVector.
Another BitVector.
void
lucy_BitVec_Or(
lucy_BitVector *self,
const lucy_BitVector *other
);
Modify the BitVector, setting all bits which are set in the other BitVector if they were not already set.
Another BitVector.
void
lucy_BitVec_Xor(
lucy_BitVector *self,
const lucy_BitVector *other
);
Modify the BitVector, performing an XOR operation against the other.
Another BitVector.
void
lucy_BitVec_And_Not(
lucy_BitVector *self,
const lucy_BitVector *other
);
Modify the BitVector, clearing all bits which are set in the other.
Another BitVector.
void
lucy_BitVec_Flip(
lucy_BitVector *self,
size_t tick
);
Invert the value of a bit.
The bit to invert.
void
lucy_BitVec_Flip_Block(
lucy_BitVector *self,
size_t offset,
size_t length
);
Invert each bit within a contiguous block.
Lower bound.
The number of bits to flip.
size_t
lucy_BitVec_Count(
lucy_BitVector *self
);
Return a count of the number of set bits.
lucy_I32Array* // incremented
lucy_BitVec_To_Array(
lucy_BitVector *self
);
Return an array where each element represents a set bit.
lucy_BitVector* // incremented
lucy_BitVec_Clone(
lucy_BitVector *self
);
Return a clone of the object.
Lucy::Object::BitVector is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.