mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-04 03:30:56 +08:00
Added vector_dims [skip ci]
This commit is contained in:
12
src/intvec.c
12
src/intvec.c
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user