Template Function ADS::subsetSum

Function Documentation

template<class T, class F>
long ADS::subsetSum(const std::vector<T> &A, T k, F &&f)

the subsets of the positive items of sum k, as the places taken, f returns true to stop; k = 0 gives the empty subset only, equal items in different places give different subsets

Pre:

the items positive