From c71d6dbe7f4e772675351be872dd7bbcb2c62c20 Mon Sep 17 00:00:00 2001 From: Heedong Lee Date: Thu, 6 Sep 2018 13:22:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 코드정리 --- dclb/Sort.h | 2 +- dclb/samplemain.cpp | 33 --------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/dclb/Sort.h b/dclb/Sort.h index c20743c..235c489 100644 --- a/dclb/Sort.h +++ b/dclb/Sort.h @@ -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(last - first); @@ -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); diff --git a/dclb/samplemain.cpp b/dclb/samplemain.cpp index b214eef..80fdd5e 100644 --- a/dclb/samplemain.cpp +++ b/dclb/samplemain.cpp @@ -7,38 +7,5 @@ auto main() -> int { - - std::vector UnsortedVectordc(200000000); - for (int i = 0; i < 200000000; ++i) - { - UnsortedVectordc.push_back(std::rand() % 200000); - } - std::vector UnsortedVectorstd(200000000); - UnsortedVectorstd = UnsortedVectordc; - - std::vector 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 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 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 dc_ms = dcend - dcstart; - std::cout << "dc Sorting Took " << dc_ms.count() << "ms" << std::endl; - - - system("pause"); return 0; } \ No newline at end of file