Liking cljdoc? Tell your friends :D

datahike.pg.vector

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.
raw docstring

check-dimensions!clj

(check-dimensions! dim)
(check-dimensions! expected actual)
source

check-same-dimensions!clj

(check-same-dimensions! a b)
source

coerceclj

(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.
sourceraw docstring

compare-valuesclj

(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.
sourceraw docstring

cosine-distanceclj

(cosine-distance a b)
source

inner-productclj

(inner-product a b)
source

l1-distanceclj

(l1-distance a b)
source

l2-distanceclj

(l2-distance a b)
source

l2-squared-distanceclj

(l2-squared-distance a b)
source

max-dimensionsclj

source

negative-inner-productclj

(negative-inner-product a b)
source

parseclj

(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`.
sourceraw docstring

parse-typmodclj

(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.
sourceraw docstring

to-pg-textclj

(to-pg-text v)
source

validate!clj

(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.
sourceraw docstring

vector-dimsclj

(vector-dims v)
source

vector-normclj

(vector-norm v)
source

vector-value?clj

(vector-value? v)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close