cucon/uset.h: Integer-Keyed (Sparse) Sets
[Associative Containers (trees, maps, sets)]

Data Structures

struct  cucon_uset


#define cucon_uset_cct   cucon_uset_init
#define cucon_uset_cct_copy   cucon_uset_init_copy


void cucon_uset_init (cucon_uset_t set)
cucon_uset_t cucon_uset_new (void)
void cucon_uset_init_copy (cucon_uset_t set, cucon_uset_t src_set)
cucon_uset_t cucon_uset_new_copy (cucon_uset_t src_set)
void cucon_uset_swap (cucon_uset_t set0, cucon_uset_t set1)
cu_bool_t cucon_uset_eq (cucon_uset_t set0, cucon_uset_t set1)
cu_hash_t cucon_uset_hash (cucon_uset_t set)
size_t cucon_uset_size (cucon_uset_t set)
cu_bool_t cucon_uset_is_empty (cucon_uset_t set)
cu_bool_t cucon_uset_insert (cucon_uset_t set, uintptr_t key)
cu_bool_t cucon_uset_erase (cucon_uset_t set, uintptr_t key)
cu_bool_t cucon_uset_erase_keep_cap (cucon_uset_t set, uintptr_t key)
void cucon_uset_update_cap (cucon_uset_t set)
uintptr_t cucon_uset_pop_any (cucon_uset_t set)
cu_bool_t cucon_uset_find (cucon_uset_t set, uintptr_t key)
void cucon_uset_iter (cucon_uset_t set, cu_clop(cb, void, uintptr_t key))
void cucon_uset_iter_increasing (cucon_uset_t set, cu_clop(cb, void, uintptr_t key))
cu_bool_t cucon_uset_conj (cucon_uset_t set, cu_clop(cb, cu_bool_t, uintptr_t key))
void cucon_uset_assign_isecn_union (cucon_uset_t set0, cucon_uset_t set1)
void cucon_uset_move_isecn (cucon_uset_t dst, cucon_uset_t src0, cucon_uset_t src1)
void cucon_uset_assign_isecn (cucon_uset_t dst, cucon_uset_t src)
void cucon_uset_assign_union (cucon_uset_t dst, cucon_uset_t src)
void cucon_uset_print (cucon_uset_t set, FILE *out)
void cucon_uset_dump_stats (cucon_uset_t set, FILE *out)

Detailed Description

See also:
cucon/umap.h: Integer-Keyed Hash Map
cucon/bitarray.h: Array of Bits

Define Documentation

#define cucon_uset_cct   cucon_uset_init
#define cucon_uset_cct_copy   cucon_uset_init_copy

Function Documentation

void cucon_uset_assign_isecn ( cucon_uset_t  dst,
cucon_uset_t  src 

Assigns dst := dstsrc.

void cucon_uset_assign_isecn_union ( cucon_uset_t  set0,
cucon_uset_t  set1 

Assign (set0, set1) := (set0set1, set1 := set0set1) by moving elements set0set1 from set0 to set1.

void cucon_uset_assign_union ( cucon_uset_t  dst,
cucon_uset_t  src 

Assigns dst := dstsrc.

cu_bool_t cucon_uset_conj ( cucon_uset_t  set,
cu_clop(cb, cu_bool_t, uintptr_t key)   

Sequentially conjunct cb over elements of set.

cu_bool_t cucon_uset_eq ( cucon_uset_t  set0,
cucon_uset_t  set1 

True iff set0 and set1 contain the same elements.

cu_bool_t cucon_uset_erase ( cucon_uset_t  set,
uintptr_t  key 

If keyset, erase it and return true, else return false.

cu_bool_t cucon_uset_erase_keep_cap ( cucon_uset_t  set,
uintptr_t  key 

Same as cucon_uset_erase, but don't resize the internal vector. This can speed up a sequence of multiple erase operations, when done, call cucon_uset_update_cap.

cu_bool_t cucon_uset_find ( cucon_uset_t  set,
uintptr_t  key 

True iff keyset.

cu_hash_t cucon_uset_hash ( cucon_uset_t  set  ) 

Returns a hash of the elements of set.

void cucon_uset_init ( cucon_uset_t  set  ) 

Constructs set as an empty set.

void cucon_uset_init_copy ( cucon_uset_t  set,
cucon_uset_t  src_set 

Constructs set as a copy of src_set.

cu_bool_t cucon_uset_insert ( cucon_uset_t  set,
uintptr_t  key 

If keyset, insert it and return true, else return false.

cu_bool_t cucon_uset_is_empty ( cucon_uset_t  set  ) 

True iff set is empty.

void cucon_uset_iter ( cucon_uset_t  set,
cu_clop(cb, void, uintptr_t key)   

Calls cb(key) for each keyset.

See also:
void cucon_uset_iter_increasing ( cucon_uset_t  set,
cu_clop(cb, void, uintptr_t key)   

Calls cb(key) for each keyset in increasing order.

See also:
void cucon_uset_move_isecn ( cucon_uset_t  dst,
cucon_uset_t  src0,
cucon_uset_t  src1 

Assigns (dst, src0, src1) := (src0src1, src0src1, src1src0).

cucon_uset_t cucon_uset_new ( void   ) 

Returns an empty set.

cucon_uset_t cucon_uset_new_copy ( cucon_uset_t  src_set  ) 

Returns a copy of src_set.

uintptr_t cucon_uset_pop_any ( cucon_uset_t  set  ) 

Pop any element of set and return it. A random number generator is used to select a position in the hash array in order to preserve the average case structure of set.

void cucon_uset_print ( cucon_uset_t  set,
FILE *  out 

Prints set in conventional set notation.

size_t cucon_uset_size ( cucon_uset_t  set  ) 

The number of elements in set.

void cucon_uset_swap ( cucon_uset_t  set0,
cucon_uset_t  set1 

Swap the contents of set0 and set1.

void cucon_uset_update_cap ( cucon_uset_t  set  ) 

Call this after using cucon_uset_erase_keep_cap.

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