diff --git a/gtsam/slam/KarcherMeanFactor-inl.h b/gtsam/slam/KarcherMeanFactor-inl.h index 8ff61d796..076b0ff0c 100644 --- a/gtsam/slam/KarcherMeanFactor-inl.h +++ b/gtsam/slam/KarcherMeanFactor-inl.h @@ -41,8 +41,14 @@ T FindKarcherMeanImpl(const vector& rotations) { return result.at(kKey); } -template -T FindKarcherMean(const vector& rotations) { +template ::value >::type > +T FindKarcherMean(const std::vector& rotations) { + return FindKarcherMeanImpl(rotations); +} + +template +T FindKarcherMean(const std::vector>& rotations) { return FindKarcherMeanImpl(rotations); } diff --git a/gtsam/slam/KarcherMeanFactor.h b/gtsam/slam/KarcherMeanFactor.h index f62cb8904..54b3930d4 100644 --- a/gtsam/slam/KarcherMeanFactor.h +++ b/gtsam/slam/KarcherMeanFactor.h @@ -29,8 +29,8 @@ namespace gtsam { * the given rotations, by constructing a factor graph out of simple * PriorFactors. */ -template > -T FindKarcherMean(const std::vector& rotations); +template +T FindKarcherMean(const std::vector>& rotations); template T FindKarcherMean(std::initializer_list&& rotations); diff --git a/gtsam/slam/tests/testKarcherMeanFactor.cpp b/gtsam/slam/tests/testKarcherMeanFactor.cpp index 64cdb1682..c129b8fa3 100644 --- a/gtsam/slam/tests/testKarcherMeanFactor.cpp +++ b/gtsam/slam/tests/testKarcherMeanFactor.cpp @@ -75,7 +75,7 @@ static const SO4 Q = SO4::Expmap((Vector6() << 1, 2, 3, 4, 5, 6).finished()); /* ************************************************************************* */ TEST(KarcherMean, FindSO4) { - std::vector rotations = {Q, Q.inverse()}; + std::vector> rotations = {Q, Q.inverse()}; auto expected = SO4(); //::ChordalMean(rotations); auto actual = FindKarcherMean(rotations); EXPECT(assert_equal(expected, actual));