From 2e77a3c400bc771ab8c53ab8c7e21faf1c4f793f Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 30 Apr 2003 18:34:36 +0000 Subject: [PATCH] Be slightly more forgiving. git-svn-id: https://svn.dealii.org/trunk@7515 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/polynomial_test.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/base/polynomial_test.cc b/tests/base/polynomial_test.cc index cba2d1c3c1..c9a16ef9ed 100644 --- a/tests/base/polynomial_test.cc +++ b/tests/base/polynomial_test.cc @@ -48,20 +48,24 @@ void check_poly(const Point& x, // Check if compute_value is ok double val = p.compute_value(k,x); - //if (val != values[k]) - if (fabs(val - values[k]) > 5.0E-16) + if (fabs(val - values[k]) > 5.0E-15) deallog << 'P' << k << ": values differ " << val << " != " << values[k] << std::endl; // Check if compute_grad is ok Tensor<1,dim> grad = p.compute_grad(k,x); - if (grad != gradients[k]) + if ((grad-gradients[k]) * (grad-gradients[k]) > 5e-15*5e-15) deallog << 'P' << k << ": gradients differ " << grad << " != " << gradients[k] << std::endl; // Check if compute_grad_grad is ok Tensor<2,dim> grad2 = p.compute_grad_grad(k,x); - if (grad2 != second[k]) + Tensor<2,dim> diff = grad2-second[k]; + double s = 0; + for (unsigned int i=0; i 5e-15*5e-15) deallog << 'P' << k << ": second derivatives differ " << grad2 << " != " << second[k] << std::endl; -- 2.39.5