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