Forgot to check in how to use macros...

release/4.3a0
dellaert 2014-12-07 21:03:54 +01:00
parent 949a6b7f4c
commit fd59783fae
2 changed files with 9 additions and 11 deletions

View File

@ -62,7 +62,9 @@ public:
}; };
GTSAM_ADDITIVE_GROUP1(size_t, N, Cyclic) #define CYCLIC_TEMPLATE size_t N
#define CYCLIC_TYPE Cyclic<N>
GTSAM_ADDITIVE_GROUP(CYCLIC_TEMPLATE, CYCLIC_TYPE)
/// Define cyclic group to be a model of the Group concept /// Define cyclic group to be a model of the Group concept
namespace traits { namespace traits {

View File

@ -76,17 +76,13 @@ struct QuaternionChart {
} }
}; };
#define GTSAM_MANIFOLD2(T1,A1,T2,A2,MANIFOLD,DIM,SCALAR,OPTIONS,CHART) \ #define QUATERNION_TEMPLATE typename _Scalar, int _Options
namespace manifold { \ #define QUATERNION_TYPE Eigen::Quaternion<_Scalar,_Options>
namespace traits { \ GTSAM_MULTIPLICATIVE_GROUP(QUATERNION_TEMPLATE, QUATERNION_TYPE)
template<T1 A1, T2 A2> struct dimension<MANIFOLD<A1,A2> > : public boost::integral_constant<int, DIM> {};\
template<T1 A1, T2 A2> struct TangentVector<MANIFOLD<A1,A2> > { typedef Eigen::Matrix<SCALAR, DIM, 1, OPTIONS, DIM, 1> type;};\
template<T1 A1, T2 A2> struct DefaultChart<MANIFOLD<A1,A2> > { typedef CHART<A1,A2> type;};\
}}
#define QUATERNION_TANGENT Eigen::Matrix<_Scalar, 3, 1, _Options, 3, 1>
GTSAM_MANIFOLD2(typename, _Scalar, int, _Options, Eigen::Quaternion, 3, _Scalar, _Options, QuaternionChart) #define QUATERNION_CHART QuaternionChart<_Scalar,_Options>
GTSAM_MULTIPLICATIVE_GROUP2(typename, _Scalar, int, _Options, Eigen::Quaternion) GTSAM_MANIFOLD(QUATERNION_TEMPLATE,QUATERNION_TYPE,3,QUATERNION_TANGENT,QUATERNION_CHART)
/// Define Eigen::Quaternion to be a model of the Lie Group concept /// Define Eigen::Quaternion to be a model of the Lie Group concept
namespace traits { namespace traits {