implement dummy >> operator

release/4.3a0
Varun Agrawal 2024-10-09 13:47:59 -04:00
parent 4d707e7cdd
commit 93ec276ef3
2 changed files with 18 additions and 8 deletions

View File

@ -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

View File

@ -22,6 +22,8 @@
#include <gtsam/inference/Key.h>
#include <gtsam/linear/GaussianFactorGraph.h>
#include <iostream>
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<DiscreteKey>& labelCs,
const std::string& table) {
throw std::runtime_error(
"HybridGaussianProductFactor: No way to construct.");
}
///@}
/// @name Operators
@ -140,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