release/4.3a0
Mike Bosse 2014-12-12 21:31:00 +01:00
parent df8dc1f99c
commit 94c2490b6f
3 changed files with 7 additions and 6 deletions

View File

@ -70,7 +70,8 @@ struct is_manifold: public boost::false_type {
// defaults to dynamic, TODO makes sense ? // defaults to dynamic, TODO makes sense ?
typedef boost::integral_constant<int, Eigen::Dynamic> Dynamic; typedef boost::integral_constant<int, Eigen::Dynamic> Dynamic;
template<typename T> template<typename T>
struct dimension: public Dynamic { //struct dimension: public Dynamic {
struct dimension : public boost::integral_constant<int, 1> { // just temporary fix to minimize compiler errors while refactoring
}; };
/** /**

View File

@ -41,7 +41,7 @@ template<typename T>
struct dimension; struct dimension;
} }
template <typename T> struct traits_x { template <typename T> struct traits_x {
// todo: remove anything in here ASAP. // TODO: remove anything in here ASAP.
// This is just here during development to avoid compilation // This is just here during development to avoid compilation
// errors while implmenting traits for everything. // errors while implmenting traits for everything.
enum { dimension = traits::dimension<T>::value }; enum { dimension = traits::dimension<T>::value };

View File

@ -195,10 +195,10 @@ inline Matrix numericalDerivative21(Y (*h)(const X1&, const X2&), const X1& x1,
template<class Y, class X1, class X2> template<class Y, class X1, class X2>
Matrix numericalDerivative22(boost::function<Y(const X1&, const X2&)> h, Matrix numericalDerivative22(boost::function<Y(const X1&, const X2&)> h,
const X1& x1, const X2& x2, double delta = 1e-5) { const X1& x1, const X2& x2, double delta = 1e-5) {
BOOST_STATIC_ASSERT_MSG(traits::is_manifold<Y>::value, BOOST_STATIC_ASSERT_MSG( (boost::is_base_of<gtsam::manifold_tag, typename traits_x<X1>::structure_category>::value),
"Template argument Y must be a manifold type."); "Template argument X1 must be a manifold type.");
BOOST_STATIC_ASSERT_MSG(traits::is_manifold<X2>::value, BOOST_STATIC_ASSERT_MSG( (boost::is_base_of<gtsam::manifold_tag, typename traits_x<X2>::structure_category>::value),
"Template argument X2 must be a manifold type."); "Template argument X2 must be a manifold type.");
return numericalDerivative11<Y, X2>(boost::bind(h, x1, _1), x2, delta); return numericalDerivative11<Y, X2>(boost::bind(h, x1, _1), x2, delta);
} }