Skip to content

Commit

Permalink
removed final hash calls for eager bucket check
Browse files Browse the repository at this point in the history
  • Loading branch information
Gillgamesh committed Mar 13, 2024
1 parent 194770a commit 1d1ccf7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/sketch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,6 @@ SketchSample Sketch::sample() {
size_t idx = sample_idx++;
size_t first_column = idx * cols_per_sample;

if (Bucket_Boruvka::is_empty(buckets[num_buckets - 1]))
return {0, ZERO}; // the "first" bucket is deterministic so if all zero then no edges to return

if (Bucket_Boruvka::is_good(buckets[num_buckets - 1], checksum_seed()))
return {buckets[num_buckets - 1].alpha, GOOD};

#ifdef EAGER_BUCKET_CHECK
for (size_t col = first_column; col < first_column + cols_per_sample; ++col) {
vec_t col_good_buckets = good_buckets[col];
Expand All @@ -306,6 +300,13 @@ SketchSample Sketch::sample() {
return {0, FAIL};
#endif

if (Bucket_Boruvka::is_empty(buckets[num_buckets - 1]))
return {0, ZERO}; // the "first" bucket is deterministic so if all zero then no edges to return

if (Bucket_Boruvka::is_good(buckets[num_buckets - 1], checksum_seed()))
return {buckets[num_buckets - 1].alpha, GOOD};


for (size_t col = first_column; col < first_column + cols_per_sample; ++col) {
int row = bkt_per_col - 1;
while (Bucket_Boruvka::is_empty(buckets[col * bkt_per_col + row]) && row > 0) {
Expand Down

0 comments on commit 1d1ccf7

Please sign in to comment.