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

Kill temporary variable

parent be30a325
Branches
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ template <class NonlinearityType> class MyDirectionalConvexFunction {
MyDirectionalConvexFunction(double A, double b, NonlinearityType const &phi,
VectorType const &u, VectorType const &v)
: A(A), b(b), phi_(phi), u_(u), v_(v), temp_u_(u) {
: A(A), b(b), phi_(phi), u_(u), v_(v) {
phi_.directionalDomain(u_, v_, dom_);
}
......@@ -21,9 +21,9 @@ template <class NonlinearityType> class MyDirectionalConvexFunction {
double linearPart() const { return b; }
void subDiff(double x, Interval<double> &D) const {
temp_u_ = u_;
temp_u_.axpy(x, v_);
phi_.directionalSubDiff(temp_u_, v_, D);
VectorType tmp = u_;
tmp.axpy(x, v_);
phi_.directionalSubDiff(tmp, v_, D);
D[0] += A * x - b;
D[1] += A * x - b;
}
......@@ -41,7 +41,6 @@ template <class NonlinearityType> class MyDirectionalConvexFunction {
VectorType const &u_;
VectorType const &v_;
VectorType mutable temp_u_;
Interval<double> dom_;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment