Add initializer list constructors
parent
f9ccf111d1
commit
6cbd7c286c
|
@ -60,6 +60,16 @@ namespace gtsam {
|
||||||
explicit SymbolicBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph)
|
explicit SymbolicBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph)
|
||||||
: Base(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
|
/// Destructor
|
||||||
virtual ~SymbolicBayesNet() {}
|
virtual ~SymbolicBayesNet() {}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,15 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
SymbolicFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
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
|
/// Destructor
|
||||||
virtual ~SymbolicFactorGraph() {}
|
virtual ~SymbolicFactorGraph() {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue