#include "IndexFlat.h" #include #include #include void IndexFlatL2::add(int n, const float *x){ xb.insert(xb.end(), x, x+(n*d)); ntotal+=n; } void IndexFlatL2::search(int n, const float *x, int k, float *distances, int *labels){ for(int i = 0; i> pq; for(int j= 0; j=0; c--){ distances[i*k+c] = pq.top().first; labels[i*k+c] = pq.top().second; pq.pop(); } for(int step=count; step