Added vector_dims [skip ci]

This commit is contained in:
Andrew Kane
2024-10-13 18:46:09 -07:00
parent 98deaa7407
commit 9514a7ffcd
5 changed files with 24 additions and 0 deletions

View File

@@ -580,6 +580,18 @@ intvec_l1_distance(PG_FUNCTION_ARGS)
PG_RETURN_FLOAT8((double) distance);
}
/*
* Get the dimensions of an int vector
*/
FUNCTION_PREFIX PG_FUNCTION_INFO_V1(intvec_vector_dims);
Datum
intvec_vector_dims(PG_FUNCTION_ARGS)
{
IntVector *a = PG_GETARG_INTVEC_P(0);
PG_RETURN_INT32(a->dim);
}
/*
* Get the L2 norm of an int vector
*/