From c4fb76429909feef526f6d5d72463595b5462547 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Sat, 7 Jan 2023 10:19:52 -0800 Subject: [PATCH] Removed boost headers in DecisionTree-inl.h that are no longer needed. --- gtsam/discrete/DecisionTree-inl.h | 11 ++--------- gtsam_unstable/discrete/Domain.cpp | 3 +-- gtsam_unstable/discrete/SingleValue.cpp | 3 +-- gtsam_unstable/discrete/tests/testSudoku.cpp | 6 +++--- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/gtsam/discrete/DecisionTree-inl.h b/gtsam/discrete/DecisionTree-inl.h index d01c91840..9f3d5e8f9 100644 --- a/gtsam/discrete/DecisionTree-inl.h +++ b/gtsam/discrete/DecisionTree-inl.h @@ -22,14 +22,10 @@ #include #include -#include #include #include -#include #include -#include -#include -#include + #include #include #include @@ -41,8 +37,6 @@ namespace gtsam { - using boost::assign::operator+=; - /****************************************************************************/ // Node /****************************************************************************/ @@ -535,8 +529,7 @@ namespace gtsam { template DecisionTree::DecisionTree(const L& label, const DecisionTree& f0, const DecisionTree& f1) { - std::vector functions; - functions += f0, f1; + const std::vector functions{f0, f1}; root_ = compose(functions.begin(), functions.end(), label); } diff --git a/gtsam_unstable/discrete/Domain.cpp b/gtsam_unstable/discrete/Domain.cpp index 7acc10cb4..cf0da42e7 100644 --- a/gtsam_unstable/discrete/Domain.cpp +++ b/gtsam_unstable/discrete/Domain.cpp @@ -37,8 +37,7 @@ double Domain::operator()(const DiscreteValues& values) const { /* ************************************************************************* */ DecisionTreeFactor Domain::toDecisionTreeFactor() const { - DiscreteKeys keys; - keys += DiscreteKey(key(), cardinality_); + const DiscreteKeys keys{DiscreteKey(key(), cardinality_)}; vector table; for (size_t i1 = 0; i1 < cardinality_; ++i1) table.push_back(contains(i1)); DecisionTreeFactor converted(keys, table); diff --git a/gtsam_unstable/discrete/SingleValue.cpp b/gtsam_unstable/discrete/SingleValue.cpp index 6dd81a7dc..fc5fab83f 100644 --- a/gtsam_unstable/discrete/SingleValue.cpp +++ b/gtsam_unstable/discrete/SingleValue.cpp @@ -29,8 +29,7 @@ double SingleValue::operator()(const DiscreteValues& values) const { /* ************************************************************************* */ DecisionTreeFactor SingleValue::toDecisionTreeFactor() const { - DiscreteKeys keys; - keys += DiscreteKey(keys_[0], cardinality_); + const DiscreteKeys keys{DiscreteKey(keys_[0], cardinality_)}; vector table; for (size_t i1 = 0; i1 < cardinality_; i1++) table.push_back(i1 == value_); DecisionTreeFactor converted(keys, table); diff --git a/gtsam_unstable/discrete/tests/testSudoku.cpp b/gtsam_unstable/discrete/tests/testSudoku.cpp index 9796c25f1..a47611222 100644 --- a/gtsam_unstable/discrete/tests/testSudoku.cpp +++ b/gtsam_unstable/discrete/tests/testSudoku.cpp @@ -58,14 +58,14 @@ class Sudoku : public CSP { // add row constraints for (size_t i = 0; i < n; i++) { DiscreteKeys dkeys; - for (size_t j = 0; j < n; j++) dkeys += dkey(i, j); + for (size_t j = 0; j < n; j++) dkeys.push_back(dkey(i, j)); addAllDiff(dkeys); } // add col constraints for (size_t j = 0; j < n; j++) { DiscreteKeys dkeys; - for (size_t i = 0; i < n; i++) dkeys += dkey(i, j); + for (size_t i = 0; i < n; i++) dkeys.push_back(dkey(i, j)); addAllDiff(dkeys); } @@ -77,7 +77,7 @@ class Sudoku : public CSP { // Box I,J DiscreteKeys dkeys; for (size_t i = i0; i < i0 + N; i++) - for (size_t j = j0; j < j0 + N; j++) dkeys += dkey(i, j); + for (size_t j = j0; j < j0 + N; j++) dkeys.push_back(dkey(i, j)); addAllDiff(dkeys); j0 += N; }