Commit b9a0d52c authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Reimplement convex combination such that it works for vectors of all nesting structures

parent 221ccb51
Pipeline #4839 failed with stage
in 27 seconds
......@@ -49,10 +49,9 @@ void testConvexity(const Functional& functional,
for (double t : {0.0, 0.2, 0.4, 0.6, 0.8, 1.0})
{
// convex combination between the two test points
typename Functional::VectorType p(p0.size());
for (size_t k=0; k<p0.size(); k++)
for (size_t l=0; l<p0[k].size(); l++)
p[k][l] = (1-t)*p0[k][l] + t*p1[k][l];
auto p = p0;
p *= (1-t);
p.axpy(t,p1);
// Test for convexity
if (functional(p) > ((1-t)*v0 + t*v1) + 1e-10)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment