| | 153 | // gl.reset(); |
|---|
| | 154 | // int nd = gl.find_duplicates(19); |
|---|
| | 155 | // printf("duplicates:\n"); |
|---|
| | 156 | // for(int i=0; i<nd; i++) { |
|---|
| | 157 | // // 1st method: retrieve_duplicates_VI |
|---|
| | 158 | // // vector<int> dupl_vector = gl.retrieve_duplicates_VI(i); |
|---|
| | 159 | // // for(vector<int>::iterator it = dupl_vector.begin(); it != dupl_vector.end(); it++) { |
|---|
| | 160 | // // printf("%s%s\n", gl.currentEntryAsString(*it).c_str(), gl.getSignature(*it).c_str()); |
|---|
| | 161 | // // } |
|---|
| | 162 | // |
|---|
| | 163 | // // 2nd method: retrieve_duplicates_PI |
|---|
| | 164 | // int * dupl_vector = gl.retrieve_duplicates_PI(i); |
|---|
| | 165 | // int j = 0; |
|---|
| | 166 | // while(dupl_vector[j] != -1) { |
|---|
| | 167 | // printf("%s%s\n", gl.currentEntryAsString(dupl_vector[j]).c_str(), gl.getSignature(dupl_vector[j]).c_str()); |
|---|
| | 168 | // j++; |
|---|
| | 169 | // } |
|---|
| | 170 | // delete [] dupl_vector; |
|---|
| | 171 | |
|---|
| | 172 | // printf("--------------------------------------------------- \n"); |
|---|
| | 173 | // } |
|---|
| | 174 | |
|---|
| | 175 | // ------------------- snapshot --------------------------------------------- |
|---|
| | 176 | |
|---|
| | 177 | gl.delete_all_snapshots(); |
|---|
| | 178 | int handle = gl.snapshot(); |
|---|
| | 179 | printf("num games: %d, num hits: %d\n", gl.size(), gl.numHits()); |
|---|
| | 180 | |
|---|
| 154 | | int nd = gl.find_duplicates(19); |
|---|
| 155 | | printf("duplicates:\n"); |
|---|
| 156 | | for(int i=0; i<nd; i++) { |
|---|
| 157 | | // 1st method: retrieve_duplicates_VI |
|---|
| 158 | | // vector<int> dupl_vector = gl.retrieve_duplicates_VI(i); |
|---|
| 159 | | // for(vector<int>::iterator it = dupl_vector.begin(); it != dupl_vector.end(); it++) { |
|---|
| 160 | | // printf("%s%s\n", gl.currentEntryAsString(*it).c_str(), gl.getSignature(*it).c_str()); |
|---|
| 161 | | // } |
|---|
| 162 | | |
|---|
| 163 | | // 2nd method: retrieve_duplicates_PI |
|---|
| 164 | | int * dupl_vector = gl.retrieve_duplicates_PI(i); |
|---|
| 165 | | int j = 0; |
|---|
| 166 | | while(dupl_vector[j] != -1) { |
|---|
| 167 | | printf("%s%s\n", gl.currentEntryAsString(dupl_vector[j]).c_str(), gl.getSignature(dupl_vector[j]).c_str()); |
|---|
| 168 | | j++; |
|---|
| 169 | | } |
|---|
| 170 | | delete [] dupl_vector; |
|---|
| | 182 | printf("num games: %d, num hits: %d\n", gl.size(), gl.numHits()); |
|---|