Skip to content

Commit d050207

Browse files
committed
variable rename
1 parent ff07e08 commit d050207

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

include/sketch/sketch_columns.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class FixedSizeSketchColumn {
7777
class ResizeableSketchColumn {
7878
private:
7979
static uint64_t seed;
80-
Bucket *aligned_buckets;
80+
Bucket *buckets;
8181
Bucket deterministic_bucket = {0, 0};
8282
uint16_t col_idx; // determines column seeding
8383
uint8_t capacity;
@@ -115,7 +115,7 @@ class ResizeableSketchColumn {
115115
os << "Column Index: " << (int)sketch.col_idx << std::endl;
116116
os << "Deterministic Bucket: " << sketch.deterministic_bucket << std::endl;
117117
for (size_t i = 0; i < sketch.capacity; ++i) {
118-
os << "Bucket[" << i << "]: " << sketch.aligned_buckets[i] << std::endl;
118+
os << "Bucket[" << i << "]: " << sketch.buckets[i] << std::endl;
119119
}
120120
return os;
121121
}
@@ -126,7 +126,7 @@ class ResizeableSketchColumn {
126126
return false;
127127
}
128128
for (size_t i = 0; i < other_depth; ++i) {
129-
if (aligned_buckets[i] != other.aligned_buckets[i]) {
129+
if (buckets[i] != other.buckets[i]) {
130130
return false;
131131
}
132132
}

src/sketch_columns.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,18 @@ void FixedSizeSketchColumn::update(const vec_t update) {
6868

6969
ResizeableSketchColumn::ResizeableSketchColumn(uint8_t start_capacity, uint16_t col_idx) :
7070
capacity(start_capacity), col_idx(col_idx) {
71-
aligned_buckets = new Bucket[start_capacity];
72-
std::memset(aligned_buckets, 0, capacity * sizeof(Bucket));
71+
buckets = new Bucket[start_capacity];
72+
std::memset(buckets, 0, capacity * sizeof(Bucket));
7373
}
7474

7575
ResizeableSketchColumn::ResizeableSketchColumn(const ResizeableSketchColumn &other) :
7676
capacity(other.capacity), col_idx(other.col_idx), deterministic_bucket(other.deterministic_bucket) {
77-
aligned_buckets = new Bucket[capacity];
78-
std::memcpy(aligned_buckets, other.aligned_buckets, capacity * sizeof(Bucket));
77+
buckets = new Bucket[capacity];
78+
std::memcpy(buckets, other.buckets, capacity * sizeof(Bucket));
7979
}
8080

8181
ResizeableSketchColumn::~ResizeableSketchColumn() {
82-
delete[] aligned_buckets;
82+
delete[] buckets;
8383
}
8484

8585
/*
@@ -92,20 +92,20 @@ void ResizeableSketchColumn::reallocate(uint8_t new_capacity) {
9292
std::memset(new_buckets + capacity, 0,
9393
(new_capacity - capacity) * sizeof(Bucket));
9494
}
95-
std::memcpy(new_buckets, aligned_buckets,
95+
std::memcpy(new_buckets, buckets,
9696
std::min(capacity, new_capacity) * sizeof(Bucket));
97-
delete[] aligned_buckets;
97+
delete[] buckets;
9898

99-
aligned_buckets = new_buckets;
99+
buckets = new_buckets;
100100
capacity = new_capacity;
101101
}
102102
void ResizeableSketchColumn::clear() {
103-
std::memset(aligned_buckets, 0, capacity * sizeof(Bucket));
103+
std::memset(buckets, 0, capacity * sizeof(Bucket));
104104
deterministic_bucket = {0, 0};
105105
}
106106

107107
void ResizeableSketchColumn::serialize(std::ostream &binary_out) const {
108-
binary_out.write((char *) aligned_buckets, capacity * sizeof(Bucket));
108+
binary_out.write((char *) buckets, capacity * sizeof(Bucket));
109109
binary_out.write((char *) &deterministic_bucket, sizeof(Bucket));
110110
binary_out.write((char *) &capacity, sizeof(uint8_t));
111111
binary_out.write((char *) &col_idx, sizeof(uint8_t));
@@ -116,8 +116,8 @@ SketchSample<vec_t> ResizeableSketchColumn::sample() const {
116116
return {0, ZERO}; // the "first" bucket is deterministic so if all zero then no edges to return
117117
}
118118
for (size_t i = capacity; i > 0; --i) {
119-
if (Bucket_Boruvka::is_good(aligned_buckets[i - 1], seed)) {
120-
return {aligned_buckets[i - 1].alpha, GOOD};
119+
if (Bucket_Boruvka::is_good(buckets[i - 1], seed)) {
120+
return {buckets[i - 1].alpha, GOOD};
121121
}
122122
}
123123
return {0, FAIL};
@@ -135,7 +135,7 @@ void ResizeableSketchColumn::update(const vec_t update) {
135135
size_t new_capacity = ((depth >> 2) << 2) + 4;
136136
reallocate(new_capacity);
137137
}
138-
aligned_buckets[depth] ^= {update, checksum};
138+
buckets[depth] ^= {update, checksum};
139139
}
140140

141141
void ResizeableSketchColumn::merge(ResizeableSketchColumn &other) {
@@ -144,14 +144,14 @@ void ResizeableSketchColumn::merge(ResizeableSketchColumn &other) {
144144
reallocate(other.capacity);
145145
}
146146
for (size_t i = 0; i < other.capacity; ++i) {
147-
aligned_buckets[i] ^= other.aligned_buckets[i];
147+
buckets[i] ^= other.buckets[i];
148148
}
149149
}
150150

151151
uint8_t ResizeableSketchColumn::get_depth() const {
152152
// TODO - maybe rely on flag vectors
153153
for (size_t i = capacity; i > 0; --i) {
154-
if (!Bucket_Boruvka::is_empty(aligned_buckets[i - 1])) {
154+
if (!Bucket_Boruvka::is_empty(buckets[i - 1])) {
155155
return i;
156156
}
157157
}

0 commit comments

Comments
 (0)