mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 14:46:56 +08:00
Improved consistency with vector [skip ci]
This commit is contained in:
@@ -683,7 +683,7 @@ SparsevecL2SquaredDistance(SparseVector * a, SparseVector * b)
|
|||||||
|
|
||||||
if (ai == bi)
|
if (ai == bi)
|
||||||
{
|
{
|
||||||
double diff = ax[i] - bx[j];
|
float diff = ax[i] - bx[j];
|
||||||
|
|
||||||
distance += diff * diff;
|
distance += diff * diff;
|
||||||
}
|
}
|
||||||
@@ -721,7 +721,7 @@ sparsevec_l2_distance(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
CheckDims(a, b);
|
CheckDims(a, b);
|
||||||
|
|
||||||
PG_RETURN_FLOAT8(sqrt(SparsevecL2SquaredDistance(a, b)));
|
PG_RETURN_FLOAT8(sqrt((double) SparsevecL2SquaredDistance(a, b)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -737,7 +737,7 @@ sparsevec_l2_squared_distance(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
CheckDims(a, b);
|
CheckDims(a, b);
|
||||||
|
|
||||||
PG_RETURN_FLOAT8(SparsevecL2SquaredDistance(a, b));
|
PG_RETURN_FLOAT8((double) SparsevecL2SquaredDistance(a, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user