mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-12 02:13:36 +00:00
Get rid of non-portable drand48. (#1349)
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1349 Reviewed By: mdouze Differential Revision: D23289393 Pulled By: beauby fbshipit-source-id: a626bbf252ced4ae01abbc3dce4be50d9e628728
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1d4b1571e9
commit
c37e71456b
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <random>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
@@ -19,6 +20,7 @@
|
||||
#include <faiss/index_io.h>
|
||||
#include <faiss/IVFlib.h>
|
||||
|
||||
|
||||
using namespace faiss;
|
||||
|
||||
namespace {
|
||||
@@ -38,12 +40,15 @@ size_t nb = 1000;
|
||||
// nb of queries
|
||||
size_t nq = 200;
|
||||
|
||||
std::mt19937 rng;
|
||||
|
||||
std::vector<float> make_data(size_t n)
|
||||
{
|
||||
std::vector <float> database (n * d);
|
||||
std::uniform_real_distribution<> distrib;
|
||||
|
||||
for (size_t i = 0; i < n * d; i++) {
|
||||
database[i] = drand48();
|
||||
database[i] = distrib(rng);
|
||||
}
|
||||
return database;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user