You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
490 B

#pragma once
#include <stdio.h>
#define GLOBAL_DIM 128
typedef struct
{
int id;
float *vec;
} VecData;
typedef struct
{
FILE *stream;
char *filename;
int offset;
} FileContext;
float vec_dist(VecData x, VecData y);
FileContext *init_file_context(const char *filename);
void read_4bytes(FileContext *ctx, void *dst);
void read_vec_data(FileContext *ctx, void *dst);
void read_id_data(FileContext *ctx, void *dst, size_t n);
void free_file_context(FileContext *ctx);