mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 16:16:56 +08:00
Improved code [skip ci]
This commit is contained in:
@@ -252,7 +252,8 @@ static void
|
|||||||
MiniBatchKmeans(IvfflatBuildState * buildstate)
|
MiniBatchKmeans(IvfflatBuildState * buildstate)
|
||||||
{
|
{
|
||||||
VectorArray centers = buildstate->centers;
|
VectorArray centers = buildstate->centers;
|
||||||
int b = buildstate->samples->maxlen;
|
VectorArray m = buildstate->samples;
|
||||||
|
int b = m->maxlen;
|
||||||
int t = 20;
|
int t = 20;
|
||||||
double distance;
|
double distance;
|
||||||
double minDistance;
|
double minDistance;
|
||||||
@@ -260,7 +261,6 @@ MiniBatchKmeans(IvfflatBuildState * buildstate)
|
|||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
int k;
|
int k;
|
||||||
VectorArray m;
|
|
||||||
Vector *c;
|
Vector *c;
|
||||||
Vector *x;
|
Vector *x;
|
||||||
int *v;
|
int *v;
|
||||||
@@ -288,7 +288,6 @@ MiniBatchKmeans(IvfflatBuildState * buildstate)
|
|||||||
|
|
||||||
/* Get b examples picked randomly from X */
|
/* Get b examples picked randomly from X */
|
||||||
SampleRows(buildstate);
|
SampleRows(buildstate);
|
||||||
m = buildstate->samples;
|
|
||||||
|
|
||||||
/* Cache nearest center to x */
|
/* Cache nearest center to x */
|
||||||
for (j = 0; j < m->length; j++)
|
for (j = 0; j < m->length; j++)
|
||||||
|
|||||||
Reference in New Issue
Block a user