[Top][All Lists]

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

Re: Anyone familiar with polygcd?

From: John W. Eaton
Subject: Re: Anyone familiar with polygcd?
Date: Tue, 05 Aug 2014 13:30:33 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.5.0

On 07/07/2014 01:57 PM, Rik wrote:

I'm getting occasional failures from the test code in polygcd.  It seems to
happen about 10% of the time according to the following code:

for i = 1:100
   bm(i) = test ("polygcd");
sum (bm)

The test that fails is

%! for ii=1:10
%!   p  = (unique (randn (10, 1)) * 10).';
%!   p1 = p(3:end);
%!   p2 = p(1:end-2);
%!   assert (polygcd (poly (-p1), poly (-p2)), poly (- intersect (p1, p2)),
sqrt (eps));
%! endfor

I tried a few different random seeds to see if I could fix the value to
something that would always pass, but no luck.

The simplest thing is to make this an %!xtest which can occasionally fail.
But if someone understands polygcd and could suggest a way to modify the
test that would be preferable.

The error I get is a dimensional mismatch:

!!!!! test failed
ASSERT errors for:  assert (polygcd (poly (-p1), poly (-p2)),poly
(-intersect (p1, p2)),sqrt (eps))

   Location  |  Observed  |  Expected  |  Reason
      .          O(1x1)       E(1x7)      Dimensions don't match

I started noticing this too.

Should we try to eliminate random values from the test suite? It seems bad to me to use random values in tests which could fail due to extreme values.

OTOH, this test failure may indicate that the algorithm used for polygcd is not as good as it should be.


reply via email to

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