15 #ifndef PAAL_KNAPSACK_COMMON_HPP
16 #define PAAL_KNAPSACK_COMMON_HPP
23 template <
typename KnapsackData,
typename Is_0_1_Tag,
24 typename RetrieveSolution = retrieve_solution_tag,
25 typename Value =
typename KnapsackData::value,
26 typename Size =
typename KnapsackData::size>
27 typename KnapsackData::return_type knapsack_check_integrality(KnapsackData knap_data, Is_0_1_Tag is_0_1_Tag,
28 RetrieveSolution retrieve_solutionTag =
31 return knapsack(std::move(knap_data), is_0_1_Tag,
32 detail::GetIntegralTag<Size, Value>{},
33 retrieve_solutionTag);
38 template <
typename KnapsackData,
40 typename RetrieveSolution,
typename Is_0_1_Tag,
41 typename =
typename std::enable_if<std::is_same<
42 non_integral_value_and_size_tag, IntegralTag>::value>::type>
44 typename KnapsackData::return_type knapsack(KnapsackData, Is_0_1_Tag is_0_1_Tag, IntegralTag,
45 RetrieveSolution retrieve_solution) {
48 std::is_same<IntegralTag, non_integral_value_and_size_tag>::value,
49 "At least one of the value or size must return integral value");
56 template <
typename KnapsackData,
typename Is_0_1_Tag,
typename RetrieveSolution>
57 typename KnapsackData::return_type knapsack(KnapsackData knap_data, Is_0_1_Tag is_0_1_Tag,
59 if (get_value_bound(knap_data, is_0_1_Tag,
upper_tag{}) >
60 knap_data.get_capacity()) {
62 retrieve_solutionTag);
65 retrieve_solutionTag);
71 #endif // PAAL_KNAPSACK_COMMON_HPP