BucketInfo

Constructors

this
this(size_t num_buckets)

Constructor.

Members

Functions

clear
void clear()

Clears all bucket infos and sets the number of non-empty buckets to 0.

clearResize
void clearResize(size_t n)

Clears all bucket infos, sets the number of non-empty buckets to 0 and sets the total number of buckets to n.

create
void create(size_t bucket_index)

Creates a bucket info for the currently empty bucket specified by bucket_index, sets the length to 1; increases the number of non-empty buckets by 1.

filled_buckets
Bucket[] filled_buckets()

Obtains the list of bucket infos for the non-empty buckets. Each element contains the bucket index and the number of elements in the bucket.

length
size_t length()
load
float load()
max_load
size_t max_load()
num_buckets
size_t num_buckets()
num_filled_buckets
size_t num_filled_buckets()
opIndex
size_t opIndex(size_t bucket_index)

Obtains the number of elements in the bucket specified by bucket_index.

put
void put(size_t bucket_index)

Increases the length of the bucket info for the bucket specified by bucket_index by 1. If the bucket is currently empty, a bucket info is created and the number of non-empty buckets increased by 1.

remove
void remove(size_t bucket_index)

Decreases the length of the bucket info for the non-empty bucket specified by bucket_index by 1. Decreases the number of non-empty buckets by 1 if the bucket becomes empty.

update
void update(size_t bucket_index)

Increases the length of the bucket info for the non-empty bucket specified by bucket_index by 1.

Structs

Bucket
struct Bucket

Information about a non-empty bucket.

Meta