Package com.apple.foundationdb.linear
Interface Estimator
- All Known Implementing Classes:
RaBitEstimator
public interface Estimator
Interface of an estimator used for calculating the distance between vectors.
Implementations of this interface are expected to provide a specific distance metric calculation, often used in search or similarity contexts where one vector (the query) is compared against many stored vectors.
-
Method Summary
Modifier and TypeMethodDescriptiondoubledistance(RealVector query, RealVector storedVector) Calculates the distance between a pre-rotated and translated query vector and a stored vector.default doubledistance(Transformed<? extends RealVector> query, Transformed<? extends RealVector> storedVector)
-
Method Details
-
distance
default double distance(@Nonnull Transformed<? extends RealVector> query, @Nonnull Transformed<? extends RealVector> storedVector) -
distance
Calculates the distance between a pre-rotated and translated query vector and a stored vector.This method is designed to compute the distance metric between two vectors in a high-dimensional space. It is crucial that the
queryvector has already been appropriately transformed (e.g., rotated and translated) to align with the coordinate system of thestoredVectorbefore calling this method.- Parameters:
query- the pre-rotated and translated query vector, cannot be null.storedVector- the stored vector to which the distance is calculated, cannot be null.- Returns:
- a non-negative
doublerepresenting the distance between the two vectors.
-