Changeset 466:de16f1f2d228 in lemon for test/radix_sort_test.cc
- Timestamp:
- 12/02/08 23:15:43 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/radix_sort_test.cc
r465 r466 100 100 101 101 102 void check CounterSort() {102 void checkStableRadixSort() { 103 103 { 104 104 std::vector<int> data1; … … 108 108 std::sort(data1.begin(), data1.end()); 109 109 110 counterSort(data2.begin(), data2.end());110 stableRadixSort(data2.begin(), data2.end()); 111 111 for (int i = 0; i < n; ++i) { 112 112 check(data1[i] == data2[i], "Test failed"); 113 113 } 114 114 115 counterSort(data2.begin(), data2.end(), Negate());115 stableRadixSort(data2.begin(), data2.end(), Negate()); 116 116 for (int i = 0; i < n; ++i) { 117 117 check(data1[i] == data2[n - 1 - i], "Test failed"); 118 118 } 119 119 120 counterSort(data2.begin(), data2.end(), negate);120 stableRadixSort(data2.begin(), data2.end(), negate); 121 121 for (int i = 0; i < n; ++i) { 122 122 check(data1[i] == data2[n - 1 - i], "Test failed"); … … 142 142 143 143 checkRadixSort(); 144 check CounterSort();144 checkStableRadixSort(); 145 145 146 146 return 0;
Note: See TracChangeset
for help on using the changeset viewer.