diff --git a/examples/SFMExample_bal_COLAMD_METIS.cpp b/examples/SFMExample_bal_COLAMD_METIS.cpp index 592b834185..20029f5261 100644 --- a/examples/SFMExample_bal_COLAMD_METIS.cpp +++ b/examples/SFMExample_bal_COLAMD_METIS.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/gtsam/base/tests/testKruskal.cpp b/gtsam/base/tests/testKruskal.cpp index bb8cfcaca6..000a777fa9 100644 --- a/gtsam/base/tests/testKruskal.cpp +++ b/gtsam/base/tests/testKruskal.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam/constrained/tests/testNonlinearEqualityConstraint.cpp b/gtsam/constrained/tests/testNonlinearEqualityConstraint.cpp index e09c197a31..3255fa7ab3 100644 --- a/gtsam/constrained/tests/testNonlinearEqualityConstraint.cpp +++ b/gtsam/constrained/tests/testNonlinearEqualityConstraint.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff --git a/gtsam/discrete/DecisionTreeFactor.cpp b/gtsam/discrete/DecisionTreeFactor.cpp index e39339dd8e..61093745c7 100644 --- a/gtsam/discrete/DecisionTreeFactor.cpp +++ b/gtsam/discrete/DecisionTreeFactor.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include diff --git a/gtsam/discrete/DecisionTreeFactor.h b/gtsam/discrete/DecisionTreeFactor.h index 63f0384aac..5ebca38576 100644 --- a/gtsam/discrete/DecisionTreeFactor.h +++ b/gtsam/discrete/DecisionTreeFactor.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/gtsam/discrete/DiscreteConditional.cpp b/gtsam/discrete/DiscreteConditional.cpp index 9a3b6cf46d..f33f3a84d5 100644 --- a/gtsam/discrete/DiscreteConditional.cpp +++ b/gtsam/discrete/DiscreteConditional.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/gtsam/discrete/DiscreteFactor.h b/gtsam/discrete/DiscreteFactor.h index a303839425..9e62e6d098 100644 --- a/gtsam/discrete/DiscreteFactor.h +++ b/gtsam/discrete/DiscreteFactor.h @@ -22,7 +22,6 @@ #include #include #include -#include #include namespace gtsam { @@ -30,6 +29,7 @@ namespace gtsam { class DecisionTreeFactor; class DiscreteConditional; class HybridValues; +class Ordering; /** * Base class for discrete probabilistic factors diff --git a/gtsam/discrete/DiscreteFactorGraph.h b/gtsam/discrete/DiscreteFactorGraph.h index f4d1a18334..5e9fbf2867 100644 --- a/gtsam/discrete/DiscreteFactorGraph.h +++ b/gtsam/discrete/DiscreteFactorGraph.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/gtsam/discrete/TableFactor.cpp b/gtsam/discrete/TableFactor.cpp index b5d3193e4f..03f09a43cf 100644 --- a/gtsam/discrete/TableFactor.cpp +++ b/gtsam/discrete/TableFactor.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include diff --git a/gtsam/discrete/TableFactor.h b/gtsam/discrete/TableFactor.h index 72c2861a2c..565cfb834f 100644 --- a/gtsam/discrete/TableFactor.h +++ b/gtsam/discrete/TableFactor.h @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/gtsam/hybrid/HybridGaussianFactorGraph.h b/gtsam/hybrid/HybridGaussianFactorGraph.h index e3c1e2d557..583b04b5eb 100644 --- a/gtsam/hybrid/HybridGaussianFactorGraph.h +++ b/gtsam/hybrid/HybridGaussianFactorGraph.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/gtsam/hybrid/HybridNonlinearISAM.cpp b/gtsam/hybrid/HybridNonlinearISAM.cpp index 3b4856dfbc..d3d908a004 100644 --- a/gtsam/hybrid/HybridNonlinearISAM.cpp +++ b/gtsam/hybrid/HybridNonlinearISAM.cpp @@ -19,7 +19,6 @@ #include #include #include -#include #include diff --git a/gtsam/hybrid/tests/testHybridGaussianFactorGraph.cpp b/gtsam/hybrid/tests/testHybridGaussianFactorGraph.cpp index c8735c40a9..4d4a93cb0f 100644 --- a/gtsam/hybrid/tests/testHybridGaussianFactorGraph.cpp +++ b/gtsam/hybrid/tests/testHybridGaussianFactorGraph.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/gtsam/inference/BayesTreeCliqueBase-inst.h b/gtsam/inference/BayesTreeCliqueBase-inst.h index 959fa7ed2f..bddde282d7 100644 --- a/gtsam/inference/BayesTreeCliqueBase-inst.h +++ b/gtsam/inference/BayesTreeCliqueBase-inst.h @@ -18,6 +18,7 @@ #include #include +#include #include namespace gtsam { diff --git a/gtsam/inference/BayesTreeCliqueBase.h b/gtsam/inference/BayesTreeCliqueBase.h index c674fb13a5..def2de2312 100644 --- a/gtsam/inference/BayesTreeCliqueBase.h +++ b/gtsam/inference/BayesTreeCliqueBase.h @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include diff --git a/gtsam/inference/ClusterTree-inst.h b/gtsam/inference/ClusterTree-inst.h index 1a0b4470d9..fe45219634 100644 --- a/gtsam/inference/ClusterTree-inst.h +++ b/gtsam/inference/ClusterTree-inst.h @@ -11,7 +11,6 @@ #include #include -#include #include #include diff --git a/gtsam/inference/MetisIndex-inl.h b/gtsam/inference/MetisIndex-inl.h index 672036373a..32741aee67 100644 --- a/gtsam/inference/MetisIndex-inl.h +++ b/gtsam/inference/MetisIndex-inl.h @@ -17,14 +17,16 @@ #pragma once +#include + #include #include namespace gtsam { /* ************************************************************************* */ -template -void MetisIndex::augment(const FACTORGRAPH& factors) { +template +void MetisIndex::augment(const FactorGraphType& factors) { std::map > iAdjMap; // Stores a set of keys that are adjacent to key x, with adjMap.first std::map >::iterator iAdjMapIt; std::set keySet; @@ -37,8 +39,8 @@ void MetisIndex::augment(const FACTORGRAPH& factors) { // and including adjncy[xadj[i + 1] - 1]). int32_t keyCounter = 0; - // First: Record a copy of each key inside the factorgraph and create a - // key to integer mapping. This is referenced during the adjaceny step + // First: Record a copy of each key inside the factor graph and create a + // key to integer mapping. This is referenced during the adjacency step for (size_t i = 0; i < factors.size(); i++) { if (factors[i]) { for(const Key& key: *factors[i]) { diff --git a/gtsam/inference/MetisIndex.h b/gtsam/inference/MetisIndex.h index e051b9ae90..872dc9b950 100644 --- a/gtsam/inference/MetisIndex.h +++ b/gtsam/inference/MetisIndex.h @@ -8,11 +8,11 @@ * See LICENSE for the license information * -------------------------------------------------------------------------- */ -/** - * @file MetisIndex.h - * @author Andrew Melim - * @date Oct. 10, 2014 - */ + /** + * @file MetisIndex.h + * @author Andrew Melim + * @date Oct. 10, 2014 + */ #pragma once @@ -20,11 +20,11 @@ #include #include #include -#include #include #include #include +#include namespace gtsam { /** @@ -50,59 +50,60 @@ class GTSAM_EXPORT MetisIndex { }; std::vector xadj_; // Index of node's adjacency list in adj - std::vector adj_; // Stores ajacency lists of all nodes, appended into a single vector + std::vector adj_; // Stores adjacency lists of all nodes, appended into a single vector BiMap intKeyBMap_; // Stores Key <-> integer value relationship size_t nKeys_; public: - /// @name Standard Constructors + /// @name Constructors /// @{ /** Default constructor, creates empty MetisIndex */ - MetisIndex() : - nKeys_(0) { - } + MetisIndex() : nKeys_(0) {} - template - MetisIndex(const FACTORGRAPH& factorGraph) : - nKeys_(0) { + template + MetisIndex(const FactorGraphType& factorGraph) : + nKeys_(0) { augment(factorGraph); } - ~MetisIndex() { - } + ~MetisIndex() {} + /// @} - /// @name Advanced Interface + /// @name Standard API /// @{ - + /** * Augment the variable index with new factors. This can be used when * solving problems incrementally. */ - template - void augment(const FACTORGRAPH& factors); - - const std::vector& xadj() const { - return xadj_; - } - const std::vector& adj() const { - return adj_; - } - size_t nValues() const { - return nKeys_; - } - Key intToKey(int32_t value) const { -#ifndef NDEBUG - if (value < 0) { - throw; - } -#endif - return intKeyBMap_.right.find(value)->second; + template + void augment(const FactorGraphType& factors); + + const std::vector& xadj() const { return xadj_; } + const std::vector& adj() const { return adj_; } + size_t nValues() const { return nKeys_; } + + Key intToKey(int32_t value) const { return intKeyBMap_.right.find(value)->second; } + + /// @} + /// @name Testable + /// @{ + + /// print to std::cout + void print(const std::string& str = "MetisIndex:") const { + std::cout << str << "\nxadj_: "; + for (const auto& x : xadj_) std::cout << x << " "; + std::cout << "\nadj_: "; + for (const auto& x : adj_) std::cout << x << " "; + std::cout << "\nKey <-> Index: "; + for (const auto& [i, k] : intKeyBMap_.left) std::cout << i << " <-> " << k << ", "; + std::cout << std::endl; } /// @} }; -} // \ namesace gtsam +} // \ namespace gtsam #include diff --git a/gtsam/inference/tests/testOrdering.cpp b/gtsam/inference/tests/testOrdering.cpp index 7b7628f5ba..bc7c7f42df 100644 --- a/gtsam/inference/tests/testOrdering.cpp +++ b/gtsam/inference/tests/testOrdering.cpp @@ -9,11 +9,11 @@ * -------------------------------------------------------------------------- */ -/** - * @file testOrdering - * @author Alex Cunningham - * @author Andrew Melim - */ + /** + * @file testOrdering + * @author Alex Cunningham + * @author Andrew Melim + */ #include #include @@ -26,15 +26,15 @@ using namespace std; using namespace gtsam; namespace example { -SymbolicFactorGraph symbolicChain() { - SymbolicFactorGraph symbolicGraph; - symbolicGraph.push_factor(0, 1); - symbolicGraph.push_factor(1, 2); - symbolicGraph.push_factor(2, 3); - symbolicGraph.push_factor(3, 4); - symbolicGraph.push_factor(4, 5); - return symbolicGraph; -} + SymbolicFactorGraph symbolicChain() { + SymbolicFactorGraph symbolicGraph; + symbolicGraph.push_factor(0, 1); + symbolicGraph.push_factor(1, 2); + symbolicGraph.push_factor(2, 3); + symbolicGraph.push_factor(3, 4); + symbolicGraph.push_factor(4, 5); + return symbolicGraph; + } } /* ************************************************************************* */ TEST(Ordering, constrained_ordering) { @@ -43,34 +43,34 @@ TEST(Ordering, constrained_ordering) { // unconstrained version { - Ordering actual = Ordering::Colamd(symbolicGraph); - Ordering expected{0, 1, 2, 3, 4, 5}; - EXPECT(assert_equal(expected, actual)); + Ordering actual = Ordering::Colamd(symbolicGraph); + Ordering expected{ 0, 1, 2, 3, 4, 5 }; + EXPECT(assert_equal(expected, actual)); } // constrained version - push one set to the end { - Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, {2, 4}); - Ordering expected = Ordering({0, 1, 5, 3, 4, 2}); - EXPECT(assert_equal(expected, actual)); + Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, { 2, 4 }); + Ordering expected{ 0, 1, 5, 3, 4, 2 }; + EXPECT(assert_equal(expected, actual)); } // constrained version - push one set to the start { - Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, {2, 4}); - Ordering expected = Ordering({2, 4, 0, 1, 3, 5}); + Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, { 2, 4 }); + Ordering expected{ 2, 4, 0, 1, 3, 5 }; EXPECT(assert_equal(expected, actual)); } // Make sure giving empty constraints does not break the code { Ordering actual = Ordering::ColamdConstrainedLast(symbolicGraph, {}); - Ordering expected = Ordering({0, 1, 2, 3, 4, 5}); + Ordering expected{ 0, 1, 2, 3, 4, 5 }; EXPECT(assert_equal(expected, actual)); } { Ordering actual = Ordering::ColamdConstrainedFirst(symbolicGraph, {}); - Ordering expected = Ordering({0, 1, 2, 3, 4, 5}); + Ordering expected{ 0, 1, 2, 3, 4, 5 }; EXPECT(assert_equal(expected, actual)); } @@ -78,11 +78,11 @@ TEST(Ordering, constrained_ordering) { SymbolicFactorGraph emptyGraph; Ordering empty; { - Ordering actual = Ordering::ColamdConstrainedLast(emptyGraph, {2, 4}); + Ordering actual = Ordering::ColamdConstrainedLast(emptyGraph, { 2, 4 }); EXPECT(assert_equal(empty, actual)); } { - Ordering actual = Ordering::ColamdConstrainedFirst(emptyGraph, {2, 4}); + Ordering actual = Ordering::ColamdConstrainedFirst(emptyGraph, { 2, 4 }); EXPECT(assert_equal(empty, actual)); } } @@ -102,7 +102,7 @@ TEST(Ordering, grouped_constrained_ordering) { constraints[5] = 2; Ordering actual = Ordering::ColamdConstrained(symbolicGraph, constraints); - Ordering expected{0, 1, 3, 2, 4, 5}; + Ordering expected{ 0, 1, 3, 2, 4, 5 }; EXPECT(assert_equal(expected, actual)); } @@ -136,11 +136,11 @@ TEST(Ordering, csr_format) { MetisIndex mi(symbolicGraph); - const vector xadjExpected{0, 2, 5, 8, 11, 13, 16, 20, - 24, 28, 31, 33, 36, 39, 42, 44}, - adjExpected{1, 5, 0, 2, 6, 1, 3, 7, 2, 4, 8, 3, 9, 0, 6, - 10, 1, 5, 7, 11, 2, 6, 8, 12, 3, 7, 9, 13, 4, 8, - 14, 5, 11, 6, 10, 12, 7, 11, 13, 8, 12, 14, 9, 13}; + const vector xadjExpected{ 0, 2, 5, 8, 11, 13, 16, 20, + 24, 28, 31, 33, 36, 39, 42, 44 }, + adjExpected{ 1, 5, 0, 2, 6, 1, 3, 7, 2, 4, 8, 3, 9, 0, 6, + 10, 1, 5, 7, 11, 2, 6, 8, 12, 3, 7, 9, 13, 4, 8, + 14, 5, 11, 6, 10, 12, 7, 11, 13, 8, 12, 14, 9, 13 }; EXPECT(xadjExpected == mi.xadj()); EXPECT(adjExpected.size() == mi.adj().size()); @@ -160,8 +160,8 @@ TEST(Ordering, csr_format_2) { MetisIndex mi(symbolicGraph); - const std::vector xadjExpected{0, 1, 4, 6, 8, 10}, - adjExpected{1, 0, 2, 4, 1, 3, 2, 4, 1, 3}; + const std::vector xadjExpected{ 0, 1, 4, 6, 8, 10 }, + adjExpected{ 1, 0, 2, 4, 1, 3, 2, 4, 1, 3 }; EXPECT(xadjExpected == mi.xadj()); EXPECT(adjExpected.size() == mi.adj().size()); @@ -181,19 +181,19 @@ TEST(Ordering, csr_format_3) { MetisIndex mi(symbolicGraph); - const std::vector xadjExpected{0, 1, 4, 6, 8, 10}, - adjExpected{1, 0, 2, 4, 1, 3, 2, 4, 1, 3}; + const std::vector xadjExpected{ 0, 1, 4, 6, 8, 10 }, + adjExpected{ 1, 0, 2, 4, 1, 3, 2, 4, 1, 3 }; //size_t minKey = mi.minKey(); - vector adjAcutal = mi.adj(); + vector adjActual = mi.adj(); // Normalize, subtract the smallest key - //std::transform(adjAcutal.begin(), adjAcutal.end(), adjAcutal.begin(), + //std::transform(adjActual.begin(), adjActual.end(), adjActual.begin(), // std::bind2nd(std::minus(), minKey)); EXPECT(xadjExpected == mi.xadj()); EXPECT(adjExpected.size() == mi.adj().size()); - EXPECT(adjExpected == adjAcutal); + EXPECT(adjExpected == adjActual); } /* ************************************************************************* */ @@ -202,26 +202,26 @@ TEST(Ordering, AppendKey) { Ordering actual; actual += X(0); - Ordering expected1{X(0)}; + Ordering expected1{ X(0) }; EXPECT(assert_equal(expected1, actual)); actual += X(1), X(2), X(3); - Ordering expected2{X(0), X(1), X(2), X(3)}; + Ordering expected2{ X(0), X(1), X(2), X(3) }; EXPECT(assert_equal(expected2, actual)); } /* ************************************************************************* */ TEST(Ordering, AppendVector) { using symbol_shorthand::X; - KeyVector keys{X(0), X(1), X(2)}; + KeyVector keys{ X(0), X(1), X(2) }; Ordering actual; actual += keys; - Ordering expected{X(0), X(1), X(2)}; + Ordering expected{ X(0), X(1), X(2) }; EXPECT(assert_equal(expected, actual)); actual = Ordering(); - Ordering addl{X(0), X(1), X(2)}; + Ordering addl{ X(0), X(1), X(2) }; actual += addl; EXPECT(assert_equal(expected, actual)); } @@ -229,7 +229,7 @@ TEST(Ordering, AppendVector) { /* ************************************************************************* */ TEST(Ordering, Contains) { using symbol_shorthand::X; - Ordering ordering{X(0), X(1), X(2)}; + Ordering ordering{ X(0), X(1), X(2) }; EXPECT(ordering.contains(X(1))); EXPECT(!ordering.contains(X(4))); @@ -237,6 +237,7 @@ TEST(Ordering, Contains) { /* ************************************************************************* */ #ifdef GTSAM_SUPPORT_NESTED_DISSECTION +/* ************************************************************************* */ TEST(Ordering, csr_format_4) { SymbolicFactorGraph symbolicGraph; @@ -249,15 +250,15 @@ TEST(Ordering, csr_format_4) { MetisIndex mi(symbolicGraph); - const vector xadjExpected{0, 1, 3, 5, 7, 9, 10}, - adjExpected{1, 0, 2, 1, 3, 2, 4, 3, 5, 4}; + const vector xadjExpected{ 0, 1, 3, 5, 7, 9, 10 }, + adjExpected{ 1, 0, 2, 1, 3, 2, 4, 3, 5, 4 }; - vector adjAcutal = mi.adj(); + vector adjActual = mi.adj(); vector xadjActual = mi.xadj(); EXPECT(xadjExpected == mi.xadj()); EXPECT(adjExpected.size() == mi.adj().size()); - EXPECT(adjExpected == adjAcutal); + EXPECT(adjExpected == adjActual); Ordering metOrder = Ordering::Metis(symbolicGraph); @@ -270,10 +271,9 @@ TEST(Ordering, csr_format_4) { Ordering metOrder2 = Ordering::Metis(symbolicGraph); } -#endif + /* ************************************************************************* */ -#ifdef GTSAM_SUPPORT_NESTED_DISSECTION -TEST(Ordering, metis) { +TEST(Ordering, Metis) { SymbolicFactorGraph symbolicGraph; @@ -283,7 +283,7 @@ TEST(Ordering, metis) { MetisIndex mi(symbolicGraph); - const vector xadjExpected{0, 1, 3, 4}, adjExpected{1, 0, 2, 1}; + const vector xadjExpected{ 0, 1, 3, 4 }, adjExpected{ 1, 0, 2, 1 }; EXPECT(xadjExpected == mi.xadj()); EXPECT(adjExpected.size() == mi.adj().size()); @@ -291,9 +291,8 @@ TEST(Ordering, metis) { Ordering metis = Ordering::Metis(symbolicGraph); } -#endif + /* ************************************************************************* */ -#ifdef GTSAM_SUPPORT_NESTED_DISSECTION TEST(Ordering, MetisLoop) { // create linear graph @@ -310,7 +309,7 @@ TEST(Ordering, MetisLoop) { // | - P( 4 | 0 3) // | | - P( 5 | 0 4) // | - P( 2 | 1 3) - Ordering expected = Ordering({5, 4, 2, 1, 0, 3}); + Ordering expected{ 5, 4, 2, 1, 0, 3 }; EXPECT(assert_equal(expected, actual)); } #elif defined(_WIN32) @@ -320,7 +319,7 @@ TEST(Ordering, MetisLoop) { // | - P( 3 | 5 2) // | | - P( 4 | 5 3) // | - P( 1 | 0 2) - Ordering expected = Ordering({4, 3, 1, 0, 5, 2}); + Ordering expected{ 4, 3, 1, 0, 5, 2 }; EXPECT(assert_equal(expected, actual)); } #else @@ -330,14 +329,13 @@ TEST(Ordering, MetisLoop) { // | - P( 2 | 4 1) // | | - P( 3 | 4 2) // | - P( 5 | 0 1) - Ordering expected = Ordering({3, 2, 5, 0, 4, 1}); + Ordering expected{ 3, 2, 5, 0, 4, 1 }; EXPECT(assert_equal(expected, actual)); } #endif } -#endif + /* ************************************************************************* */ -#ifdef GTSAM_SUPPORT_NESTED_DISSECTION TEST(Ordering, MetisEmptyGraph) { SymbolicFactorGraph symbolicGraph; @@ -345,18 +343,40 @@ TEST(Ordering, MetisEmptyGraph) { Ordering expected; EXPECT(assert_equal(expected, actual)); } -#endif + /* ************************************************************************* */ -#ifdef GTSAM_SUPPORT_NESTED_DISSECTION TEST(Ordering, MetisSingleNode) { // create graph with a single node SymbolicFactorGraph symbolicGraph; symbolicGraph.push_factor(7); Ordering actual = Ordering::Create(Ordering::METIS, symbolicGraph); - Ordering expected = Ordering({7}); + Ordering expected{ 7 }; EXPECT(assert_equal(expected, actual)); } +/* ************************************************************************* */ +TEST(Ordering, MetisDisconnectedGraph) { + SymbolicFactorGraph symbolicGraph; + + symbolicGraph.push_factor(0); + symbolicGraph.push_factor(0, 1); + symbolicGraph.push_factor(2); + symbolicGraph.push_factor(2, 3); + + MetisIndex mi(symbolicGraph); + + const vector xadjExpected{ 0, 1, 2, 3, 4 }, adjExpected{ 1, 0, 3, 2 }; + + EXPECT(xadjExpected == mi.xadj()); + EXPECT(adjExpected.size() == mi.adj().size()); + EXPECT(adjExpected == mi.adj()); + + Ordering metis = Ordering::Metis(symbolicGraph); + Ordering expected{ 0,1,2,3 }; + EXPECT(assert_equal(expected, metis)); +} + +/* ************************************************************************* */ #endif /* ************************************************************************* */ TEST(Ordering, Create) { @@ -372,7 +392,7 @@ TEST(Ordering, Create) { //| | | - P( 1 | 2) //| | | | - P( 0 | 1) Ordering actual = Ordering::Create(Ordering::COLAMD, symbolicGraph); - Ordering expected = Ordering({0, 1, 2, 3, 4, 5}); + Ordering expected{ 0, 1, 2, 3, 4, 5 }; EXPECT(assert_equal(expected, actual)); } @@ -383,7 +403,7 @@ TEST(Ordering, Create) { //- P( 1 0 2) //| - P( 3 4 | 2) //| | - P( 5 | 4) - Ordering expected = Ordering({5, 3, 4, 1, 0, 2}); + Ordering expected{ 5, 3, 4, 1, 0, 2 }; EXPECT(assert_equal(expected, actual)); } #endif diff --git a/gtsam/linear/JacobianFactor.cpp b/gtsam/linear/JacobianFactor.cpp index 82d0eec282..07232b3ab5 100644 --- a/gtsam/linear/JacobianFactor.cpp +++ b/gtsam/linear/JacobianFactor.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam/linear/Scatter.cpp b/gtsam/linear/Scatter.cpp index 07ecaf4838..33f19148aa 100644 --- a/gtsam/linear/Scatter.cpp +++ b/gtsam/linear/Scatter.cpp @@ -18,7 +18,6 @@ #include #include -#include #include diff --git a/gtsam/linear/SubgraphBuilder.cpp b/gtsam/linear/SubgraphBuilder.cpp index 9520b826b0..b36a9ea315 100644 --- a/gtsam/linear/SubgraphBuilder.cpp +++ b/gtsam/linear/SubgraphBuilder.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam/linear/VectorValues.h b/gtsam/linear/VectorValues.h index 35a3817457..7364e458bb 100644 --- a/gtsam/linear/VectorValues.h +++ b/gtsam/linear/VectorValues.h @@ -18,7 +18,6 @@ #pragma once #include -#include #include #include #include diff --git a/gtsam/nonlinear/DoglegOptimizerImpl.h b/gtsam/nonlinear/DoglegOptimizerImpl.h index 1038dd522e..707ab354e8 100644 --- a/gtsam/nonlinear/DoglegOptimizerImpl.h +++ b/gtsam/nonlinear/DoglegOptimizerImpl.h @@ -20,7 +20,7 @@ #include #include -#include +#include namespace gtsam { diff --git a/gtsam/nonlinear/LevenbergMarquardtOptimizer.cpp b/gtsam/nonlinear/LevenbergMarquardtOptimizer.cpp index f6711f0f08..90a4cc68d3 100644 --- a/gtsam/nonlinear/LevenbergMarquardtOptimizer.cpp +++ b/gtsam/nonlinear/LevenbergMarquardtOptimizer.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #if GTSAM_USE_BOOST_FEATURES #include diff --git a/gtsam/nonlinear/NonlinearFactorGraph.cpp b/gtsam/nonlinear/NonlinearFactorGraph.cpp index 6e57a2cf51..4d4a51f640 100644 --- a/gtsam/nonlinear/NonlinearFactorGraph.cpp +++ b/gtsam/nonlinear/NonlinearFactorGraph.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include // for GTSAM_USE_TBB diff --git a/gtsam/nonlinear/NonlinearISAM.cpp b/gtsam/nonlinear/NonlinearISAM.cpp index fb157fadd2..9987460d0c 100644 --- a/gtsam/nonlinear/NonlinearISAM.cpp +++ b/gtsam/nonlinear/NonlinearISAM.cpp @@ -17,7 +17,6 @@ #include #include -#include #include diff --git a/gtsam/nonlinear/NonlinearOptimizer.cpp b/gtsam/nonlinear/NonlinearOptimizer.cpp index 7ca5ead954..d8b17dacde 100644 --- a/gtsam/nonlinear/NonlinearOptimizer.cpp +++ b/gtsam/nonlinear/NonlinearOptimizer.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include diff --git a/gtsam/nonlinear/Values.cpp b/gtsam/nonlinear/Values.cpp index 1caaa9db16..e2579e5a35 100644 --- a/gtsam/nonlinear/Values.cpp +++ b/gtsam/nonlinear/Values.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include diff --git a/gtsam/nonlinear/tests/testBatchFixedLagSmoother.cpp b/gtsam/nonlinear/tests/testBatchFixedLagSmoother.cpp index 23d569c286..c9afcd75e1 100644 --- a/gtsam/nonlinear/tests/testBatchFixedLagSmoother.cpp +++ b/gtsam/nonlinear/tests/testBatchFixedLagSmoother.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam/slam/tests/testAntiFactor.cpp b/gtsam/slam/tests/testAntiFactor.cpp index 31e38964e1..45f1ec52f6 100644 --- a/gtsam/slam/tests/testAntiFactor.cpp +++ b/gtsam/slam/tests/testAntiFactor.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include using namespace std; diff --git a/gtsam/symbolic/SymbolicFactor.cpp b/gtsam/symbolic/SymbolicFactor.cpp index 1f26389e9b..b343e4fd62 100644 --- a/gtsam/symbolic/SymbolicFactor.cpp +++ b/gtsam/symbolic/SymbolicFactor.cpp @@ -16,7 +16,6 @@ */ #include -#include #include #include #include diff --git a/gtsam/symbolic/tests/symbolicExampleGraphs.h b/gtsam/symbolic/tests/symbolicExampleGraphs.h index 3d30534e96..1dda7fe71c 100644 --- a/gtsam/symbolic/tests/symbolicExampleGraphs.h +++ b/gtsam/symbolic/tests/symbolicExampleGraphs.h @@ -25,7 +25,6 @@ #include #include #include -#include #include namespace gtsam { diff --git a/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp b/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp index 15038c23fc..86fee17378 100644 --- a/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp +++ b/gtsam_unstable/nonlinear/tests/testConcurrentBatchFilter.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam_unstable/nonlinear/tests/testConcurrentBatchSmoother.cpp b/gtsam_unstable/nonlinear/tests/testConcurrentBatchSmoother.cpp index a2733d509c..514382ef78 100644 --- a/gtsam_unstable/nonlinear/tests/testConcurrentBatchSmoother.cpp +++ b/gtsam_unstable/nonlinear/tests/testConcurrentBatchSmoother.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalSmootherDL.cpp b/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalSmootherDL.cpp index b9dca7a7c3..03d9df35f4 100644 --- a/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalSmootherDL.cpp +++ b/gtsam_unstable/nonlinear/tests/testConcurrentIncrementalSmootherDL.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam_unstable/nonlinear/tests/testIncrementalFixedLagSmoother.cpp b/gtsam_unstable/nonlinear/tests/testIncrementalFixedLagSmoother.cpp index 269177b5db..356a9451da 100644 --- a/gtsam_unstable/nonlinear/tests/testIncrementalFixedLagSmoother.cpp +++ b/gtsam_unstable/nonlinear/tests/testIncrementalFixedLagSmoother.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/gtsam_unstable/slam/tests/testMultiProjectionFactor.cpp b/gtsam_unstable/slam/tests/testMultiProjectionFactor.cpp index 1d438b4570..e049cf7d19 100644 --- a/gtsam_unstable/slam/tests/testMultiProjectionFactor.cpp +++ b/gtsam_unstable/slam/tests/testMultiProjectionFactor.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/testGaussianISAM.cpp b/tests/testGaussianISAM.cpp index ee333f4c45..96ebe149b5 100644 --- a/tests/testGaussianISAM.cpp +++ b/tests/testGaussianISAM.cpp @@ -20,7 +20,6 @@ #include #include #include -#include using namespace std; using namespace gtsam; diff --git a/tests/testGaussianISAM2.cpp b/tests/testGaussianISAM2.cpp index 3b507d8065..e023cae1fe 100644 --- a/tests/testGaussianISAM2.cpp +++ b/tests/testGaussianISAM2.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/testGaussianJunctionTreeB.cpp b/tests/testGaussianJunctionTreeB.cpp index 2c5dc493bf..1cc05b63fd 100644 --- a/tests/testGaussianJunctionTreeB.cpp +++ b/tests/testGaussianJunctionTreeB.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/tests/testSubgraphPreconditioner.cpp b/tests/testSubgraphPreconditioner.cpp index 994fe5112f..96f5824065 100644 --- a/tests/testSubgraphPreconditioner.cpp +++ b/tests/testSubgraphPreconditioner.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include #include diff --git a/tests/testSubgraphSolver.cpp b/tests/testSubgraphSolver.cpp index e31ce23b58..e5ee6d4f22 100644 --- a/tests/testSubgraphSolver.cpp +++ b/tests/testSubgraphSolver.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/timing/timeSFMBAL.h b/timing/timeSFMBAL.h index 7af7988875..1081956f55 100644 --- a/timing/timeSFMBAL.h +++ b/timing/timeSFMBAL.h @@ -24,7 +24,6 @@ #include #include #include -#include #include #include