Skip to content
Snippets Groups Projects
Commit d571f39d authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

A_ -> A, b_ -> b

parent 09133b90
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment