From df92b93231acf3464e7ebfbbab657515b559aedf Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@math.fu-berlin.de>
Date: Tue, 10 Feb 2015 13:21:54 +0100
Subject: [PATCH] Properly setup the shared_ptr member

---
 dune/solvers/iterationsteps/projectedgradientstep.hh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dune/solvers/iterationsteps/projectedgradientstep.hh b/dune/solvers/iterationsteps/projectedgradientstep.hh
index 24757b26..1d80800b 100644
--- a/dune/solvers/iterationsteps/projectedgradientstep.hh
+++ b/dune/solvers/iterationsteps/projectedgradientstep.hh
@@ -34,8 +34,10 @@ public:
 
     //! Constructor that gets the quadratic energy functional x^T mat x - rhs^T*x, and the initial iterate
     ProjectedGradientStep(const MatrixType& mat, VectorType& x, const VectorType& rhs)
-        : Base(x), mat_(mat), rhs_(rhs)
-    {}
+        : Base(x), rhs_(&rhs)
+    {
+        mat_     = Dune::stackobject_to_shared_ptr(mat);
+    }
 
     /** \brief Compute the generalized Cauchy point along a given direction. This is sometimes needed in
      *         nonlinear programming where this direction then corresponds to the gradient of the nonlinear function
-- 
GitLab