Commit 6602c21b by Marcus Winter

algorithms_cpp: block_size support in MergeSort

parent 9552a32a
......@@ -170,9 +170,6 @@ void MergeSort(
difference_type distance = last - first;
assert(distance >= 0);
assert(block_size == 0); // TODO(Georgios Christodoulou):
// Take block size into account
if (block_size == 0) {
block_size= (static_cast<size_t>(distance) / node.GetCoreCount());
if (block_size == 0)
......
......@@ -64,7 +64,7 @@ void MergeSortTest::TestDataStructures() {
MergeSortAllocate(array, array + kCountSize);
MergeSortAllocate(vector.begin(), vector.end());
MergeSortAllocate(array, array + kCountSize, std::less<int>(),
ExecutionPolicy(), 0);
ExecutionPolicy(), 2);
MergeSortAllocate(deque.begin(), deque.end());
for (size_t i = 0; i < kCountSize; i++) {
PT_EXPECT_EQ(vector_copy[i], array[i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment