From 403f1a97ad63423d2f7b43a3a690cac9e412bc94 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Tue, 27 Sep 2011 20:24:05 +0000 Subject: [PATCH] Fixed Permutation unit tests --- gtsam/inference/tests/testPermutation.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gtsam/inference/tests/testPermutation.cpp b/gtsam/inference/tests/testPermutation.cpp index a6c5116b5..cd5705db3 100644 --- a/gtsam/inference/tests/testPermutation.cpp +++ b/gtsam/inference/tests/testPermutation.cpp @@ -79,19 +79,19 @@ TEST(Permutation, compose) { Permutation expected(5); expected[0] = 2; - expected[1] = 4; - expected[2] = 3; - expected[3] = 0; + expected[1] = 3; + expected[2] = 0; + expected[3] = 4; expected[4] = 1; - Permutation actual = *p2.permute(p1); + Permutation actual = *p1.permute(p2); EXPECT(assert_equal(expected, actual)); - LONGS_EQUAL(p2[p1[0]], actual[0]); - LONGS_EQUAL(p2[p1[1]], actual[1]); - LONGS_EQUAL(p2[p1[2]], actual[2]); - LONGS_EQUAL(p2[p1[3]], actual[3]); - LONGS_EQUAL(p2[p1[4]], actual[4]); + LONGS_EQUAL(p1[p2[0]], actual[0]); + LONGS_EQUAL(p1[p2[1]], actual[1]); + LONGS_EQUAL(p1[p2[2]], actual[2]); + LONGS_EQUAL(p1[p2[3]], actual[3]); + LONGS_EQUAL(p1[p2[4]], actual[4]); } /* ************************************************************************* */