Changeset 2386:81b47fc5c444 in lemon-0.x for test/radix_sort_test.cc
- Timestamp:
- 03/02/07 19:04:28 (18 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/radix_sort_test.cc
r2242 r2386 33 33 using namespace lemon; 34 34 35 typedef unsigned char uchar; 36 35 37 void checkRadixSort() { 36 38 { … … 49 51 vector<unsigned char> data1(n), data2(n); 50 52 for (int i = 0; i < n; ++i) { 51 data1[i] = data2[i] = rnd[ (unsigned char)200];53 data1[i] = data2[i] = rnd[uchar(200)]; 52 54 } 53 55 radixSort(data1.begin(), data1.end()); … … 76 78 vector<unsigned char> data1(n), data2(n); 77 79 for (int i = 0; i < n; ++i) { 78 data1[i] = data2[i] = rnd[ (unsigned char)200];80 data1[i] = data2[i] = rnd[uchar(200)]; 79 81 } 80 82 counterSort(data1.begin(), data1.end()); … … 97 99 98 100 const int n = 100; 99 const int e = (int)(n * log((double)n));101 const int e = int(n * log(double(n))); 100 102 101 103 Graph graph; … … 118 120 Graph::EdgeMap<bool> was(graph, false); 119 121 120 for (int i = 0; i < (int)edges.size(); ++i) {122 for (int i = 0; i < int(edges.size()); ++i) { 121 123 check(!was[edges[i]], "Test failed"); 122 124 was[edges[i]] = true; 123 125 } 124 126 125 for (int i = 1; i < (int)edges.size(); ++i) {127 for (int i = 1; i < int(edges.size()); ++i) { 126 128 check(graph.id(graph.source(edges[i - 1])) <= 127 129 graph.id(graph.source(edges[i])), "Test failed"); … … 136 138 137 139 const int n = 100; 138 const int e = (int)(n * log((double)n));140 const int e = int(n * log(double(n))); 139 141 140 142 Graph graph; … … 161 163 Graph::EdgeMap<bool> was(graph, false); 162 164 163 for (int i = 0; i < (int)edges.size(); ++i) {165 for (int i = 0; i < int(edges.size()); ++i) { 164 166 check(!was[edges[i]], "Test failed"); 165 167 was[edges[i]] = true; 166 168 } 167 169 168 for (int i = 1; i < (int)edges.size(); ++i) {170 for (int i = 1; i < int(edges.size()); ++i) { 169 171 check(graph.id(graph.target(edges[i - 1])) < 170 172 graph.id(graph.target(edges[i])) ||
Note: See TracChangeset
for help on using the changeset viewer.