From: Mikko Rasa Date: Sun, 2 Jun 2019 11:39:58 +0000 (+0300) Subject: Use numeric_limits in Matrix test cases X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=157764dbef39bf2f516fe98ef5f8efcbf2d3782a;p=libs%2Fmath.git Use numeric_limits in Matrix test cases --- diff --git a/tests/matrix.cpp b/tests/matrix.cpp index 5b303db..1b01cbc 100644 --- a/tests/matrix.cpp +++ b/tests/matrix.cpp @@ -1,7 +1,9 @@ +#include #include #include #include +using namespace std; using namespace Msp; class MatrixTests: public Test::RegisteredTest @@ -42,9 +44,10 @@ void MatrixTests::multiply() template bool is_identity(const LinAl::Matrix &m) { + static const T limit = numeric_limits::epsilon()*4; for(unsigned i=0; i1e-10) + if(abs(T(i==j)-m(i, j))>limit) return false; return true; }