Add initializer list constructors
parent
f9ccf111d1
commit
6cbd7c286c
|
@ -60,6 +60,16 @@ namespace gtsam {
|
|||
explicit SymbolicBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph)
|
||||
: Base(graph) {}
|
||||
|
||||
/**
|
||||
* Constructor that takes an initializer list of shared pointers.
|
||||
* FactorGraph fg = {make_shared<MyFactor>(), ...};
|
||||
*/
|
||||
SymbolicBayesNet(
|
||||
std::initializer_list<boost::shared_ptr<SymbolicConditional>>
|
||||
sharedFactors) {
|
||||
for (auto&& f : sharedFactors) factors_.push_back(f);
|
||||
}
|
||||
|
||||
/// Destructor
|
||||
virtual ~SymbolicBayesNet() {}
|
||||
|
||||
|
|
|
@ -81,6 +81,15 @@ namespace gtsam {
|
|||
template<class DERIVEDFACTOR>
|
||||
SymbolicFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||
|
||||
/**
|
||||
* Constructor that takes an initializer list of shared pointers.
|
||||
* FactorGraph fg = {make_shared<MyFactor>(), ...};
|
||||
*/
|
||||
SymbolicFactorGraph(std::initializer_list<boost::shared_ptr<SymbolicFactor>>
|
||||
sharedFactors) {
|
||||
for (auto&& f : sharedFactors) factors_.push_back(f);
|
||||
}
|
||||
|
||||
/// Destructor
|
||||
virtual ~SymbolicFactorGraph() {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue