Make error checks more reliable and void == with doubles.
{
if (i % (dim*dim*dim) == 0)
deallog << i << ' ' << p1->value() << std::endl;
- AssertThrow (p1->value() == p2->value(),
+ AssertThrow (std::abs(p1->value() - p2->value())<1e-15,
ExcInternalError());
- AssertThrow (p1->value() == p3->value(),
+ AssertThrow (std::abs(p1->value() - p3->value())<1e-15,
ExcInternalError());
};
}
w(4) = 3e-303;
w(5) = -1e-303;
const double correct4 = std::sqrt(100. + 1. + 4. + 9 + 1.) * 1e-303;
- AssertThrow (std::abs(w.l2_norm() - correct4) < 1e-13*correct4, ExcInternalError());
+ AssertThrow (std::abs(w.l2_norm() - correct4) <= 1e-13*correct4, ExcInternalError());
const double correct5 = std::pow(1000. + 1. + 8. + 27 + 1., 1./3.) * 1e-303;
- AssertThrow (std::abs(w.lp_norm(3.) - correct5) < 1e-13*correct5, ExcInternalError());
+ AssertThrow (std::abs(w.lp_norm(3.) - correct5) <= 1e-13*correct5, ExcInternalError());
deallog << "OK" << std::endl;
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams