LU test: use assert_checkalmostequal for numerical checks 73/18773/2
Clément DAVID [Thu, 8 Dec 2016 10:06:37 +0000 (11:06 +0100)]
Change-Id: I7a8af80638e7714cfcff5aae066d4f2bae584174

scilab/modules/core/tests/unit_tests/LU.dia.ref
scilab/modules/core/tests/unit_tests/LU.tst

index 8d1db63..e18c169 100644 (file)
@@ -38,11 +38,11 @@ assert_checktrue(abs(l*u-a)< 100*%eps);
 assert_checktrue(abs(l*u-ac)< 100*%eps);
 //
 h1(5,5)=0;for k=1:5,for l=1:5, h1(k,l)=1/(k+l-1);end;end;
-assert_checktrue(abs(inv(h1)-testmatrix('hilb',5))< 1.e-7);
+assert_checkalmostequal(inv(h1),testmatrix("hilb",5));
 //
-assert_checktrue(abs(det(testmatrix('magic',5))-5070000)< 1.e-7);
+assert_checktrue(abs(det(testmatrix("magic",5))-5070000)< 1.e-7);
 //
 b=a*a';h=chol(b);
-assert_checktrue(abs(h'*h-b)< 100*%eps);
+assert_checkalmostequal(h'*h, b, [], 100*%eps);
 bc=triu(ac*ac');bc=bc+bc'-diag(real(diag(bc)));;h=chol(bc);
-assert_checktrue(abs(h'*h-bc)< 100*%eps);
+assert_checkalmostequal(h'*h, bc, [], 100*%eps);
index c06bd17..adf9beb 100644 (file)
@@ -40,11 +40,11 @@ assert_checktrue(abs(l*u-a)< 100*%eps);
 assert_checktrue(abs(l*u-ac)< 100*%eps);
 //
 h1(5,5)=0;for k=1:5,for l=1:5, h1(k,l)=1/(k+l-1);end;end;
-assert_checktrue(abs(inv(h1)-testmatrix('hilb',5))< 1.e-7);
+assert_checkalmostequal(inv(h1),testmatrix("hilb",5));
 //
-assert_checktrue(abs(det(testmatrix('magic',5))-5070000)< 1.e-7);
+assert_checktrue(abs(det(testmatrix("magic",5))-5070000)< 1.e-7);
 //
 b=a*a';h=chol(b);
-assert_checktrue(abs(h'*h-b)< 100*%eps);
+assert_checkalmostequal(h'*h, b, [], 100*%eps);
 bc=triu(ac*ac');bc=bc+bc'-diag(real(diag(bc)));;h=chol(bc);
-assert_checktrue(abs(h'*h-bc)< 100*%eps);
+assert_checkalmostequal(h'*h, bc, [], 100*%eps);