Merge branch 'more-fixes' into normalize-potentials
commit
c26b272d80
|
@ -22,7 +22,6 @@
|
|||
#include <gtsam/discrete/DiscreteValues.h>
|
||||
#include <gtsam/hybrid/HybridGaussianConditional.h>
|
||||
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
||||
#include <gtsam/hybrid/HybridGaussianProductFactor.h>
|
||||
#include <gtsam/hybrid/HybridValues.h>
|
||||
#include <gtsam/inference/Conditional-inst.h>
|
||||
#include <gtsam/linear/GaussianBayesNet.h>
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include <gtsam/discrete/DiscreteKey.h>
|
||||
#include <gtsam/hybrid/HybridFactor.h>
|
||||
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
||||
#include <gtsam/hybrid/HybridGaussianProductFactor.h>
|
||||
#include <gtsam/inference/Conditional.h>
|
||||
#include <gtsam/linear/GaussianConditional.h>
|
||||
|
||||
|
|
|
@ -103,4 +103,10 @@ HybridGaussianProductFactor HybridGaussianProductFactor::removeEmpty() const {
|
|||
return {Base(*this, emptyGaussian)};
|
||||
}
|
||||
|
||||
/* *******************************************************************************/
|
||||
std::istream& operator>>(std::istream& is, GaussianFactorGraphValuePair& pair) {
|
||||
// Dummy, don't do anything
|
||||
return is;
|
||||
}
|
||||
|
||||
} // namespace gtsam
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include <gtsam/inference/Key.h>
|
||||
#include <gtsam/linear/GaussianFactorGraph.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace gtsam {
|
||||
|
||||
class HybridGaussianFactor;
|
||||
|
@ -115,6 +117,16 @@ class GTSAM_EXPORT HybridGaussianProductFactor
|
|||
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
|
||||
|
@ -122,4 +134,14 @@ template <>
|
|||
struct traits<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
|
||||
|
|
|
@ -104,13 +104,12 @@ TEST(HybridGaussianFactor, Keys) {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
TEST_DISABLED(HybridGaussianFactor, Printing) {
|
||||
TEST(HybridGaussianFactor, Printing) {
|
||||
using namespace test_constructor;
|
||||
HybridGaussianFactor hybridFactor(m1, {f10, f11});
|
||||
|
||||
std::string expected =
|
||||
R"(HybridGaussianFactor
|
||||
Hybrid [x1 x2; 1]{
|
||||
R"(Hybrid [x1 x2; 1]{
|
||||
Choice(1)
|
||||
0 Leaf :
|
||||
A[x1] = [
|
||||
|
|
|
@ -529,7 +529,7 @@ TEST(HybridNonlinearFactorGraph, Full_Elimination) {
|
|||
/****************************************************************************
|
||||
* Test printing
|
||||
*/
|
||||
TEST_DISABLED(HybridNonlinearFactorGraph, Printing) {
|
||||
TEST(HybridNonlinearFactorGraph, Printing) {
|
||||
Switching self(3);
|
||||
|
||||
auto linearizedFactorGraph = self.linearizedFactorGraph;
|
||||
|
@ -549,7 +549,7 @@ Factor 0
|
|||
GaussianFactor:
|
||||
|
||||
A[x0] = [
|
||||
10
|
||||
10
|
||||
]
|
||||
b = [ -10 ]
|
||||
No noise model
|
||||
|
@ -560,25 +560,25 @@ Hybrid [x0 x1; m0]{
|
|||
Choice(m0)
|
||||
0 Leaf :
|
||||
A[x0] = [
|
||||
-1
|
||||
-1
|
||||
]
|
||||
A[x1] = [
|
||||
1
|
||||
1
|
||||
]
|
||||
b = [ -1 ]
|
||||
No noise model
|
||||
scalar: 0
|
||||
scalar: 0.918939
|
||||
|
||||
1 Leaf :
|
||||
A[x0] = [
|
||||
-1
|
||||
-1
|
||||
]
|
||||
A[x1] = [
|
||||
1
|
||||
1
|
||||
]
|
||||
b = [ -0 ]
|
||||
No noise model
|
||||
scalar: 0
|
||||
scalar: 0.918939
|
||||
|
||||
}
|
||||
|
||||
|
@ -588,25 +588,25 @@ Hybrid [x1 x2; m1]{
|
|||
Choice(m1)
|
||||
0 Leaf :
|
||||
A[x1] = [
|
||||
-1
|
||||
-1
|
||||
]
|
||||
A[x2] = [
|
||||
1
|
||||
1
|
||||
]
|
||||
b = [ -1 ]
|
||||
No noise model
|
||||
scalar: 0
|
||||
scalar: 0.918939
|
||||
|
||||
1 Leaf :
|
||||
A[x1] = [
|
||||
-1
|
||||
-1
|
||||
]
|
||||
A[x2] = [
|
||||
1
|
||||
1
|
||||
]
|
||||
b = [ -0 ]
|
||||
No noise model
|
||||
scalar: 0
|
||||
scalar: 0.918939
|
||||
|
||||
}
|
||||
|
||||
|
@ -614,7 +614,7 @@ Factor 3
|
|||
GaussianFactor:
|
||||
|
||||
A[x1] = [
|
||||
10
|
||||
10
|
||||
]
|
||||
b = [ -10 ]
|
||||
No noise model
|
||||
|
@ -623,7 +623,7 @@ Factor 4
|
|||
GaussianFactor:
|
||||
|
||||
A[x2] = [
|
||||
10
|
||||
10
|
||||
]
|
||||
b = [ -10 ]
|
||||
No noise model
|
||||
|
|
|
@ -59,6 +59,11 @@ BOOST_CLASS_EXPORT_GUID(HybridGaussianFactor::FactorValuePairs::Leaf,
|
|||
BOOST_CLASS_EXPORT_GUID(HybridGaussianFactor::FactorValuePairs::Choice,
|
||||
"gtsam_HybridGaussianFactor_Factors_Choice");
|
||||
|
||||
BOOST_CLASS_EXPORT_GUID(GaussianFactorGraphValuePair,
|
||||
"gtsam_GaussianFactorGraphValuePair");
|
||||
BOOST_CLASS_EXPORT_GUID(HybridGaussianProductFactor,
|
||||
"gtsam_HybridGaussianProductFactor");
|
||||
|
||||
BOOST_CLASS_EXPORT_GUID(HybridGaussianConditional,
|
||||
"gtsam_HybridGaussianConditional");
|
||||
BOOST_CLASS_EXPORT_GUID(HybridGaussianConditional::Conditionals,
|
||||
|
|
Loading…
Reference in New Issue