octave-maintainers
[Top][All Lists]
Advanced

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

Re: sqrtm test failure


From: Jordi Gutiérrez Hermoso
Subject: Re: sqrtm test failure
Date: Thu, 4 Aug 2011 00:43:12 -0500

2011/7/31 Jordi Gutiérrez Hermoso <address@hidden>:

> Since the Jordan form is numerically unstable, I don't think that a
> numerical algorithm can reliably determine if a matrix has a square
> root; the warning is best possible. Perhaps simply change the test to
>
>     j = [0 1; 0 0];
>     s = sqrtm(x);
>     assert( s^2 != j)
>
> ?

I've opted for this test instead:

     assert (any (isnan (sqrtm (x))(:) ))

here:

     http://hg.savannah.gnu.org/hgweb/octave/rev/d6209c354667

Thanks,
- Jordi G. H.


reply via email to

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