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

Use addProduct() in place of .mmv()

parent b508d875
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
v /= vnorm; // Rescale for numerical stability
VectorType tmp = problem.f;
problem.A.mmv(u, tmp);
Arithmetic::addProduct(tmp, -1.0, problem.A, u);
double const localb = tmp * v;
problem.A.mv(v, tmp);
......@@ -187,9 +187,9 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
// b should be a descent direction
{
VectorType const direction = linearization.b;
VectorType tmp = linearization.b; // b
linearization.A.mmv(u, tmp); // b-Au
double const localA = tmp * direction; // <b-Au,v>
VectorType tmp = linearization.b; // b
Arithmetic::addProduct(tmp, -1.0, linearization.A, u); // b-Au
double const localA = tmp * direction; // <b-Au,v>
linearization.A.mv(direction, tmp); // Av
double const localb = tmp * direction; // <Av,v>
......@@ -316,7 +316,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
if (j == m)
localA = &(*it); // localA = A[m][m]
else
it->mmv(u[j], localb); // localb -= A[m][j] * u[j]
Arithmetic::addProduct(localb, -1.0, *it, u[j]); // b-Au
}
assert(localA != nullptr);
......
......@@ -33,7 +33,7 @@ void ImplicitEuler<VectorType, MatrixType, FunctionType, dim>::setup(
tau = _tau;
problem_rhs = ell;
A.mmv(u_old, problem_rhs);
Arithmetic::addProduct(problem_rhs, -1.0, A, u_old);
// For fixed tau, we'd only really have to do this once
problem_A = A;
......
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