From d34bae65efaaf6231c222c048de2a32f09a306b6 Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 10 Feb 2010 21:54:34 +0000
Subject: [PATCH] implement the exponential map.  Use a FieldVector to store
 the data instead of Dune::array

[[Imported from SVN: r5532]]
---
 src/realtuple.hh | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/realtuple.hh b/src/realtuple.hh
index f4368b1d..071c1372 100644
--- a/src/realtuple.hh
+++ b/src/realtuple.hh
@@ -26,17 +26,19 @@ public:
     /** \brief Construction from a scalar */
     RealTuple(double v)
     {
-        data_.assign(v);
+        data_ = v;
+    }
+
+    /** \brief The exponention map */
+    static RealTuple exp(const RealTuple& p, const TangentVector& v) {
+        return RealTuple(p.data_+v);
     }
 
     /** \brief Geodesic distance between two points 
 
     Simply the Euclidean distance */
     static double distance(const RealTuple& a, const RealTuple& b) {
-        double result = 0;
-        for (int i=0; i<N; i++)
-            result += (a.data_[0] - b.data_[0]) * (a.data_[0] - b.data_[0]);
-        return std::sqrt(result);
+        return (a.data_ - b.data_).two_norm();
     }
 
     
@@ -48,7 +50,7 @@ public:
 
 private:
     
-    Dune::array<double,N> data_;
+    Dune::FieldVector<double,N> data_;
 
 };
 
-- 
GitLab