From 1f049a11b84a125605b93b7a660bff5ae6b54006 Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Mon, 17 Oct 2011 14:49:33 +0000 Subject: [PATCH] Trade brevity for clarity [[Imported from SVN: r4607]] --- dune/fufem/symmetrictensor.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dune/fufem/symmetrictensor.hh b/dune/fufem/symmetrictensor.hh index bdc0bb0f..d8775453 100644 --- a/dune/fufem/symmetrictensor.hh +++ b/dune/fufem/symmetrictensor.hh @@ -54,7 +54,7 @@ public: { double r = 0.0; for (int i = 0; i < dim*(dim+1)/2; ++i) - r += (1+(i>=dim))*(*this)[i]*B[i]; // this weird looking coefficient is used to produce the 2 as coefficient before the off-diagonal entries which occur twice in the full (symmetric) matrix + r += (i>=dim ? 2 : 1)*(*this)[i]*B[i]; return r; } -- GitLab