Skip to content

Commit

Permalink
코드 정리
Browse files Browse the repository at this point in the history
코드정리
  • Loading branch information
arkiny committed Sep 6, 2018
1 parent f6f0c6b commit c71d6db
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
2 changes: 1 addition & 1 deletion dclb/Sort.h
Expand Up @@ -64,7 +64,6 @@ namespace dc
{
auto rootIndex = start;
auto rootItr = first+start;
//iLeftChild(i) = 2 * i + 1
auto leftChildIndex = 2 * rootIndex + 1;
auto end = static_cast<unsigned int>(last - first);

Expand Down Expand Up @@ -176,6 +175,7 @@ namespace dc
};
dc::sort(first, last, DefaultComparator);
}

// Don't care execution poliycy for now
//template< class ExecutionPolicy, class RandomIt >
//void sort(ExecutionPolicy&& policy, RandomIt first, RandomIt last);
Expand Down
33 changes: 0 additions & 33 deletions dclb/samplemain.cpp
Expand Up @@ -7,38 +7,5 @@

auto main() -> int
{

std::vector<int> UnsortedVectordc(200000000);
for (int i = 0; i < 200000000; ++i)
{
UnsortedVectordc.push_back(std::rand() % 200000);
}
std::vector<int> UnsortedVectorstd(200000000);
UnsortedVectorstd = UnsortedVectordc;

std::vector<int> UnsortedVectorarr(200000000);
UnsortedVectorarr = UnsortedVectordc;

auto stdstart = std::chrono::high_resolution_clock::now();
std::sort(UnsortedVectorstd.begin(), UnsortedVectorstd.end());
auto stdend = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> std_ms = stdend - stdstart;

std::cout << "Std Sorting Took " << std_ms.count() << "ms" << std::endl;

auto arrstart = std::chrono::high_resolution_clock::now();
JFFoundation::Sort(&UnsortedVectorarr[0], 0, UnsortedVectorarr.size()-1);
auto arrend = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> arr_ms = arrend - arrstart;
std::cout << "Jaraffe Sorting Took " << arr_ms.count() << "ms" << std::endl;

auto dcstart = std::chrono::high_resolution_clock::now();
dc::sort(UnsortedVectordc.begin(), UnsortedVectordc.end());
auto dcend = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> dc_ms = dcend - dcstart;
std::cout << "dc Sorting Took " << dc_ms.count() << "ms" << std::endl;


system("pause");
return 0;
}

0 comments on commit c71d6db

Please sign in to comment.