10 #include <gtsam/discrete/DiscreteFactor.h>
11 #include <gtsam/discrete/DiscreteFactorGraph.h>
12 #include <gtsam/nonlinear/NonlinearFactor.h>
13 #include <gtsam/nonlinear/NonlinearFactorGraph.h>
37 template <
typename NonlinearFactorType>
40 boost::make_shared<NonlinearFactorType>(nonlinearFactor));
48 boost::shared_ptr<gtsam::NonlinearFactor> nonlinearFactor);
54 template <
typename DiscreteFactorType>
57 boost::make_shared<DiscreteFactorType>(discreteFactor));
64 void push_discrete(boost::shared_ptr<gtsam::DiscreteFactor> discreteFactor);
70 template <
typename DCFactorType>
71 void push_dc(
const DCFactorType &dcFactor) {
72 dcGraph_.push_back(boost::make_shared<DCFactorType>(dcFactor));
79 void push_dc(boost::shared_ptr<DCFactor> dcFactor);
84 void print(
const std::string &str =
"HybridFactorGraph",
85 const gtsam::KeyFormatter &keyFormatter =
86 gtsam::DefaultKeyFormatter)
const;
95 gtsam::FastSet<gtsam::Key>
keys()
const;
Custom discrete-continuous factor.
Simple class for factor graphs of DCFactor type.
Some convenient types for DCSAM.
Definition: DCFactorGraph.h:18
Definition: HybridFactorGraph.h:23
size_t size() const
Definition: HybridFactorGraph.cpp:69
void push_nonlinear(const NonlinearFactorType &nonlinearFactor)
Definition: HybridFactorGraph.h:38
gtsam::DiscreteFactorGraph discreteGraph_
Definition: HybridFactorGraph.h:27
size_t size_nonlinear() const
Definition: HybridFactorGraph.cpp:73
DCFactorGraph dcGraph() const
Definition: HybridFactorGraph.cpp:56
size_t size_dc() const
Definition: HybridFactorGraph.cpp:81
bool empty() const
Definition: HybridFactorGraph.cpp:58
gtsam::FastSet< gtsam::Key > keys() const
Definition: HybridFactorGraph.cpp:39
void clear()
Definition: HybridFactorGraph.cpp:83
gtsam::DiscreteFactorGraph discreteGraph() const
Definition: HybridFactorGraph.cpp:52
size_t size_discrete() const
Definition: HybridFactorGraph.cpp:77
gtsam::NonlinearFactorGraph nonlinearGraph_
Definition: HybridFactorGraph.h:26
HybridFactorGraph()
Definition: HybridFactorGraph.cpp:12
void push_discrete(const DiscreteFactorType &discreteFactor)
Definition: HybridFactorGraph.h:55
void push_dc(const DCFactorType &dcFactor)
Definition: HybridFactorGraph.h:71
bool equals(const HybridFactorGraph &other, double tol=1e-9) const
Definition: HybridFactorGraph.cpp:62
void print(const std::string &str="HybridFactorGraph", const gtsam::KeyFormatter &keyFormatter=gtsam::DefaultKeyFormatter) const
Definition: HybridFactorGraph.cpp:28
gtsam::NonlinearFactorGraph nonlinearGraph() const
Definition: HybridFactorGraph.cpp:48
DCFactorGraph dcGraph_
Definition: HybridFactorGraph.h:28
Definition: DCContinuousFactor.h:24
const double tol
Definition: testDCSAM.cpp:40