lazy_pair_distances: Compute paired (not cross) distances for specific matched...

View source: R/matching_lazy.R

lazy_pair_distancesR Documentation

Compute paired (not cross) distances for specific matched pairs

Description

Given matched row/column index pairs (as produced by a solve), reports each pair's distance. The evaluation is the solver's own: the same C++ routine the lazy path priced the pair with is called on that pair, rather than the formula being written a second time here. Two implementations of one metric agree to rounding and not to the last bit, and the difference is visible where it matters most – a caliper set at a distance the package reported can exclude the pair it was read from.

Usage

lazy_pair_distances(spec, matched_rows, matched_cols)

Details

This is cheap regardless of n_left/n_right: the number of matched pairs never exceeds min(n_left, n_right), so it never approaches the O(n*m) cost the lazy path exists to avoid.

Value

Numeric vector of length length(matched_rows).


couplr documentation built on Sept. 17, 2026, 1:08 a.m.