pgvector.git / summary / log / commit / refs
commit 67e648b13e59932f2f72a2b0f5d5e176fb85e200
Author: Andrew Kane <andrew@ankane.org>
Date: Fri Aug 29 08:09:18 2025 +0000
Added another test for binary_quantize function [skip ci]
test/expected/halfvec.out | 6 ++++++
test/expected/vector_type.out | 6 ++++++
test/sql/halfvec.sql | 1 +
test/sql/vector_type.sql | 1 +
4 files changed, 14 insertions(+)
diff --git a/test/expected/halfvec.out b/test/expected/halfvec.out
index a3ce8931..3ef913d6 100644
--- a/test/expected/halfvec.out
+++ b/test/expected/halfvec.out
@@ -540,6 +540,12 @@ SELECT binary_quantize('[0,0.1,-0.2,-0.3,0.4,0.5,0.6,-0.7,0.8,-0.9,1]'::halfvec)
01001110101
(1 row)
+SELECT binary_quantize('[1,2,3,-4,5,6,-7,8,1,-2,-3,4,5,-6,7,8,-1,2,3]'::halfvec);
+ binary_quantize
+---------------------
+ 1110110110011011011
+(1 row)
+
SELECT subvector('[1,2,3,4,5]'::halfvec, 1, 3);
subvector
-----------
diff --git a/test/expected/vector_type.out b/test/expected/vector_type.out
index 67486582..f4c85d03 100644
--- a/test/expected/vector_type.out
+++ b/test/expected/vector_type.out
@@ -576,6 +576,12 @@ SELECT binary_quantize('[0,0.1,-0.2,-0.3,0.4,0.5,0.6,-0.7,0.8,-0.9,1]'::vector);
01001110101
(1 row)
+SELECT binary_quantize('[1,2,3,-4,5,6,-7,8,1,-2,-3,4,5,-6,7,8,-1,2,3]'::vector);
+ binary_quantize
+---------------------
+ 1110110110011011011
+(1 row)
+
SELECT subvector('[1,2,3,4,5]'::vector, 1, 3);
subvector
-----------
diff --git a/test/sql/halfvec.sql b/test/sql/halfvec.sql
index 1a3fd1b8..592a6e38 100644
--- a/test/sql/halfvec.sql
+++ b/test/sql/halfvec.sql
@@ -121,6 +121,7 @@ SELECT l2_normalize('[65504]'::halfvec);
SELECT binary_quantize('[1,0,-1]'::halfvec);
SELECT binary_quantize('[0,0.1,-0.2,-0.3,0.4,0.5,0.6,-0.7,0.8,-0.9,1]'::halfvec);
+SELECT binary_quantize('[1,2,3,-4,5,6,-7,8,1,-2,-3,4,5,-6,7,8,-1,2,3]'::halfvec);
SELECT subvector('[1,2,3,4,5]'::halfvec, 1, 3);
SELECT subvector('[1,2,3,4,5]'::halfvec, 3, 2);
diff --git a/test/sql/vector_type.sql b/test/sql/vector_type.sql
index 088b040a..086a39bc 100644
--- a/test/sql/vector_type.sql
+++ b/test/sql/vector_type.sql
@@ -128,6 +128,7 @@ SELECT l2_normalize('[3e38]'::vector);
SELECT binary_quantize('[1,0,-1]'::vector);
SELECT binary_quantize('[0,0.1,-0.2,-0.3,0.4,0.5,0.6,-0.7,0.8,-0.9,1]'::vector);
+SELECT binary_quantize('[1,2,3,-4,5,6,-7,8,1,-2,-3,4,5,-6,7,8,-1,2,3]'::vector);
SELECT subvector('[1,2,3,4,5]'::vector, 1, 3);
SELECT subvector('[1,2,3,4,5]'::vector, 3, 2);
[parent: c3ff95523136]