evoc 0.0.1

Embedding Vector Oriented Clustering — fast clustering of high-dimensional embedding vectors (Rust port of EVōC)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdint.h>

// Match Numba fast_cosine (float_nndescent.py, fastmath=True).
float fast_cosine_numba(float *x, float *y, int dim) {
    float result = 0.0f;
    for (int i = 0; i < dim; i++) {
        result += x[i] * y[i];
    }
    if (result > 0.0f) {
        return -result;
    }
    return 1.17549435e-38f;
}