2
3
4
5
6
15#include "util/concepts.hpp"
19
20
21
22
27
28
30 Variable operator()(
const std::vector<TruthValue> &model, std::size_t)
const;
35
36
38 HeuristicCallableBase() =
default;
40 virtual ~HeuristicCallableBase() =
default;
50 virtual Variable invoke(
const std::vector<TruthValue> &, std::size_t) = 0;
54
55
60 template<
typename... Args>
61 explicit HeuristicCallable(Args &&... args): impl(std::forward<Args>(args)...) {
64 Variable invoke(
const std::vector<TruthValue> &values, std::size_t numOpenVariables)
override {
65 return impl(values, numOpenVariables);
71
72
74 std::unique_ptr<detail::HeuristicCallableBase> impl;
77
78
82
83
84
85
91 Variable operator()(
const std::vector<TruthValue> &values, std::size_t numOpenVariables)
const;
94
95
96
101
102
103
104 template<heuristic H>
106 std::unique_ptr<H> h;
109
110
111
112
113 template<
typename... Args>
116 Variable operator()(
const std::vector<TruthValue> &values, std::size_t numOpenVariables)
const {
117 return h->operator()(values, numOpenVariables);
Type erasure heuristic wrapper that can hold any type of heuristic.
Definition heuristics.hpp:73
bool isValid() const
Definition heuristics.cpp:32
Heuristic(H &&heuristic)
Definition heuristics.hpp:87
Wrapper for heuristics that do not support move construction or assignment.
Definition heuristics.hpp:105
MovableHeuristic(Args &&...args)
Definition heuristics.hpp:114
Structure representing a binary variable in a CNF-SAT problem.
Definition basic_structures.hpp:29
Definition heuristics.hpp:33
Definition basic_structures.cpp:10
Variable selection strategy that selects the first unassigned variable.
Definition heuristics.hpp:29
This is a helper class for the implementation of a type erasure heuristic wrapper.
Definition heuristics.hpp:37
This is a helper class for the implementation of a type erasure heuristic wrapper.
Definition heuristics.hpp:57