@@ -50,13 +50,13 @@ void benchmarkStdVectorBool(){
5050 std::cout << " [std::vector<bool>] True count: " << true_count << std::endl;
5151}
5252
53- // Benchmarks the performance of bowen::bitvector for setting, assigning, accessing, and traversing elements.
53+ // Benchmarks the performance of bowen::BitVector for setting, assigning, accessing, and traversing elements.
5454void benchmarkBowenBitvector (){
5555
56- std::cout << " Benchmarking bowen::bitvector ..." << std::endl;
56+ std::cout << " Benchmarking bowen::BitVector ..." << std::endl;
5757
5858 // Define a bitvector
59- bowen::bitvector bool_vector (SIZE);
59+ bowen::BitVector bool_vector (SIZE);
6060
6161 // Time setting each element
6262 auto start_set = std::chrono::high_resolution_clock::now ();
@@ -65,15 +65,15 @@ void benchmarkBowenBitvector(){
6565 }
6666 auto end_set = std::chrono::high_resolution_clock::now ();
6767 auto duration_set = std::chrono::duration_cast<std::chrono::milliseconds>(end_set - start_set);
68- std::cout << " [bowen::bitvector ] Setting all elements took " << duration_set.count () << " milliseconds." << std::endl;
68+ std::cout << " [bowen::BitVector ] Setting all elements took " << duration_set.count () << " milliseconds." << std::endl;
6969
7070 // Time setting each element using assign
7171 auto start_assign = std::chrono::high_resolution_clock::now ();
72- bowen::bitvector vector2;
72+ bowen::BitVector vector2;
7373 vector2.assign (SIZE, 1 );
7474 auto end_assign = std::chrono::high_resolution_clock::now ();
7575 auto duration_assign = std::chrono::duration_cast<std::chrono::milliseconds>(end_assign - start_assign);
76- std::cout << " [bowen::bitvector ] Assigning all elements took " << duration_assign.count () << " milliseconds." << std::endl;
76+ std::cout << " [bowen::BitVector ] Assigning all elements took " << duration_assign.count () << " milliseconds." << std::endl;
7777
7878 // Time accessing each element
7979 size_t true_count = 0 ;
@@ -85,7 +85,7 @@ void benchmarkBowenBitvector(){
8585 }
8686 auto end_access = std::chrono::high_resolution_clock::now ();
8787 auto duration_access = std::chrono::duration_cast<std::chrono::milliseconds>(end_access - start_access);
88- std::cout << " [bowen::bitvector ] Accessing all elements took " << duration_access.count () << " milliseconds." << std::endl;
88+ std::cout << " [bowen::BitVector ] Accessing all elements took " << duration_access.count () << " milliseconds." << std::endl;
8989
9090 // Time traversing the entire vector
9191 auto start_traverse = std::chrono::high_resolution_clock::now ();
@@ -96,16 +96,16 @@ void benchmarkBowenBitvector(){
9696 }
9797 auto end_traverse = std::chrono::high_resolution_clock::now ();
9898 auto duration_traverse = std::chrono::duration_cast<std::chrono::milliseconds>(end_traverse - start_traverse);
99- std::cout << " [bowen::bitvector ] Traversing all elements took " << duration_traverse.count () << " milliseconds." << std::endl;
99+ std::cout << " [bowen::BitVector ] Traversing all elements took " << duration_traverse.count () << " milliseconds." << std::endl;
100100
101- std::cout << " [bowen::bitvector ] True count: " << true_count << std::endl;
101+ std::cout << " [bowen::BitVector ] True count: " << true_count << std::endl;
102102}
103103
104- // Compares the behavior of bowen::bitvector against std::vector<bool> for basic operations.
104+ // Compares the behavior of bowen::BitVector against std::vector<bool> for basic operations.
105105void testBitvectorAgainstStdVectorBool (){
106106
107107 // Define a bitvector and a vector<bool>
108- bowen::bitvector bool_vector1 (SIZE);
108+ bowen::BitVector bool_vector1 (SIZE);
109109 std::vector<bool > bool_vector2 (SIZE);
110110 // Time setting each element
111111 auto start_set = std::chrono::high_resolution_clock::now ();
@@ -134,14 +134,14 @@ void testBitvectorAgainstStdVectorBool(){
134134
135135}
136136
137- // Tests the incrementUntilZero method of bowen::bitvector .
137+ // Tests the incrementUntilZero method of bowen::BitVector .
138138// This method is expected to increment a counter starting from a given position
139139// as long as it encounters '1's in the bitvector, stopping at the first '0' or the end of the vector.
140140void testBitvectorIncrementUntilZero (){
141141 constexpr size_t SIZE = 128 *10 ; // Size of the bitvector
142142
143143 // Define a bitvector
144- bowen::bitvector bool_vector1 (SIZE);
144+ bowen::BitVector bool_vector1 (SIZE);
145145 // Time setting some elements to true
146146 int start = rand ()%(SIZE-2 );
147147 int correct_count=start;
@@ -165,7 +165,7 @@ void testBitvectorIncrementUntilZero(){
165165
166166void calculateSpeedup (double std_time, double bowen_time) {
167167 double speedup = std_time / bowen_time;
168- std::cout << " Speedup (std::vector<bool> vs bowen::bitvector ): " << speedup << " x" << std::endl;
168+ std::cout << " Speedup (std::vector<bool> vs bowen::BitVector ): " << speedup << " x" << std::endl;
169169}
170170
171171int main () {
@@ -175,7 +175,7 @@ int main() {
175175 auto end_std = std::chrono::high_resolution_clock::now ();
176176 double std_time = std::chrono::duration_cast<std::chrono::milliseconds>(end_std - start_std).count ();
177177
178- // Benchmark bowen::bitvector
178+ // Benchmark bowen::BitVector
179179 auto start_bowen = std::chrono::high_resolution_clock::now ();
180180 benchmarkBowenBitvector ();
181181 auto end_bowen = std::chrono::high_resolution_clock::now ();
0 commit comments