@@ -68,18 +68,18 @@ void FixedSizeSketchColumn::update(const vec_t update) {
6868
6969ResizeableSketchColumn::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
7575ResizeableSketchColumn::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
8181ResizeableSketchColumn::~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}
102102void 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
107107void 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
141141void 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
151151uint8_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