mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-13 08:06:54 +08:00
Updated comments [skip ci]
This commit is contained in:
@@ -228,6 +228,7 @@ ComputeNewCenters(VectorArray samples, VectorArray aggCenters, VectorArray newCe
|
|||||||
int numCenters = aggCenters->maxlen;
|
int numCenters = aggCenters->maxlen;
|
||||||
int numSamples = samples->length;
|
int numSamples = samples->length;
|
||||||
|
|
||||||
|
/* Reset sum and count */
|
||||||
for (int j = 0; j < numCenters; j++)
|
for (int j = 0; j < numCenters; j++)
|
||||||
{
|
{
|
||||||
Vector *vec = (Vector *) VectorArrayGet(aggCenters, j);
|
Vector *vec = (Vector *) VectorArrayGet(aggCenters, j);
|
||||||
@@ -268,7 +269,7 @@ ComputeNewCenters(VectorArray samples, VectorArray aggCenters, VectorArray newCe
|
|||||||
for (int j = 0; j < numSamples; j++)
|
for (int j = 0; j < numSamples; j++)
|
||||||
centerCounts[closestCenters[j]] += 1;
|
centerCounts[closestCenters[j]] += 1;
|
||||||
|
|
||||||
/* Average centers */
|
/* Divide sum by count */
|
||||||
for (int j = 0; j < numCenters; j++)
|
for (int j = 0; j < numCenters; j++)
|
||||||
{
|
{
|
||||||
Vector *vec = (Vector *) VectorArrayGet(aggCenters, j);
|
Vector *vec = (Vector *) VectorArrayGet(aggCenters, j);
|
||||||
|
|||||||
Reference in New Issue
Block a user