commit
95f053f70d
|
@ -22,7 +22,6 @@
|
||||||
#include <gtsam/discrete/DiscreteValues.h>
|
#include <gtsam/discrete/DiscreteValues.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianConditional.h>
|
#include <gtsam/hybrid/HybridGaussianConditional.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianProductFactor.h>
|
|
||||||
#include <gtsam/hybrid/HybridValues.h>
|
#include <gtsam/hybrid/HybridValues.h>
|
||||||
#include <gtsam/inference/Conditional-inst.h>
|
#include <gtsam/inference/Conditional-inst.h>
|
||||||
#include <gtsam/linear/GaussianBayesNet.h>
|
#include <gtsam/linear/GaussianBayesNet.h>
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <gtsam/discrete/DiscreteKey.h>
|
#include <gtsam/discrete/DiscreteKey.h>
|
||||||
#include <gtsam/hybrid/HybridFactor.h>
|
#include <gtsam/hybrid/HybridFactor.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianProductFactor.h>
|
|
||||||
#include <gtsam/inference/Conditional.h>
|
#include <gtsam/inference/Conditional.h>
|
||||||
#include <gtsam/linear/GaussianConditional.h>
|
#include <gtsam/linear/GaussianConditional.h>
|
||||||
|
|
||||||
|
|
|
@ -103,4 +103,10 @@ HybridGaussianProductFactor HybridGaussianProductFactor::removeEmpty() const {
|
||||||
return {Base(*this, emptyGaussian)};
|
return {Base(*this, emptyGaussian)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *******************************************************************************/
|
||||||
|
std::istream& operator>>(std::istream& is, GaussianFactorGraphValuePair& pair) {
|
||||||
|
// Dummy, don't do anything
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include <gtsam/inference/Key.h>
|
#include <gtsam/inference/Key.h>
|
||||||
#include <gtsam/linear/GaussianFactorGraph.h>
|
#include <gtsam/linear/GaussianFactorGraph.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
class HybridGaussianFactor;
|
class HybridGaussianFactor;
|
||||||
|
@ -115,6 +117,16 @@ class GTSAM_EXPORT HybridGaussianProductFactor
|
||||||
HybridGaussianProductFactor removeEmpty() const;
|
HybridGaussianProductFactor removeEmpty() const;
|
||||||
|
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
|
private:
|
||||||
|
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
|
||||||
|
/** Serialization function */
|
||||||
|
friend class boost::serialization::access;
|
||||||
|
template <class Archive>
|
||||||
|
void serialize(Archive& ar, const unsigned int /*version*/) {
|
||||||
|
ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
// Testable traits
|
// Testable traits
|
||||||
|
@ -122,4 +134,14 @@ template <>
|
||||||
struct traits<HybridGaussianProductFactor>
|
struct traits<HybridGaussianProductFactor>
|
||||||
: public Testable<HybridGaussianProductFactor> {};
|
: public Testable<HybridGaussianProductFactor> {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a dummy overload of >> for GaussianFactorGraphValuePair
|
||||||
|
* so that HybridGaussianProductFactor compiles
|
||||||
|
* with the constructor
|
||||||
|
* `DecisionTree(const std::vector<LabelC>& labelCs, const std::string& table)`.
|
||||||
|
*
|
||||||
|
* Needed to compile on Windows.
|
||||||
|
*/
|
||||||
|
std::istream& operator>>(std::istream& is, GaussianFactorGraphValuePair& pair);
|
||||||
|
|
||||||
} // namespace gtsam
|
} // namespace gtsam
|
||||||
|
|
|
@ -104,13 +104,12 @@ TEST(HybridGaussianFactor, Keys) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST_DISABLED(HybridGaussianFactor, Printing) {
|
TEST(HybridGaussianFactor, Printing) {
|
||||||
using namespace test_constructor;
|
using namespace test_constructor;
|
||||||
HybridGaussianFactor hybridFactor(m1, {f10, f11});
|
HybridGaussianFactor hybridFactor(m1, {f10, f11});
|
||||||
|
|
||||||
std::string expected =
|
std::string expected =
|
||||||
R"(HybridGaussianFactor
|
R"(Hybrid [x1 x2; 1]{
|
||||||
Hybrid [x1 x2; 1]{
|
|
||||||
Choice(1)
|
Choice(1)
|
||||||
0 Leaf :
|
0 Leaf :
|
||||||
A[x1] = [
|
A[x1] = [
|
||||||
|
|
|
@ -529,7 +529,7 @@ TEST(HybridNonlinearFactorGraph, Full_Elimination) {
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Test printing
|
* Test printing
|
||||||
*/
|
*/
|
||||||
TEST_DISABLED(HybridNonlinearFactorGraph, Printing) {
|
TEST(HybridNonlinearFactorGraph, Printing) {
|
||||||
Switching self(3);
|
Switching self(3);
|
||||||
|
|
||||||
auto linearizedFactorGraph = self.linearizedFactorGraph;
|
auto linearizedFactorGraph = self.linearizedFactorGraph;
|
||||||
|
@ -567,7 +567,7 @@ Hybrid [x0 x1; m0]{
|
||||||
]
|
]
|
||||||
b = [ -1 ]
|
b = [ -1 ]
|
||||||
No noise model
|
No noise model
|
||||||
scalar: 0
|
scalar: 0.918939
|
||||||
|
|
||||||
1 Leaf :
|
1 Leaf :
|
||||||
A[x0] = [
|
A[x0] = [
|
||||||
|
@ -578,7 +578,7 @@ scalar: 0
|
||||||
]
|
]
|
||||||
b = [ -0 ]
|
b = [ -0 ]
|
||||||
No noise model
|
No noise model
|
||||||
scalar: 0
|
scalar: 0.918939
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -595,7 +595,7 @@ Hybrid [x1 x2; m1]{
|
||||||
]
|
]
|
||||||
b = [ -1 ]
|
b = [ -1 ]
|
||||||
No noise model
|
No noise model
|
||||||
scalar: 0
|
scalar: 0.918939
|
||||||
|
|
||||||
1 Leaf :
|
1 Leaf :
|
||||||
A[x1] = [
|
A[x1] = [
|
||||||
|
@ -606,7 +606,7 @@ scalar: 0
|
||||||
]
|
]
|
||||||
b = [ -0 ]
|
b = [ -0 ]
|
||||||
No noise model
|
No noise model
|
||||||
scalar: 0
|
scalar: 0.918939
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,11 @@ BOOST_CLASS_EXPORT_GUID(HybridGaussianFactor::FactorValuePairs::Leaf,
|
||||||
BOOST_CLASS_EXPORT_GUID(HybridGaussianFactor::FactorValuePairs::Choice,
|
BOOST_CLASS_EXPORT_GUID(HybridGaussianFactor::FactorValuePairs::Choice,
|
||||||
"gtsam_HybridGaussianFactor_Factors_Choice");
|
"gtsam_HybridGaussianFactor_Factors_Choice");
|
||||||
|
|
||||||
|
BOOST_CLASS_EXPORT_GUID(GaussianFactorGraphValuePair,
|
||||||
|
"gtsam_GaussianFactorGraphValuePair");
|
||||||
|
BOOST_CLASS_EXPORT_GUID(HybridGaussianProductFactor,
|
||||||
|
"gtsam_HybridGaussianProductFactor");
|
||||||
|
|
||||||
BOOST_CLASS_EXPORT_GUID(HybridGaussianConditional,
|
BOOST_CLASS_EXPORT_GUID(HybridGaussianConditional,
|
||||||
"gtsam_HybridGaussianConditional");
|
"gtsam_HybridGaussianConditional");
|
||||||
BOOST_CLASS_EXPORT_GUID(HybridGaussianConditional::Conditionals,
|
BOOST_CLASS_EXPORT_GUID(HybridGaussianConditional::Conditionals,
|
||||||
|
|
Loading…
Reference in New Issue