Commit c560f604 authored by Davis King's avatar Davis King

made tests a little more robust

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403981
parent c2109883
...@@ -377,15 +377,15 @@ namespace ...@@ -377,15 +377,15 @@ namespace
DLIB_TEST_MSG(max(abs(dm7*inv(dm7) - identity_matrix<double>(7))) < 1e-12, max(abs(dm7*inv(dm7) - identity_matrix<double>(7)))); DLIB_TEST_MSG(max(abs(dm7*inv(dm7) - identity_matrix<double>(7))) < 1e-12, max(abs(dm7*inv(dm7) - identity_matrix<double>(7))));
DLIB_TEST(equal(inv(dm7), inv(m7))); DLIB_TEST(equal(inv(dm7), inv(m7)));
DLIB_TEST(det(dm7) == det(m7)); DLIB_TEST(abs(det(dm7) - det(m7) < 1e-14));
DLIB_TEST(min(dm7) == min(m7)); DLIB_TEST(abs(min(dm7) - min(m7) < 1e-14));
DLIB_TEST(max(dm7) == max(m7)); DLIB_TEST(abs(max(dm7) - max(m7) < 1e-14));
DLIB_TEST_MSG(abs(sum(dm7) - sum(m7)) < 1e-14,sum(dm7) - sum(m7)); DLIB_TEST_MSG(abs(sum(dm7) - sum(m7)) < 1e-14,sum(dm7) - sum(m7));
DLIB_TEST(prod(dm7) == prod(m7)); DLIB_TEST(abs(prod(dm7) -prod(m7)) < 1e-14);
DLIB_TEST(diag(dm7) == diag(m7)); DLIB_TEST(equal(diag(dm7) , diag(m7)));
DLIB_TEST(trans(dm7) == trans(m7)); DLIB_TEST(equal(trans(dm7) , trans(m7)));
DLIB_TEST(abs(dm7) == abs(m7)); DLIB_TEST(equal(abs(dm7) , abs(m7)));
DLIB_TEST(round(dm7) == round(m7)); DLIB_TEST(equal(round(dm7) , round(m7)));
DLIB_TEST(matrix_cast<int>(dm7) == matrix_cast<int>(m7)); DLIB_TEST(matrix_cast<int>(dm7) == matrix_cast<int>(m7));
DLIB_TEST((rotate<2,3>(dm7) == rotate<2,3>(m7))); DLIB_TEST((rotate<2,3>(dm7) == rotate<2,3>(m7)));
DLIB_TEST((sum(pointwise_multiply(dm7,dm7) - pointwise_multiply(m7,m7))) < 1e-10); DLIB_TEST((sum(pointwise_multiply(dm7,dm7) - pointwise_multiply(m7,m7))) < 1e-10);
......
...@@ -415,10 +415,10 @@ namespace ...@@ -415,10 +415,10 @@ namespace
di = 1, 1/2.0, 1/3.0; di = 1, 1/2.0, 1/3.0;
DLIB_TEST(inv(diagm(d)) == diagm(di)); DLIB_TEST(equal(inv(diagm(d)) , diagm(di)));
DLIB_TEST(inv(diagm(d)) == diagm(di)); DLIB_TEST(equal(inv(diagm(d)) , diagm(di)));
DLIB_TEST(inv(diagm(d))*m == tmp(diagm(di))*m); DLIB_TEST(equal(inv(diagm(d))*m , tmp(diagm(di))*m));
DLIB_TEST(m*inv(diagm(d)) == m*tmp(diagm(di))); DLIB_TEST(equal(m*inv(diagm(d)) , m*tmp(diagm(di))));
DLIB_TEST_MSG(equal(inv(diagm(d)) + m , tmp(diagm(di)) + m), DLIB_TEST_MSG(equal(inv(diagm(d)) + m , tmp(diagm(di)) + m),
(inv(diagm(d)) + m) - (tmp(diagm(di)) + m) ); (inv(diagm(d)) + m) - (tmp(diagm(di)) + m) );
...@@ -484,10 +484,10 @@ namespace ...@@ -484,10 +484,10 @@ namespace
di = 1, 1/2.0, 1/3.0; di = 1, 1/2.0, 1/3.0;
DLIB_TEST(inv(diagm(d)) == diagm(di)); DLIB_TEST(equal(inv(diagm(d)) , diagm(di)));
DLIB_TEST(inv(diagm(d)) == diagm(di)); DLIB_TEST(equal(inv(diagm(d)) , diagm(di)));
DLIB_TEST(inv(diagm(d))*m == tmp(diagm(di))*m); DLIB_TEST(equal(inv(diagm(d))*m , tmp(diagm(di))*m));
DLIB_TEST(m*inv(diagm(d)) == m*tmp(diagm(di))); DLIB_TEST(equal(m*inv(diagm(d)) , m*tmp(diagm(di))));
DLIB_TEST(equal(inv(diagm(d)) + m , tmp(diagm(di)) + m)); DLIB_TEST(equal(inv(diagm(d)) + m , tmp(diagm(di)) + m));
DLIB_TEST(equal(m + inv(diagm(d)) , tmp(diagm(di)) + m)); DLIB_TEST(equal(m + inv(diagm(d)) , tmp(diagm(di)) + m));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment