Skip to content
Snippets Groups Projects
Commit dc329fb5 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Add rebinding to another field type, and assignment with operator <<=

This is needed to use the ADOL-C automatic differentiation library.

[[Imported from SVN: r9398]]
parent 12b4dd72
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,21 @@ public:
return *this;
}
/** \brief Assigment from RealTuple with different type -- used for automatic differentiation with ADOL-C */
template <class T2>
RealTuple& operator <<= (const RealTuple<T2,N>& other) {
for (size_t i=0; i<N; i++)
data_[i] <<= other.data_[i];
return *this;
}
/** \brief Rebind the RealTuple to another coordinate type */
template<class U>
struct rebind
{
typedef RealTuple<U,N> other;
};
/** \brief The exponention map */
static RealTuple exp(const RealTuple& p, const TangentVector& v) {
return RealTuple(p.data_+v);
......
......@@ -55,6 +55,22 @@ public:
q.normalize();
}
/** \brief Assigment from RigidBodyMotion with different type -- used for automatic differentiation with ADOL-C */
template <class T2>
RigidBodyMotion& operator <<= (const RigidBodyMotion<T2,N>& other) {
for (int i=0; i<N; i++)
r[i] <<= other.r[i];
q <<= other.q;
return *this;
}
/** \brief Rebind the RigidBodyMotion to another coordinate type */
template<class U>
struct rebind
{
typedef RigidBodyMotion<U,N> other;
};
/** \brief The exponential map from a given point $p \in SE(d)$.
Why the template parameter? Well, it should work with both TangentVector and EmbeddedTangentVector.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment