diff --git a/dune/gfe/realtuple.hh b/dune/gfe/realtuple.hh index 200fe06098ac0ced6a7770447dc80b896e8bd8f9..a67b71d53bfb6245b230ad5082c09527b5f090e9 100644 --- a/dune/gfe/realtuple.hh +++ b/dune/gfe/realtuple.hh @@ -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); diff --git a/dune/gfe/rigidbodymotion.hh b/dune/gfe/rigidbodymotion.hh index 85fbb7ba64313efe35467938737b3de37a5558f2..e51f6e4969c205a0b9307c854caa14905bc6f593 100644 --- a/dune/gfe/rigidbodymotion.hh +++ b/dune/gfe/rigidbodymotion.hh @@ -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.