diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index 27e98fcde..29c36d27a 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -523,19 +523,19 @@ namespace gtsam { root_ = create(labelCs.begin(), labelCs.end(), ys.begin(), ys.end()); } - /****************************************************************************/ - template - DecisionTree::DecisionTree(const std::vector& labelCs, - const std::string& table) { - // Convert std::string to values of type Y - std::vector ys; - std::istringstream iss(table); - copy(std::istream_iterator(iss), std::istream_iterator(), - back_inserter(ys)); + // /****************************************************************************/ + // template + // DecisionTree::DecisionTree(const std::vector& labelCs, + // const std::string& table) { + // // Convert std::string to values of type Y + // std::vector ys; + // std::istringstream iss(table); + // copy(std::istream_iterator(iss), std::istream_iterator(), + // back_inserter(ys)); - // now call recursive Create - root_ = create(labelCs.begin(), labelCs.end(), ys.begin(), ys.end()); - } + // // now call recursive Create + // root_ = create(labelCs.begin(), labelCs.end(), ys.begin(), ys.end()); + // } /****************************************************************************/ template diff --git a/gtsam/discrete/DecisionTree.h b/gtsam/discrete/DecisionTree.h index 6d6179a7e..a02fa9d38 100644 --- a/gtsam/discrete/DecisionTree.h +++ b/gtsam/discrete/DecisionTree.h @@ -205,8 +205,8 @@ namespace gtsam { /** Create from keys and a corresponding vector of values */ DecisionTree(const std::vector& labelCs, const std::vector& ys); - /** Create from keys and string table */ - DecisionTree(const std::vector& labelCs, const std::string& table); + // /** Create from keys and string table */ + // DecisionTree(const std::vector& labelCs, const std::string& table); /** Create DecisionTree from others */ template diff --git a/gtsam/discrete/tests/testDecisionTree.cpp b/gtsam/discrete/tests/testDecisionTree.cpp index c625e1ba6..2cc8d8441 100644 --- a/gtsam/discrete/tests/testDecisionTree.cpp +++ b/gtsam/discrete/tests/testDecisionTree.cpp @@ -333,17 +333,17 @@ TEST(DecisionTree, Compose) { // Create from string vector keys{DT::LabelC(A, 2), DT::LabelC(B, 2)}; - DT f2(keys, "0 2 1 3"); + DT f2(keys, {0, 2, 1, 3}); EXPECT(assert_equal(f2, f1, 1e-9)); // Put this AB tree together with another one - DT f3(keys, "4 6 5 7"); + DT f3(keys, {4, 6, 5, 7}); DT f4(C, f1, f3); DOT(f4); // a bigger tree keys.push_back(DT::LabelC(C, 2)); - DT f5(keys, "0 4 2 6 1 5 3 7"); + DT f5(keys, {0, 4, 2, 6, 1, 5, 3, 7}); EXPECT(assert_equal(f5, f4, 1e-9)); DOT(f5); } @@ -508,7 +508,7 @@ TEST(DecisionTree, threshold) { // Create three level tree const vector keys{DT::LabelC("C", 2), DT::LabelC("B", 2), DT::LabelC("A", 2)}; - DT tree(keys, "0 1 2 3 4 5 6 7"); + DT tree(keys, {0, 1, 2, 3, 4, 5, 6, 7}); // Check number of leaves equal to zero auto count = [](const int& value, int count) { @@ -536,10 +536,10 @@ TEST(DecisionTree, ApplyWithAssignment) { // Create three level tree const vector keys{DT::LabelC("C", 2), DT::LabelC("B", 2), DT::LabelC("A", 2)}; - DT tree(keys, "1 2 3 4 5 6 7 8"); + DT tree(keys, {1, 2, 3, 4, 5, 6, 7, 8}); DecisionTree probTree( - keys, "0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08"); + keys, {0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08}); double threshold = 0.045; // We test pruning one tree by indexing into another. @@ -553,7 +553,7 @@ TEST(DecisionTree, ApplyWithAssignment) { }; DT prunedTree = tree.apply(pruner); - DT expectedTree(keys, "0 0 0 0 5 6 7 8"); + DT expectedTree(keys, {0, 0, 0, 0, 5, 6, 7, 8}); EXPECT(assert_equal(expectedTree, prunedTree)); size_t count = 0; diff --git a/gtsam/hybrid/HybridGaussianProductFactor.h b/gtsam/hybrid/HybridGaussianProductFactor.h index ab15fee30..a06f24423 100644 --- a/gtsam/hybrid/HybridGaussianProductFactor.h +++ b/gtsam/hybrid/HybridGaussianProductFactor.h @@ -55,14 +55,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