| | 132 | // gl.reset(); |
|---|
| | 133 | // int nd = gl.find_duplicates(19); |
|---|
| | 134 | // printf("duplicates:\n"); |
|---|
| | 135 | // for(int i=0; i<nd; i++) { |
|---|
| | 136 | // // 1st method: retrieve_duplicates_VI |
|---|
| | 137 | // // vector<int> dupl_vector = gl.retrieve_duplicates_VI(i); |
|---|
| | 138 | // // for(vector<int>::iterator it = dupl_vector.begin(); it != dupl_vector.end(); it++) { |
|---|
| | 139 | // // printf("%s%s\n", gl.currentEntryAsString(*it).c_str(), gl.getSignature(*it).c_str()); |
|---|
| | 140 | // // } |
|---|
| | 141 | // |
|---|
| | 142 | // // 2nd method: retrieve_duplicates_PI |
|---|
| | 143 | // int * dupl_vector = gl.retrieve_duplicates_PI(i); |
|---|
| | 144 | // int j = 0; |
|---|
| | 145 | // while(dupl_vector[j] != -1) { |
|---|
| | 146 | // printf("%s%s\n", gl.currentEntryAsString(dupl_vector[j]).c_str(), gl.getSignature(dupl_vector[j]).c_str()); |
|---|
| | 147 | // j++; |
|---|
| | 148 | // } |
|---|
| | 149 | // delete [] dupl_vector; |
|---|
| | 150 | |
|---|
| | 151 | // printf("--------------------------------------------------- \n"); |
|---|
| | 152 | // } |
|---|
| | 153 | |
|---|
| | 154 | // ------------------- snapshot --------------------------------------------- |
|---|
| | 155 | |
|---|
| | 156 | gl.delete_all_snapshots(); |
|---|
| | 157 | int handle = gl.snapshot(); |
|---|
| | 158 | printf("num games: %d, num hits: %d\n", gl.size(), gl.numHits()); |
|---|
| | 159 | |
|---|
| 133 | | int nd = gl.find_duplicates(19); |
|---|
| 134 | | printf("duplicates:\n"); |
|---|
| 135 | | for(int i=0; i<nd; i++) { |
|---|
| 136 | | // 1st method: retrieve_duplicates_VI |
|---|
| 137 | | // vector<int> dupl_vector = gl.retrieve_duplicates_VI(i); |
|---|
| 138 | | // for(vector<int>::iterator it = dupl_vector.begin(); it != dupl_vector.end(); it++) { |
|---|
| 139 | | // printf("%s%s\n", gl.currentEntryAsString(*it).c_str(), gl.getSignature(*it).c_str()); |
|---|
| 140 | | // } |
|---|
| 141 | | |
|---|
| 142 | | // 2nd method: retrieve_duplicates_PI |
|---|
| 143 | | int * dupl_vector = gl.retrieve_duplicates_PI(i); |
|---|
| 144 | | int j = 0; |
|---|
| 145 | | while(dupl_vector[j] != -1) { |
|---|
| 146 | | printf("%s%s\n", gl.currentEntryAsString(dupl_vector[j]).c_str(), gl.getSignature(dupl_vector[j]).c_str()); |
|---|
| 147 | | j++; |
|---|
| 148 | | } |
|---|
| 149 | | delete [] dupl_vector; |
|---|
| | 161 | printf("num games: %d, num hits: %d\n", gl.size(), gl.numHits()); |
|---|