# HG changeset patch # User michelemartone # Date 1432024741 0 # Node ID a32bd500938b04112a4d6cb749540249b9c8bdca # Parent 224e57d04d019eba6236060187604a8deeaa153d relaxed pcr/pcg testing by introducing a tolerance. this does not mean that the tester is well made! diff -r 224e57d04d01 -r a32bd500938b main/sparsersb/inst/sparsersbtester.m --- a/main/sparsersb/inst/sparsersbtester.m Tue May 19 07:54:43 2015 +0000 +++ b/main/sparsersb/inst/sparsersbtester.m Tue May 19 08:39:01 2015 +0000 @@ -176,6 +176,7 @@ function match=testpcgm(OM,XM) # FIXME! This test ignores OM and XM ! match=1; + tol=1e-10; A=sparse ([11,12;21,23]);X=[11;22];B=A*X;X=[0;0]; [OX, OFLAG, ORELRES, OITER, ORESVEC, OEIGEST]=pcg(A,B); A=sparsersb([11,12;21,23]);X=[11;22];B=A*X;X=[0;0]; @@ -193,14 +194,14 @@ [l, u, p, q] = luinc (A, 1.e-3); [OX, OFLAG, ORELRES, OITER, ORESVEC, OEIGEST]= pcg ( A ,b); [XX, XFLAG, XRELRES, XITER, XRESVEC, XEIGEST]= pcg (sparsersb(A),b); - match&=(sum(OX-XX)==0.0);# FIXME: a very brittle check! + match&=(norm(OX-XX)