Skip to content

Commit

Permalink
Got N^2 build working, just need correct offset
Browse files Browse the repository at this point in the history
  • Loading branch information
kgorking committed Mar 29, 2024
1 parent 19fbf38 commit 1751edb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions unittest/listarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ TEST_CASE("Gorking list") {
// Load up steppers
node* current = &nodes[0];
stepper steppers[32];
for (int i = 0; i < log_n; i++) {
int const step = (N >> i);
int const next_step = step;
steppers[log_n - 1 - i] = {next_step, step, current};
for (int i = 0, step = 1<<(log_n-1); i < log_n; i++, step >>= 1) {
//int const step = (N >> i);
int const next_step = std::min(N-1, step);
steppers[log_n-1-i] = {i + next_step, step, current};
current = current->next[0];
}
// std::make_heap(steppers, steppers + log_n);
// std::make_heap(steppers, steppers + log_n); // not needed

// Rebuild the jump points in O(n log log n) time
int i = 0;
Expand Down

0 comments on commit 1751edb

Please sign in to comment.