cucon/bitarray_slice.h: Bitarray Slices
[Linear Containers (lists, stacks, arrays)]

Data Structures

struct  cucon_bitarray_slice

Functions

size_t cucon_bitarray_slice_size (cucon_bitarray_slice_t sl)
cu_bool_t cucon_bitarray_slice_at (cucon_bitarray_slice_t sl, size_t i)
cu_word_t cucon_bitarray_slice_word_at (cucon_bitarray_slice_t sl, size_t i)
void cucon_bitarray_slice_set_at (cucon_bitarray_slice_t sl, size_t i, cu_bool_t v)
void cucon_bitarray_slice_init (cucon_bitarray_slice_t sl, cucon_bitarray_t ba, size_t start_index, size_t end_index)
void cucon_bitarray_slice_init_copy (cucon_bitarray_slice_t sl, cucon_bitarray_slice_t sl_src)
void cucon_bitarray_slice_init_sub (cucon_bitarray_slice_t sl, cucon_bitarray_slice_t sl_src, size_t start_index, size_t end_index)
void cucon_bitarray_slice_fill (cucon_bitarray_slice_t sl, cu_bool_t v)
void cucon_bitarray_slice_update_bool1f (cu_bool1f_t f, cucon_bitarray_slice_t dst)
void cucon_bitarray_slice_update_bool2f (cu_bool2f_t f, cucon_bitarray_slice_t dst, cucon_bitarray_slice_t src1)
void cucon_bitarray_slice_copy_bool1f (cu_bool1f_t f, cucon_bitarray_slice_t dst, cucon_bitarray_slice_t src0)
void cucon_bitarray_slice_copy_bool2f (cu_bool2f_t f, cucon_bitarray_slice_t dst, cucon_bitarray_slice_t src0, cucon_bitarray_slice_t src1)
void cucon_bitarray_slice_copy (cucon_bitarray_slice_t dst, cucon_bitarray_slice_t src)

Detailed Description

See also:
cucon/bitarray.h: Array of Bits

Function Documentation

cu_bool_t cucon_bitarray_slice_at ( cucon_bitarray_slice_t  sl,
size_t  i 
)

Read bit number i of sl.

void cucon_bitarray_slice_copy ( cucon_bitarray_slice_t  dst,
cucon_bitarray_slice_t  src 
)

Copy src to dst.

Precondition:
src must be at least as long as dst.
void cucon_bitarray_slice_copy_bool1f ( cu_bool1f_t  f,
cucon_bitarray_slice_t  dst,
cucon_bitarray_slice_t  src0 
)

Copy the image of the slice src0 under f to dst.

Precondition:
src0 must be at least as long as dst.
void cucon_bitarray_slice_copy_bool2f ( cu_bool2f_t  f,
cucon_bitarray_slice_t  dst,
cucon_bitarray_slice_t  src0,
cucon_bitarray_slice_t  src1 
)

Copy the image under f of zipped pairs from src0 and src1 to dst.

Precondition:
src0 and src1 must be at least as long as dst.
void cucon_bitarray_slice_fill ( cucon_bitarray_slice_t  sl,
cu_bool_t  v 
)

Fill sl with the constant value v.

void cucon_bitarray_slice_init ( cucon_bitarray_slice_t  sl,
cucon_bitarray_t  ba,
size_t  start_index,
size_t  end_index 
)

Initialise sl as a slice of ba covering the range from start_index up to end_index.

void cucon_bitarray_slice_init_copy ( cucon_bitarray_slice_t  sl,
cucon_bitarray_slice_t  sl_src 
)

Initialise sl to the same slice as sl_src.

void cucon_bitarray_slice_init_sub ( cucon_bitarray_slice_t  sl,
cucon_bitarray_slice_t  sl_src,
size_t  start_index,
size_t  end_index 
)

Initialise sl as a slice of the same array from which sl_src was constructed and covering start_index up to end_index relative to the start of sl_src.

void cucon_bitarray_slice_set_at ( cucon_bitarray_slice_t  sl,
size_t  i,
cu_bool_t  v 
)

Assign v to bit i of sl.

size_t cucon_bitarray_slice_size ( cucon_bitarray_slice_t  sl  ) 

The number of bits covered by sl.

void cucon_bitarray_slice_update_bool1f ( cu_bool1f_t  f,
cucon_bitarray_slice_t  dst 
)

Replace each bit x of dst with cu_bool1f_apply(f, x).

void cucon_bitarray_slice_update_bool2f ( cu_bool2f_t  f,
cucon_bitarray_slice_t  dst,
cucon_bitarray_slice_t  src1 
)

Replace each bit x of dst with cu_bool2f_apply(f, x, y), where y is the element of src1 at respective positions.

cu_word_t cucon_bitarray_slice_word_at ( cucon_bitarray_slice_t  sl,
size_t  i 
)

Return sizeof(cu_word_t)*8 bits from sl starting at i in the form of a cu_word_t. This is mostly useful to implement higher level functions like bitwise operations.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.