octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53258] test pcg.m fail


From: Rik
Subject: [Octave-bug-tracker] [bug #53258] test pcg.m fail
Date: Thu, 8 Mar 2018 07:53:42 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #10, bug #53258 (project octave):

I like Carlo's and Cristiano's idea to take this up at OctConf 2018.

I did make a lot of changes, but the big one that was necessary to resolve
this report was to change what the BIST tests were looking for.  See the small
diff below


 %! ## solve small diagonal system
 %!
 %! N = 10;
-%! A = diag ([1:N]); b = rand (N, 1);
-%! X = A \ b;  # X is the true solution
-%! [x, flag] = pcg (A, b, [], N+1);
-%! assert (norm (x - X) / norm (X), 0, 1e-10);
+%! A = diag ([1:N]);
+%! b = rand (N, 1);
+%! [x, flag] = pcg (A, b, [], 2*N);
+%! assert (norm (A*x - b) / norm (b), 0, 1e-6);


In the original, the relative error in the solution X is checked.  But the pcg
algorithm doesn't guarantee any such results so there were occasional failures
in the BIST tests.

In the modified version, I look at the residuals (Ax - b) normalized by the
magnitude of b [/ norm (b)].  This is the stopping criteria used by pcg itself
so as long as flag==0 the tolerance of 1e-6 will have been met.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53258>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]