From c4a27bc96f6b2c8c3090942506495f69399bde70 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 3 Sep 2013 16:30:11 +0000 Subject: [PATCH] add methods 'rebind' and 'operator<<= [[Imported from SVN: r9424]] --- dune/gfe/rotation.hh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dune/gfe/rotation.hh b/dune/gfe/rotation.hh index 5d8cd68a..e0ac46af 100644 --- a/dune/gfe/rotation.hh +++ b/dune/gfe/rotation.hh @@ -198,6 +198,21 @@ public: (*this)[3] = std::cos(angle/2); } + /** \brief Rebind the Rotation to another coordinate type */ + template<class U> + struct rebind + { + typedef Rotation<U,3> other; + }; + + /** \brief Assigment from RigidBodyMotion with different type -- used for automatic differentiation with ADOL-C */ + template <class T2> + Rotation& operator <<= (const Rotation<T2,3>& other) { + for (int i=0; i<4; i++) + (*this)[i] <<= other[i]; + return *this; + } + /** \brief Return the identity element */ static Rotation<T,3> identity() { // Default constructor creates an identity -- GitLab