add constructor for HybridFactorGraph which takes a container of factors
parent
f3e84004bf
commit
e7cb7b2dcd
|
|
@ -38,7 +38,7 @@ using SharedFactor = std::shared_ptr<Factor>;
|
||||||
class GTSAM_EXPORT HybridFactorGraph : public FactorGraph<Factor> {
|
class GTSAM_EXPORT HybridFactorGraph : public FactorGraph<Factor> {
|
||||||
public:
|
public:
|
||||||
using Base = FactorGraph<Factor>;
|
using Base = FactorGraph<Factor>;
|
||||||
using This = HybridFactorGraph; ///< this class
|
using This = HybridFactorGraph; ///< this class
|
||||||
using shared_ptr = std::shared_ptr<This>; ///< shared_ptr to This
|
using shared_ptr = std::shared_ptr<This>; ///< shared_ptr to This
|
||||||
|
|
||||||
using Values = gtsam::Values; ///< backwards compatibility
|
using Values = gtsam::Values; ///< backwards compatibility
|
||||||
|
|
@ -59,6 +59,10 @@ class GTSAM_EXPORT HybridFactorGraph : public FactorGraph<Factor> {
|
||||||
template <class DERIVEDFACTOR>
|
template <class DERIVEDFACTOR>
|
||||||
HybridFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
HybridFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/** Construct from container of factors (shared_ptr or plain objects) */
|
||||||
|
template <class CONTAINER>
|
||||||
|
explicit HybridFactorGraph(const CONTAINER& factors) : Base(factors) {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Extra methods to inspect discrete/continuous keys.
|
/// @name Extra methods to inspect discrete/continuous keys.
|
||||||
/// @{
|
/// @{
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,11 @@ class GTSAM_EXPORT HybridGaussianFactorGraph
|
||||||
/// @brief Default constructor.
|
/// @brief Default constructor.
|
||||||
HybridGaussianFactorGraph() = default;
|
HybridGaussianFactorGraph() = default;
|
||||||
|
|
||||||
|
/** Construct from container of factors (shared_ptr or plain objects) */
|
||||||
|
template <class CONTAINER>
|
||||||
|
explicit HybridGaussianFactorGraph(const CONTAINER& factors)
|
||||||
|
: Base(factors) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implicit copy/downcast constructor to override explicit template container
|
* Implicit copy/downcast constructor to override explicit template container
|
||||||
* constructor. In BayesTree this is used for:
|
* constructor. In BayesTree this is used for:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue