Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix bug
  • Loading branch information
ChunjiangZhu committed Oct 24, 2019
1 parent 16ca7da commit 04dcaa0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python_bindings/nmslib.cc
Expand Up @@ -199,16 +199,17 @@ struct IndexWrapper {

py::object convertResult_rq(std::set<const Object*> res) {
// Create numpy arrays for the output
size_t size = res.Size();
size_t size = res.size();
py::array_t<int> ids(size);
py::array_t<dist_t> distances(size);

std::set<const Object*>::iterator it = res.begin();
int i=0;
while (it != res.end())
{
ids.mutable_at(i) = it->id();
ids.mutable_at(i) = (*it)->id();
//distances.mutable_at(size) = res->at(i)->id();
it++;
it++; i++;
}
return py::make_tuple(ids, distances);
}
Expand Down

0 comments on commit 04dcaa0

Please sign in to comment.