From 93ec276ef3090c46a13307c6c777b51f84f308aa Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 9 Oct 2024 13:47:59 -0400 Subject: [PATCH] implement dummy >> operator --- gtsam/hybrid/HybridGaussianProductFactor.cpp | 6 ++++++ gtsam/hybrid/HybridGaussianProductFactor.h | 20 ++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) 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