largestPartialIntersectionWeighted

fnvoid largestPartialIntersectionWeighted(alias less = "a < b", RangeOfRanges, Range, WeightsAA)(RangeOfRanges ror, Range tgt, WeightsAA weights, SortOutput sorted = No.sortOutput)

Similar to largestPartialIntersection, but associates a weight with each distinct element in the intersection.

If at least one of the ranges is a multiset, then all occurences of a duplicate element are taken into account. The result is equivalent to merging all input ranges and picking the highest tgt.length, weight-based ranking elements.

Parameters

lessThe predicate the ranges are sorted by.
rorA range of forward ranges sorted by less.
tgtThe target range to copy common elements to.
weightsAn associative array mapping elements to weights.
sortedWhether the elements copied should be in sorted order.