Template Function ADS::unboundedKnapsack

Function Documentation

template<class T, class V>
std::pair<T, std::vector<std::size_t>> ADS::unboundedKnapsack(const std::vector<T> &p, const std::vector<V> &v, V C)

the largest profit of the objects of profits p and volumes v, each in unlimited supply, in a knapsack of capacity C, and the copies of each

Pre:

|p| = |v|, v positive, C >= 0

Post:

the copies fit and give the profit