|
|
@ -14,7 +14,7 @@ float vec_dist(VecData x, VecData y) { |
|
|
|
return sqrt(sum); |
|
|
|
} |
|
|
|
|
|
|
|
VecData* fvecs_read(const char* filename, int* bounds) { |
|
|
|
VecData* fvecs_read(const char* filename, int* bounds, int* num) { |
|
|
|
FILE* fid = fopen(filename, "rb"); |
|
|
|
if (fid == NULL) { |
|
|
|
fprintf(stderr, "I/O error : Unable to open the file %s\n", filename); |
|
|
@ -66,5 +66,8 @@ VecData* fvecs_read(const char* filename, int* bounds) { |
|
|
|
|
|
|
|
|
|
|
|
fclose(fid); |
|
|
|
if (num != NULL) { |
|
|
|
*num = n; |
|
|
|
} |
|
|
|
return v; |
|
|
|
} |