diff --git a/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp b/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp index 7d15f47e7..7feb7674b 100644 --- a/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp +++ b/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp @@ -184,7 +184,9 @@ TEST(GaussianBayesNet, ComputeSteepestDescentPoint) { VectorValues actual = gbn.optimizeGradientSearch(); // Check that points agree - EXPECT(assert_equal(expected, actual.vector(), 1e-5)); + Vector actualAsVector = actual.vector(FastVector(list_of + (0)(1)(2)(3)(4))); + EXPECT(assert_equal(expected, actualAsVector, 1e-5)); // Check that point causes a decrease in error double origError = GaussianFactorGraph(gbn).error(VectorValues::Zero(actual)); diff --git a/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp b/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp index 88d2738a8..7790d6e4f 100644 --- a/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp +++ b/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp @@ -274,7 +274,9 @@ TEST(GaussianBayesTree, ComputeSteepestDescentPointBT) { VectorValues actual = bt.optimizeGradientSearch(); // Check that points agree - EXPECT(assert_equal(expected, actual.vector(), 1e-5)); + Vector actualAsVector = actual.vector(FastVector(list_of + (0)(1)(2)(3)(4))); + EXPECT(assert_equal(expected, actualAsVector, 1e-5)); EXPECT(assert_equal(expectedFromBN, actual, 1e-5)); // Check that point causes a decrease in error diff --git a/gtsam/linear/tests/testVectorValuesUnordered.cpp b/gtsam/linear/tests/testVectorValuesUnordered.cpp index a651cdf72..843e7bbad 100644 --- a/gtsam/linear/tests/testVectorValuesUnordered.cpp +++ b/gtsam/linear/tests/testVectorValuesUnordered.cpp @@ -16,6 +16,7 @@ */ #include +#include #include #include @@ -59,7 +60,8 @@ TEST(VectorValues, basics) EXPECT(assert_equal(Vector_(2, 2.0, 3.0), actual[1])); EXPECT(assert_equal(Vector_(2, 4.0, 5.0), actual[2])); EXPECT(assert_equal(Vector_(2, 6.0, 7.0), actual[5])); - EXPECT(assert_equal(Vector_(7, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), actual.vector())); + EXPECT(assert_equal(Vector_(7, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), actual.vector(FastVector(list_of + (0)(1)(2)(5))))); // Check exceptions CHECK_EXCEPTION(actual.insert(1, Vector()), invalid_argument); diff --git a/gtsam_unstable/linear/bayesTreeOperations.cpp b/gtsam_unstable/linear/bayesTreeOperations.cpp index d9c9eda32..9dd8ed607 100644 --- a/gtsam_unstable/linear/bayesTreeOperations.cpp +++ b/gtsam_unstable/linear/bayesTreeOperations.cpp @@ -55,12 +55,14 @@ GaussianFactorGraph splitFactor(const GaussianFactor::shared_ptr& factor) { } Vector subB = jf->getb().segment(startRow, nrRows); - Vector sigmas = jf->get_model()->sigmas().segment(startRow, nrRows); SharedDiagonal model; - if (jf->get_model()->isConstrained()) - model = noiseModel::Constrained::MixedSigmas(sigmas); - else - model = noiseModel::Diagonal::Sigmas(sigmas); + if(jf->get_model()) { + Vector sigmas = jf->get_model()->sigmas().segment(startRow, nrRows); + if (jf->get_model()->isConstrained()) + model = noiseModel::Constrained::MixedSigmas(sigmas); + else + model = noiseModel::Diagonal::Sigmas(sigmas); + } // extract matrices from each // assemble into new JacobianFactor diff --git a/gtsam_unstable/linear/tests/testBayesTreeOperations.cpp b/gtsam_unstable/linear/tests/testBayesTreeOperations.cpp index 64906936a..b0d36c515 100644 --- a/gtsam_unstable/linear/tests/testBayesTreeOperations.cpp +++ b/gtsam_unstable/linear/tests/testBayesTreeOperations.cpp @@ -277,7 +277,6 @@ TEST( testBayesTreeOperations, liquefy ) { // Liquefy the tree back into a graph, splitting factors { - CHECK(("*** liquify fails here *** - does not check for null noiseModel", 0)); GaussianFactorGraph actGraph = liquefy(bayesTree, true); GaussianFactorGraph expGraph; diff --git a/gtsam_unstable/slam/CMakeLists.txt b/gtsam_unstable/slam/CMakeLists.txt index b9580a85b..934980e57 100644 --- a/gtsam_unstable/slam/CMakeLists.txt +++ b/gtsam_unstable/slam/CMakeLists.txt @@ -25,7 +25,7 @@ set (slam_full_libs # Exclude tests that don't work set (slam_excluded_tests -# "${CMAKE_CURRENT_SOURCE_DIR}/tests/testSerialization.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/testSerialization.cpp" # "" # Add to this list, with full path, to exclude ) # Add all tests diff --git a/gtsam_unstable/slam/tests/testSerialization.cpp b/gtsam_unstable/slam/tests/testSerialization.cpp index 4ade3b05f..a5e09515c 100644 --- a/gtsam_unstable/slam/tests/testSerialization.cpp +++ b/gtsam_unstable/slam/tests/testSerialization.cpp @@ -10,13 +10,6 @@ #include #include -TEST(testSerialization, disabled) -{ - CHECK(("*** testSerialization in gtsam_unstable/slam is disabled *** - Needs conversion for unordered", 0)); -} - -#if 0 - #include #include @@ -125,8 +118,6 @@ TEST( testSerialization, serialization_file ) { EXPECT(assert_equal(values, actValuesXML)); } -#endif - /* ************************************************************************* */ int main() { TestResult tr; return TestRegistry::runAllTests(tr); } /* ************************************************************************* */