From 7418ec6c4c6fc0a6456214cee59e79859cb05a70 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Fri, 16 Sep 2011 23:42:23 +0200 Subject: [PATCH] Make phi visible to the outside --- src/samplefunctional.hh | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/samplefunctional.hh b/src/samplefunctional.hh index dd7c4b82..4186838c 100644 --- a/src/samplefunctional.hh +++ b/src/samplefunctional.hh @@ -26,10 +26,10 @@ class SampleFunctional { double operator()(const SmallVector v) const { SmallVector y; - A.mv(v, y); // y = Av - y /= 2; // y = 1/2 Av - y -= b; // y = 1/2 Av - b - return y * v + phi_(v); // <1/2 Av - b,v> + H(|v|) + A.mv(v, y); // y = Av + y /= 2; // y = 1/2 Av + y -= b; // y = 1/2 Av - b + return y * v + phi(v); // <1/2 Av - b,v> + H(|v|) } void descentDirection(const SmallVector x, SmallVector &ret) const { @@ -38,7 +38,7 @@ class SampleFunctional { SmallVector const d = smoothGradient(x); Interval<double> D; - phi_.directionalSubDiff(x, d, D); + phi.directionalSubDiff(x, d, D); double const nonlinearDecline = D[1]; double const smoothDecline = -(d * d); double const combinedDecline = smoothDecline + nonlinearDecline; @@ -82,10 +82,9 @@ class SampleFunctional { SmallMatrix A; SmallVector b; + NonlinearityType phi; private: - NonlinearityType phi_; - // Gradient of the smooth part SmallVector smoothGradient(const SmallVector x) const { SmallVector y; @@ -96,14 +95,14 @@ class SampleFunctional { SmallVector upperGradient(const SmallVector x) const { SmallVector y; - phi_.upperGradient(x, y); + phi.upperGradient(x, y); y += smoothGradient(x); return y; } SmallVector lowerGradient(const SmallVector x) const { SmallVector y; - phi_.lowerGradient(x, y); + phi.lowerGradient(x, y); y += smoothGradient(x); return y; } -- GitLab