/** * Coordinate indexing utilities for DataArray * Handles coordinate lookups with various selection methods (nearest, ffill, bfill) * and optimizations like binary search for sorted coordinates */ import { CoordinateValue, DimensionName, SelectionOptions } from '../types.js'; /** * Find the index of a coordinate value in a coordinate array * Supports exact match, nearest, forward fill, and backward fill methods * Optimized with O(1) arithmetic for evenly-spaced coordinates and O(log n) binary search for sorted coordinates */ export declare function findCoordinateIndex(coords: CoordinateValue[], value: CoordinateValue, options: SelectionOptions | undefined, dim: DimensionName, dimAttrs?: any): number; /** * Fallback method using linear search (original indexOf-based approach) */ export declare function findIndexFallback(coords: CoordinateValue[], value: CoordinateValue, method?: string, tolerance?: number, dim?: string): number; /** * Find nearest coordinate index (optimized with binary search for sorted coords) */ export declare function findNearestIndex(coords: CoordinateValue[], value: CoordinateValue, tolerance?: number, dim?: string): number; /** * Find forward fill index (last valid index <= value) - optimized with binary search */ export declare function findFfillIndex(coords: CoordinateValue[], value: CoordinateValue, tolerance?: number, dim?: string): number; /** * Find backward fill index (first valid index >= value) - optimized with binary search */ export declare function findBfillIndex(coords: CoordinateValue[], value: CoordinateValue, tolerance?: number, dim?: string): number; /** * Check if numeric coordinates are sorted */ export declare function isCoordsSorted(coords: number[]): boolean; /** * Binary search for nearest value in sorted array - O(log n) */ export declare function binarySearchNearest(sorted: number[], target: number, ascending?: boolean): number; /** * Binary search for forward fill in sorted array - O(log n) */ export declare function binarySearchFfill(sorted: number[], target: number, ascending?: boolean): number; /** * Binary search for backward fill in sorted array - O(log n) */ export declare function binarySearchBfill(sorted: number[], target: number, ascending?: boolean): number; //# sourceMappingURL=coordinate-indexing.d.ts.map