# HG changeset patch # User Rik # Date 1326138412 28800 # Node ID a7a020cd6106bab66cf52eaaebb06e988b2469bc # Parent 3f2a3076b9a642319294bf5686754e49d0e6b861 Relax tolerance for pinv tests so that it fails less than 1% of the time. pinv.cc (pinv): Relax tolerance for pinv tests so that it fails less than 1% of the time. diff --git a/src/DLD-FUNCTIONS/pinv.cc b/src/DLD-FUNCTIONS/pinv.cc --- a/src/DLD-FUNCTIONS/pinv.cc +++ b/src/DLD-FUNCTIONS/pinv.cc @@ -174,18 +174,19 @@ %!shared a, b, tol, hitol, d, u, x, y %! a = reshape (rand*[1:16], 4, 4); ## Rank 2 matrix %! b = pinv (a); -%! tol = 1e-14; -%! hitol = 15*sqrt(eps); +%! tol = 4e-14; +%! hitol = 40*sqrt (eps); %! d = diag ([rand, rand, hitol, hitol]); %! u = rand (4); ## Could be singular by freak accident %! x = inv (u)*d*u; -%! y = pinv (x, sqrt(eps)); -%!assert(a*b*a, a, tol); -%!assert(b*a*b, b, tol); -%!assert((b*a)', b*a, tol); -%!assert((a*b)', a*b, tol); -%!assert(x*y*x, x, -hitol); -%!assert(y*x*y, y, -hitol); -%!assert((x*y)', x*y, hitol); -%!assert((y*x)', y*x, hitol); +%! y = pinv (x, sqrt (eps)); +%! +%!assert (a*b*a, a, tol) +%!assert (b*a*b, b, tol) +%!assert ((b*a)', b*a, tol) +%!assert ((a*b)', a*b, tol) +%!assert (x*y*x, x, -hitol) +%!assert (y*x*y, y, -hitol) +%!assert ((x*y)', x*y, hitol) +%!assert ((y*x)', y*x, hitol) */