|
|
@ -1 +1,44 @@ |
|
|
|
# HNSW-Lab |
|
|
|
# AI Data Index Design |
|
|
|
|
|
|
|
|
|
|
|
### 1. Testing Steps |
|
|
|
|
|
|
|
1. Make sure `CMake` is installed: |
|
|
|
```shell |
|
|
|
sudo apt-get install cmake |
|
|
|
``` |
|
|
|
|
|
|
|
2. Create a `\build` folder inside the `hnswlab` directory. |
|
|
|
|
|
|
|
3. Change directory to the `build` folder: |
|
|
|
```shell |
|
|
|
cd build |
|
|
|
``` |
|
|
|
|
|
|
|
4. Run `CMake` to generate the build files: |
|
|
|
```shell |
|
|
|
cmake .. |
|
|
|
``` |
|
|
|
|
|
|
|
5. Build the project: |
|
|
|
```shell |
|
|
|
make |
|
|
|
``` |
|
|
|
|
|
|
|
6. Run the test program: |
|
|
|
```shell |
|
|
|
./hnsw_tst |
|
|
|
``` |
|
|
|
|
|
|
|
### 2. Interface Description |
|
|
|
|
|
|
|
To load the dataset, use the following code snippet in C: |
|
|
|
```c |
|
|
|
// Vector dimension |
|
|
|
int num = 0; |
|
|
|
// Read the dataset |
|
|
|
VecData* vecs = fvecs_read("../dataset/siftsmall_base.fvecs", NULL, &num); |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
--- |