Point2 specialized
parent
f08dc6c031
commit
ec69949f43
|
@ -337,8 +337,7 @@ struct is_manifold: public false_type {
|
|||
|
||||
// dimension
|
||||
template<typename T>
|
||||
struct dimension: public integral_constant<size_t, T::dimension> {
|
||||
};
|
||||
struct dimension;
|
||||
|
||||
// Fixed size Eigen::Matrix type
|
||||
template<int M, int N, int Options>
|
||||
|
@ -351,6 +350,16 @@ struct dimension<Eigen::Matrix<double, M, N, Options> > : public integral_consta
|
|||
BOOST_STATIC_ASSERT(M!=Eigen::Dynamic && N!=Eigen::Dynamic);
|
||||
};
|
||||
|
||||
// Point2
|
||||
|
||||
template<>
|
||||
struct is_manifold<Point2> : public true_type {
|
||||
};
|
||||
|
||||
template<>
|
||||
struct dimension<Point2> : public integral_constant<size_t, 2> {
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct manifold_traits {
|
||||
typedef T type;
|
||||
|
@ -381,8 +390,15 @@ struct manifold_traits<Eigen::Matrix<double, M, N, Options> > {
|
|||
}
|
||||
};
|
||||
|
||||
// Test dimension traits
|
||||
TEST(Expression, Traits) {
|
||||
// is_manifold
|
||||
TEST(Expression, is_manifold) {
|
||||
EXPECT(!is_manifold<int>::value);
|
||||
EXPECT(is_manifold<Point2>::value);
|
||||
EXPECT(is_manifold<Matrix24>::value);
|
||||
}
|
||||
|
||||
// dimension
|
||||
TEST(Expression, dimension) {
|
||||
EXPECT_LONGS_EQUAL(2, dimension<Point2>::value);
|
||||
EXPECT_LONGS_EQUAL(8, dimension<Matrix24>::value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue