dmd.backend.dvec

Compiler implementation of the D programming language.

Simple bit vector implementation.

Members

Functions

vec_and
void vec_and(vec_t v1, const(vec_base_t)* v2, const(vec_base_t)* v3)

Compute v1 = v2 & v3.

vec_andass
void vec_andass(vec_t v1, const(vec_base_t)* v2)

Compute v1 &= v2.

vec_calloc
vec_t vec_calloc(size_t numbits)

Allocate a vector given # of bits in it. Clear the vector.

vec_clear
void vec_clear(vec_t v)

Clear vector.

vec_clearbit
void vec_clearbit(size_t b, vec_t v)

Clear bit b in vector v.

vec_clearextrabits
void vec_clearextrabits(vec_t v)

Clear any extra bits in vector.

vec_clone
vec_t vec_clone(vec_t v)

Allocate copy of existing vector.

vec_copy
void vec_copy(vec_t to, vec_t from)

Copy vector.

vec_dim
inout(vec_base_t) vec_dim(vec_t v)
vec_disjoint
int vec_disjoint(const(vec_base_t)* v1, const(vec_base_t)* v2)

Return 1 if (v1 & v2) == 0

vec_equal
int vec_equal(vec_t v1, vec_t v2)

Return 1 if vectors are equal.

vec_free
void vec_free(vec_t v)

Free a vector.

vec_index
size_t vec_index(size_t b, vec_t vec)

Find first set bit starting from b in vector v. If no bit is found, return vec_numbits(v).

vec_init
void vec_init()

Initialize package.

vec_numBitsSet
uint vec_numBitsSet(vec_t vec)

Count number of set bits in vector v

vec_numbits
inout(vec_base_t) vec_numbits(vec_t v)
vec_or
void vec_or(vec_t v1, const(vec_base_t)* v2, const(vec_base_t)* v3)

Compute v1 = v2 | v3.

vec_orass
void vec_orass(vec_t v1, const(vec_base_t)* v2)

Compute v1 |= v2.

vec_println
void vec_println(vec_t v)

Write out vector.

vec_realloc
vec_t vec_realloc(vec_t v, size_t numbits)

Realloc a vector to have numbits bits in it. Extra bits are set to 0.

vec_recycle
void vec_recycle(vec_t v, size_t numbits)

Recycle a vector v to a new size numbits, clear all bits. Re-uses original if possible.

vec_set
void vec_set(vec_t v)

Set vector.

vec_setbit
void vec_setbit(size_t b, vec_t v)

Set bit b in vector v.

vec_sub
void vec_sub(vec_t v1, const(vec_base_t)* v2, const(vec_base_t)* v3)

Compute v1 = v2 - v3.

vec_subass
void vec_subass(vec_t v1, const(vec_base_t)* v2)

Compute v1 -= v2.

vec_term
void vec_term()

Terminate package.

vec_testbit
size_t vec_testbit(size_t b, vec_t v)

Test bit b in vector v.

vec_xor
void vec_xor(vec_t v1, const(vec_base_t)* v2, const(vec_base_t)* v3)

Compute v1 = v2 ^ v3.

vec_xorass
void vec_xorass(vec_t v1, const(vec_base_t)* v2)

Compute v1 ^= v2.

Structs

VecRange
struct VecRange

Turn a vec_t into an InputRange so we can foreach over each bit in the bit vector. Replaces for (size_t i = 0; (i = vec_index(i, v)) < vec_numbits(v); ++i) { ... } With foreach (i; VecRange(v)) { ... }

Meta