The pgvector vector scalar represented by Datahike's native float array.
The public functions in this namespace follow pgvector 0.8.6's vector.c: elements and most distance accumulators use IEEE float32, while norm uses a float64 accumulator. Proximum is deliberately not involved here; an ANN index may supply candidates later, but SQL scalar results remain exact.
The pgvector `vector` scalar represented by Datahike's native float array. The public functions in this namespace follow pgvector 0.8.6's vector.c: elements and most distance accumulators use IEEE float32, while norm uses a float64 accumulator. Proximum is deliberately not involved here; an ANN index may supply candidates later, but SQL scalar results remain exact.
(coerce value)(coerce value typmod)Return value as a vector, parsing PostgreSQL text when necessary.
Return `value` as a vector, parsing PostgreSQL text when necessary.
(compare-values a b)pgvector's btree comparison: elements first, then dimensionality. Float comparisons intentionally make -0 and +0 equal.
pgvector's btree comparison: elements first, then dimensionality. Float comparisons intentionally make -0 and +0 equal.
(parse value)(parse value typmod)Parse pgvector's text input into a primitive float array. typmod is the
declared dimension, or nil/-1 for unconstrained vector.
Parse pgvector's text input into a primitive float array. `typmod` is the declared dimension, or nil/-1 for unconstrained `vector`.
(parse-typmod type-name)Return the dimension declared by vector(n), nil for bare vector. Rejects the same modifier shapes as pgvector's vector_typmod_in.
Return the dimension declared by vector(n), nil for bare vector. Rejects the same modifier shapes as pgvector's vector_typmod_in.
(validate! v)Validate a native float array at every boundary. Datahike accepts arbitrary float arrays, including empty and non-finite values, while pgvector does not; callers must not infer validity merely from the runtime class.
Validate a native float array at every boundary. Datahike accepts arbitrary float arrays, including empty and non-finite values, while pgvector does not; callers must not infer validity merely from the runtime class.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |