Skip to content

Commit

Permalink
Missed printing 'D' (facebookresearch#3433)
Browse files Browse the repository at this point in the history
Summary:
'I' was printed twice and 'D' (distance vector) was not printed. Fixed.

Pull Request resolved: facebookresearch#3433

Reviewed By: fxdawnn

Differential Revision: D57451544

Pulled By: junjieqi

fbshipit-source-id: fc17b3b467f8b2c4ad7d80b44866456d9146e530
  • Loading branch information
saarthdeshpande authored and abhinavdangeti committed Jul 12, 2024
1 parent 1b5db9a commit 48804ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tutorial/cpp/1-Flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ int main() {
printf("\n");
}

printf("I (5 last results)=\n");
printf("D (5 last results)=\n");
for (int i = nq - 5; i < nq; i++) {
for (int j = 0; j < k; j++)
printf("%5zd ", I[i * k + j]);
printf("%5f ", D[i * k + j]);
printf("\n");
}

Expand Down
7 changes: 2 additions & 5 deletions tutorial/cpp/2-IVFFlat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ int main() {
printf("\n");
}

index.nprobe = 10;
index.search(nq, xq, k, D, I);

printf("I=\n");
printf("D=\n");
for (int i = nq - 5; i < nq; i++) {
for (int j = 0; j < k; j++)
printf("%5zd ", I[i * k + j]);
printf("%5f ", D[i * k + j]);
printf("\n");
}

Expand Down
6 changes: 2 additions & 4 deletions tutorial/cpp/6-HNSW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,10 @@ int main() {
printf("\n");
}

index.search(nq, xq, k, D, I);

printf("I=\n");
printf("D=\n");
for (int i = nq - 5; i < nq; i++) {
for (int j = 0; j < k; j++)
printf("%5zd ", I[i * k + j]);
printf("%5f ", D[i * k + j]);
printf("\n");
}

Expand Down

0 comments on commit 48804ff

Please sign in to comment.