From ae1febf2087556cb923be8ac1718e5cd76293587 Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 4 Nov 2014 14:17:19 +0000 Subject: [PATCH] Introduce the trust region radius as an explicit member variable This is a first step towards having trust-regions with different scaling in the different components. Kinda paradox to introduce an explicit radius in order to move away from a single radius. But I want to pretend to the outside (for the time being) that there is a single radius... [[Imported from SVN: r9950]] --- dune/gfe/maxnormtrustregion.hh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dune/gfe/maxnormtrustregion.hh b/dune/gfe/maxnormtrustregion.hh index d03b81cd..5b1972e2 100644 --- a/dune/gfe/maxnormtrustregion.hh +++ b/dune/gfe/maxnormtrustregion.hh @@ -18,6 +18,8 @@ public: void set(field_type radius) { + radius_ = radius; + for (size_t i=0; i<obstacles_.size(); i++) { for (int k=0; k<blocksize; k++) { @@ -32,13 +34,13 @@ public: } field_type radius() const { - assert(obstacles_.size()>0); - assert(blocksize>0); - return obstacles_[0].upper(0); + return radius_; } void scale(field_type factor) { + radius_ *= factor; + for (size_t i=0; i<obstacles_.size(); i++) { for (int k=0; k<blocksize; k++) { @@ -60,6 +62,8 @@ private: std::vector<BoxConstraint<field_type,blocksize> > obstacles_; + field_type radius_; + }; #endif -- GitLab