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

Make phi visible to the outside

parent 2b2fd146
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment