mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-11 15:16:54 +08:00
Improved code [skip ci]
This commit is contained in:
@@ -287,7 +287,6 @@ BitSumCenter(const void *v, Vector * aggCenter)
|
|||||||
static void
|
static void
|
||||||
SumCenters(VectorArray samples, VectorArray aggCenters, int *closestCenters, IvfflatType type)
|
SumCenters(VectorArray samples, VectorArray aggCenters, int *closestCenters, IvfflatType type)
|
||||||
{
|
{
|
||||||
int numSamples = samples->length;
|
|
||||||
void (*sumCenter) (const void *v, Vector * aggCenter);
|
void (*sumCenter) (const void *v, Vector * aggCenter);
|
||||||
|
|
||||||
if (type == IVFFLAT_TYPE_VECTOR)
|
if (type == IVFFLAT_TYPE_VECTOR)
|
||||||
@@ -299,8 +298,7 @@ SumCenters(VectorArray samples, VectorArray aggCenters, int *closestCenters, Ivf
|
|||||||
else
|
else
|
||||||
elog(ERROR, "Unsupported type");
|
elog(ERROR, "Unsupported type");
|
||||||
|
|
||||||
|
for (int j = 0; j < samples->length; j++)
|
||||||
for (int j = 0; j < numSamples; j++)
|
|
||||||
{
|
{
|
||||||
Vector *aggCenter = (Vector *) VectorArrayGet(aggCenters, closestCenters[j]);
|
Vector *aggCenter = (Vector *) VectorArrayGet(aggCenters, closestCenters[j]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user