+#include <limits>
#include <msp/linal/matrix.h>
#include <msp/linal/squarematrix.h>
#include <msp/test/test.h>
+using namespace std;
using namespace Msp;
class MatrixTests: public Test::RegisteredTest<MatrixTests>
template<typename T, unsigned N>
bool is_identity(const LinAl::Matrix<T, N, N> &m)
{
+ static const T limit = numeric_limits<T>::epsilon()*4;
for(unsigned i=0; i<N; ++i)
for(unsigned j=0; j<N; ++j)
- if(abs(T(i==j)-m(i, j))>1e-10)
+ if(abs(T(i==j)-m(i, j))>limit)
return false;
return true;
}