Function temporal_join

Source
pub fn temporal_join(
    traj_a: &[(i64, &[f32])],
    traj_b: &[(i64, &[f32])],
    epsilon: f32,
    window_us: i64,
) -> Result<Vec<TemporalJoinResult>, AnalyticsError>
Expand description

Find time windows where entities A and B are within distance epsilon.

Uses a sliding window of size window_us microseconds over the merged timeline. Within each window, computes the minimum pairwise distance between A’s and B’s points.

§Arguments

  • traj_a — Entity A’s trajectory, sorted by timestamp
  • traj_b — Entity B’s trajectory, sorted by timestamp
  • epsilon — Maximum distance threshold for convergence
  • window_us — Sliding window size in microseconds

§Errors

Returns AnalyticsError::InsufficientData if either trajectory is empty.