Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #3: Update Annoy version #4

Merged
merged 1 commit into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build-wrapper:

test: tests/data/text8-vector.json
node tests/smalltest.js
node tests/smalltest-manhattan.js
node tests/basictests.js basic-config.js

big-test: tests/data/GoogleNews-vectors-negative300.json
Expand Down
8 changes: 6 additions & 2 deletions annoyindexwrapper.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "annoyindexwrapper.h"
#include "kissrandom.h"
#include <vector>

using namespace v8;
Expand All @@ -10,10 +11,13 @@ AnnoyIndexWrapper::AnnoyIndexWrapper(int dimensions, const char *metricString) :
annoyDimensions(dimensions) {

if (strcmp(metricString, "Angular") == 0) {
annoyIndex = new AnnoyIndex<int, float, Angular, RandRandom>(dimensions);
annoyIndex = new AnnoyIndex<int, float, Angular, Kiss64Random>(dimensions);
}
else if (strcmp(metricString, "Manhattan") == 0) {
annoyIndex = new AnnoyIndex<int, float, Manhattan, Kiss64Random>(dimensions);
}
else {
annoyIndex = new AnnoyIndex<int, float, Euclidean, RandRandom>(dimensions);
annoyIndex = new AnnoyIndex<int, float, Euclidean, Kiss64Random>(dimensions);
}
}

Expand Down
Loading