/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ import type { TypedArray } from "./TypedArray"; /** * Calculates cosine similarity between two vectors * Returns a value between -1 and 1, where 1 means identical direction */ export declare function cosineSimilarity(a: TypedArray, b: TypedArray): number; /** * Calculates Jaccard similarity between two vectors * Uses the formula: sum(min(a[i], b[i])) / sum(max(a[i], b[i])) * Returns a value between 0 and 1 * For negative values, normalizes by finding the global min and shifting to non-negative range */ export declare function jaccardSimilarity(a: TypedArray, b: TypedArray): number; /** * Calculates Hamming distance between two vectors (normalized) * Counts the number of positions where vectors differ * Returns a value between 0 and 1 (0 = identical, 1 = completely different) */ export declare function hammingDistance(a: TypedArray, b: TypedArray): number; /** * Calculates Hamming similarity (inverse of distance) * Returns a value between 0 and 1 (1 = identical, 0 = completely different) */ export declare function hammingSimilarity(a: TypedArray, b: TypedArray): number; //# sourceMappingURL=VectorSimilarityUtils.d.ts.map