Replaced add variants with single variadic template
parent
5882847604
commit
34c3d6af5e
|
@ -101,29 +101,12 @@ public:
|
|||
|
||||
/// @}
|
||||
|
||||
// Add single key decision-tree factor.
|
||||
template <class SOURCE>
|
||||
void add(const DiscreteKey& j, SOURCE table) {
|
||||
DiscreteKeys keys;
|
||||
keys.push_back(j);
|
||||
emplace_shared<DecisionTreeFactor>(keys, table);
|
||||
/** Add a decision-tree factor */
|
||||
template <typename... Args>
|
||||
void add(Args&&... args) {
|
||||
emplace_shared<DecisionTreeFactor>(std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// Add binary key decision-tree factor.
|
||||
template <class SOURCE>
|
||||
void add(const DiscreteKey& j1, const DiscreteKey& j2, SOURCE table) {
|
||||
DiscreteKeys keys;
|
||||
keys.push_back(j1);
|
||||
keys.push_back(j2);
|
||||
emplace_shared<DecisionTreeFactor>(keys, table);
|
||||
}
|
||||
|
||||
// Add shared discreteFactor immediately from arguments.
|
||||
template <class SOURCE>
|
||||
void add(const DiscreteKeys& keys, SOURCE table) {
|
||||
emplace_shared<DecisionTreeFactor>(keys, table);
|
||||
}
|
||||
|
||||
|
||||
/** Return the set of variables involved in the factors (set union) */
|
||||
KeySet keys() const;
|
||||
|
||||
|
|
Loading…
Reference in New Issue