diff --git a/include/manif/impl/composite/Composite.h b/include/manif/impl/composite/Composite.h index 47399e58..94c3cc86 100644 --- a/include/manif/impl/composite/Composite.h +++ b/include/manif/impl/composite/Composite.h @@ -173,6 +173,6 @@ Composite<_Scalar, _T...>::coeffs() const return data_; } -} // namespace manif +} // namespace manif -#endif // _MANIF_MANIF_COMPOSITE_H_ +#endif // _MANIF_MANIF_COMPOSITE_H_ diff --git a/include/manif/impl/composite/Composite_properties.h b/include/manif/impl/composite/Composite_properties.h index 49b89d1d..13e2c9da 100644 --- a/include/manif/impl/composite/Composite_properties.h +++ b/include/manif/impl/composite/Composite_properties.h @@ -33,7 +33,10 @@ struct intseq // join two intseqs template -struct intseq_join; +struct intseq_join +{ + using type = std::false_type; +}; template class _IntSeq, _Int ... _I1, _Int ... _I2> struct intseq_join<_IntSeq<_Int, _I1...>, _IntSeq<_Int, _I2...>> @@ -47,7 +50,11 @@ using intseq_join_t = typename intseq_join<_Seq1, _Seq2>::type; // create intseq of given length template -struct make_intseq; +struct make_intseq +{ + using type = + typename intseq_join::type, intseq<_Int, _N - 1>>::type; +}; template struct make_intseq<_Int, 0> @@ -55,20 +62,16 @@ struct make_intseq<_Int, 0> using type = intseq<_Int>; }; -template -struct make_intseq -{ - using type = - typename intseq_join::type, intseq<_Int, _N - 1>>::type; -}; - template using make_intseq_t = typename make_intseq<_Int, _N>::type; // extract element from integer sequence template -struct intseq_element; +struct intseq_element +{ + static constexpr typename _Seq::value_type value = 0; +}; template class _IntSeq, _Int _I, _Int ... _Is> struct intseq_element<0, _IntSeq<_Int, _I, _Is...>> @@ -79,9 +82,7 @@ struct intseq_element<0, _IntSeq<_Int, _I, _Is...>> template< typename _Int, template class _IntSeq, - _Int _I, - _Int ... _Is, - size_t _Idx> + _Int _I, _Int ... _Is, size_t _Idx> struct intseq_element<_Idx, _IntSeq<_Int, _I, _Is...>> { static constexpr _Int value = intseq_element<_Idx - 1, _IntSeq<_Int, _Is...>>::value; @@ -94,7 +95,10 @@ struct intseq_element<_Idx, _IntSeq<_Int, _I, _Is...>> // sum an integer sequence template -struct intseq_sum; +struct intseq_sum +{ + static constexpr typename _Seq::value_type value = 0; +}; template class _IntSeq> struct intseq_sum<_IntSeq<_Int>> @@ -115,7 +119,10 @@ struct intseq_sum<_IntSeq<_Int, I, Is...>> // prefix-sum an integer sequence template -struct intseq_psum_impl; +struct intseq_psum_impl +{ + using type = std::false_type; +}; template< typename _Int, @@ -134,7 +141,10 @@ struct intseq_psum_impl<_Int, _IntSeq<_Int, _Cur...>, _IntSeq<_Int, _First, _Rem {}; template -struct intseq_psum; +struct intseq_psum +{ + using type = std::false_type; +}; template class _IntSeq, _Int ... _I> struct intseq_psum<_IntSeq<_Int, _I...>> diff --git a/test/ceres/CMakeLists.txt b/test/ceres/CMakeLists.txt index a1b6bb89..85b8bb8a 100644 --- a/test/ceres/CMakeLists.txt +++ b/test/ceres/CMakeLists.txt @@ -9,6 +9,8 @@ manif_add_gtest(gtest_so3_ceres gtest_so3_ceres.cpp) manif_add_gtest(gtest_se3_ceres gtest_se3_ceres.cpp) +manif_add_gtest(gtest_composite_ceres gtest_composite_ceres.cpp) + set(CXX_11_TEST_TARGETS_CERES # SO2 gtest_so2_ceres @@ -22,6 +24,9 @@ set(CXX_11_TEST_TARGETS_CERES # SE3 gtest_se3_ceres + + # Composite + gtest_composite_ceres ) foreach(target ${CXX_11_TEST_TARGETS_CERES}) diff --git a/test/ceres/gtest_composite_ceres.cpp b/test/ceres/gtest_composite_ceres.cpp new file mode 100644 index 00000000..09930c9e --- /dev/null +++ b/test/ceres/gtest_composite_ceres.cpp @@ -0,0 +1,20 @@ +#include "manif/Composite.h" +#include "manif/Rn.h" +#include "manif/SO2.h" +#include "manif/SO3.h" + +#include "ceres_test_utils.h" + +#include + +using namespace manif; + +using Group = Composite; + +MANIF_TEST_JACOBIANS_CERES(Group); + +int main(int argc, char** argv) +{ + testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +}