diff --git a/src/bisection-example-new.cc b/src/bisection-example-new.cc index 28540f2d046684f14945964b32ab2f30f90c9d8f..fffe690031efc0e01ae76060b31bbdb4a0a683b2 100644 --- a/src/bisection-example-new.cc +++ b/src/bisection-example-new.cc @@ -20,13 +20,13 @@ class SampleFunctional { typedef Dune::FieldMatrix<double, dimension, dimension> SmallMatrix; typedef Function FunctionType; - SampleFunctional(SmallMatrix A, SmallVector b) : A_(A), b_(b), func_() {} + SampleFunctional(SmallMatrix _A, SmallVector _b) : A(_A), b(_b), func_() {} double operator()(const SmallVector v) const { SmallVector y; - A_.mv(v, y); // y = Av + A.mv(v, y); // y = Av y /= 2; // y = 1/2 Av - y -= b_; // y = 1/2 Av - b + y -= b; // y = 1/2 Av - b return y * v + func_(v.two_norm()); // <1/2 Av - b,v> + H(|v|) } @@ -60,8 +60,8 @@ class SampleFunctional { return ret; } - SmallMatrix A_; - SmallVector b_; + SmallMatrix A; + SmallVector b; private: Function func_; @@ -69,8 +69,8 @@ class SampleFunctional { // Gradient of the smooth part SmallVector SmoothGrad(const SmallVector x) const { SmallVector y; - A_.mv(x, y); // y = Av - y -= b_; // y = Av - b + A.mv(x, y); // y = Av + y -= b; // y = Av - b return y; } @@ -112,11 +112,11 @@ typename Functional::SmallVector minimise( */ typename Functional::SmallVector tmp; - J.A_.mv(descDir, tmp); // Av + J.A.mv(descDir, tmp); // Av double const rest_A = tmp * descDir; // <Av,v> - J.A_.mv(x, tmp); // Au - double const rest_b = (J.b_ - tmp) * descDir; // <b-Au,v> + J.A.mv(x, tmp); // Au + double const rest_b = (J.b - tmp) * descDir; // <b-Au,v> typedef MyNonlinearity<Functional::SmallVector::dimension, typename Functional::FunctionType> MyNonlinearityType;