Template Function ADS::lineAssignment

Function Documentation

template<class T, class W = T>
W ADS::lineAssignment(std::vector<T> H, std::vector<T> L)

lineAssignment(): the least sum of | H[ i ] - L[ p( i ) ] | over the permutations p, computed in the type W, by sorting; O( n log n )

Pre:

H and L have the same size