import * as tf from '../backend/adapter'; import { SparseMatrix } from './sparse'; /** * A[i, j] = exp(-gamma * ||x_i - x_j||^2) */ export declare function compute_rbf_affinity(points: tf.Tensor2D, gamma?: number): tf.Tensor2D; /** * Self-loops are included by default to ensure connectivity (sklearn behaviour). * Symmetrised via `0.5 * (A + Aᵀ)`: mutual edges → 1.0, asymmetric → 0.5. * * Returns a dense tensor because downstream ops (eigen-decomposition) expect * dense input; use `compute_sparse_knn_affinity` for the CSR form. */ export declare function compute_knn_affinity(points: tf.Tensor2D, k: number, include_self?: boolean): tf.Tensor2D; /** * Symmetrised as `0.5 * (A + Aᵀ)`, matching sklearn's SpectralClustering * connectivity path. */ export declare function compute_sparse_knn_affinity(points: tf.Tensor2D, k: number, include_self?: boolean): SparseMatrix; /** * A[i, j] = 1 - cosine_distance(x_i, x_j) * * Natural similarity for direction-dominated, magnitude-noisy data (text * embeddings, TF-IDF vectors). Diagonal is forced to exactly 1. */ export declare function compute_cosine_affinity(points: tf.Tensor2D): tf.Tensor2D;