From 14fef517d8dbfe40f02776fc85599459d1e42e2f Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Fri, 16 Aug 2013 15:07:54 +0000 Subject: [PATCH] Fixed list_of problem on old boost and clang --- gtsam/linear/tests/testGaussianBayesNetUnordered.cpp | 4 ++-- gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp | 5 ++--- gtsam/linear/tests/testVectorValuesUnordered.cpp | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp b/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp index 7feb7674b..e9898924f 100644 --- a/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp +++ b/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp @@ -184,8 +184,8 @@ TEST(GaussianBayesNet, ComputeSteepestDescentPoint) { VectorValues actual = gbn.optimizeGradientSearch(); // Check that points agree - Vector actualAsVector = actual.vector(FastVector(list_of - (0)(1)(2)(3)(4))); + FastVector keys = list_of(0)(1)(2)(3)(4); + Vector actualAsVector = actual.vector(keys); EXPECT(assert_equal(expected, actualAsVector, 1e-5)); // Check that point causes a decrease in error diff --git a/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp b/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp index 7790d6e4f..593bdc141 100644 --- a/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp +++ b/gtsam/linear/tests/testGaussianBayesTreeUnordered.cpp @@ -274,9 +274,8 @@ TEST(GaussianBayesTree, ComputeSteepestDescentPointBT) { VectorValues actual = bt.optimizeGradientSearch(); // Check that points agree - Vector actualAsVector = actual.vector(FastVector(list_of - (0)(1)(2)(3)(4))); - EXPECT(assert_equal(expected, actualAsVector, 1e-5)); + FastVector keys = list_of(0)(1)(2)(3)(4); + EXPECT(assert_equal(expected, actual.vector(keys), 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 843e7bbad..a93a29e48 100644 --- a/gtsam/linear/tests/testVectorValuesUnordered.cpp +++ b/gtsam/linear/tests/testVectorValuesUnordered.cpp @@ -60,8 +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(FastVector(list_of - (0)(1)(2)(5))))); + FastVector keys = list_of(0)(1)(2)(5); + EXPECT(assert_equal(Vector_(7, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0), actual.vector(keys))); // Check exceptions CHECK_EXCEPTION(actual.insert(1, Vector()), invalid_argument);