Trying to make everything compile for a smooth transition
parent
02ceb1366b
commit
d383b44cc6
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
template <typename T> struct traits_x {};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Algebraic Structure Tags
|
* @name Algebraic Structure Tags
|
||||||
|
|
@ -35,6 +35,19 @@ struct vector_space_tag: public lie_group_tag {};
|
||||||
struct multiplicative_group_tag {};
|
struct multiplicative_group_tag {};
|
||||||
struct additive_group_tag {};
|
struct additive_group_tag {};
|
||||||
|
|
||||||
|
// TODO: Remove
|
||||||
|
namespace traits {
|
||||||
|
template<typename T>
|
||||||
|
struct dimension;
|
||||||
|
}
|
||||||
|
template <typename T> struct traits_x {
|
||||||
|
// todo: remove anything in here ASAP.
|
||||||
|
// This is just here during development to avoid compilation
|
||||||
|
// errors while implmenting traits for everything.
|
||||||
|
enum { dimension = traits::dimension<T>::value };
|
||||||
|
typedef manifold_tag structure_category;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <gtsam/base/concepts.h>
|
||||||
#include <gtsam/base/Matrix.h>
|
#include <gtsam/base/Matrix.h>
|
||||||
#include <gtsam/base/Manifold.h>
|
#include <gtsam/base/Manifold.h>
|
||||||
#include <gtsam/linear/VectorValues.h>
|
#include <gtsam/linear/VectorValues.h>
|
||||||
|
|
@ -110,12 +111,12 @@ Matrix numericalDerivative11(boost::function<Y(const X&)> h, const X& x,
|
||||||
double delta = 1e-5) {
|
double delta = 1e-5) {
|
||||||
using namespace traits;
|
using namespace traits;
|
||||||
|
|
||||||
BOOST_STATIC_ASSERT_MSG(traits::is_manifold<Y>::value,
|
BOOST_STATIC_ASSERT_MSG( (typename boost::is_same< typename traits_x<X>::structure_category, gtsam::manifold_tag>::value),
|
||||||
"Template argument Y must be a manifold type.");
|
"Template argument Y must be a manifold type.");
|
||||||
typedef DefaultChart<Y> ChartY;
|
typedef DefaultChart<Y> ChartY;
|
||||||
typedef typename ChartY::vector TangentY;
|
typedef typename ChartY::vector TangentY;
|
||||||
|
|
||||||
BOOST_STATIC_ASSERT_MSG(traits::is_manifold<X>::value,
|
BOOST_STATIC_ASSERT_MSG( (typename boost::is_same<traits_x<X>::structure_category, gtsam::manifold_tag>::value),
|
||||||
"Template argument X must be a manifold type.");
|
"Template argument X must be a manifold type.");
|
||||||
static const int N = traits::dimension<X>::value;
|
static const int N = traits::dimension<X>::value;
|
||||||
BOOST_STATIC_ASSERT_MSG(N>0, "Template argument X must be fixed-size type.");
|
BOOST_STATIC_ASSERT_MSG(N>0, "Template argument X must be fixed-size type.");
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include <gtsam_unstable/nonlinear/CallRecord.h>
|
#include <gtsam_unstable/nonlinear/CallRecord.h>
|
||||||
#include <gtsam/nonlinear/Values.h>
|
#include <gtsam/nonlinear/Values.h>
|
||||||
|
#include <gtsam/base/concepts.h>
|
||||||
#include <gtsam/base/Testable.h>
|
#include <gtsam/base/Testable.h>
|
||||||
#include <gtsam/base/Manifold.h>
|
#include <gtsam/base/Manifold.h>
|
||||||
#include <gtsam/base/OptionalJacobian.h>
|
#include <gtsam/base/OptionalJacobian.h>
|
||||||
|
|
@ -143,7 +144,7 @@ void handleLeafCase(const Eigen::MatrixBase<Derived>& dTdA,
|
||||||
*/
|
*/
|
||||||
template<class T>
|
template<class T>
|
||||||
class ExecutionTrace {
|
class ExecutionTrace {
|
||||||
static const int Dim = traits::dimension<T>::value;
|
static const int Dim = traits_x<T>::dimension;
|
||||||
enum {
|
enum {
|
||||||
Constant, Leaf, Function
|
Constant, Leaf, Function
|
||||||
} kind;
|
} kind;
|
||||||
|
|
@ -624,7 +625,7 @@ struct FunctionalNode {
|
||||||
/// Provide convenience access to Record storage and implement
|
/// Provide convenience access to Record storage and implement
|
||||||
/// the virtual function based interface of CallRecord using the CallRecordImplementor
|
/// the virtual function based interface of CallRecord using the CallRecordImplementor
|
||||||
struct Record: public internal::CallRecordImplementor<Record,
|
struct Record: public internal::CallRecordImplementor<Record,
|
||||||
traits::dimension<T>::value>, public Base::Record {
|
traits_x<T>::dimension>, public Base::Record {
|
||||||
using Base::Record::print;
|
using Base::Record::print;
|
||||||
using Base::Record::startReverseAD4;
|
using Base::Record::startReverseAD4;
|
||||||
using Base::Record::reverseAD4;
|
using Base::Record::reverseAD4;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue