Template Function ADS::linearPartition

Function Documentation

template<class T>
std::pair<T, std::vector<std::size_t>> ADS::linearPartition(const std::vector<T> &A, std::size_t k)

the least largest sum of a part over the splits of A in k nonempty contiguous parts, and the starts of the parts after the first one

Pre:

1 <= k <= |A|

Post:

k - 1 increasing starts in [ 1 , |A| ) of the cost found