diff --git a/gtsam/hybrid/HybridGaussianProductFactor.cpp b/gtsam/hybrid/HybridGaussianProductFactor.cpp index f7b5994f0f..280059f542 100644 --- a/gtsam/hybrid/HybridGaussianProductFactor.cpp +++ b/gtsam/hybrid/HybridGaussianProductFactor.cpp @@ -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 diff --git a/gtsam/hybrid/HybridGaussianProductFactor.h b/gtsam/hybrid/HybridGaussianProductFactor.h index ab15fee303..60a58a3a51 100644 --- a/gtsam/hybrid/HybridGaussianProductFactor.h +++ b/gtsam/hybrid/HybridGaussianProductFactor.h @@ -22,6 +22,8 @@ #include #include +#include + namespace gtsam { class HybridGaussianFactor; @@ -55,14 +57,6 @@ class GTSAM_EXPORT HybridGaussianProductFactor */ HybridGaussianProductFactor(Base&& tree) : Base(std::move(tree)) {} - /// Deleted constructor since we don't have istream operator for - /// GaussianFactorGraphValuePair - HybridGaussianProductFactor(const std::vector& labelCs, - const std::string& table) { - throw std::runtime_error( - "HybridGaussianProductFactor: No way to construct."); - } - ///@} /// @name Operators @@ -140,4 +134,14 @@ template <> struct traits : public Testable {}; +/** + * Create a dummy overload of >> for GaussianFactorGraphValuePair + * so that HybridGaussianProductFactor compiles + * with the constructor + * `DecisionTree(const std::vector& labelCs, const std::string& table)`. + * + * Needed to compile on Windows. + */ +std::istream& operator>>(std::istream& is, GaussianFactorGraphValuePair& pair); + } // namespace gtsam