Error in linalg.inv ??

Robert Kern robert.kern at gmail.com
Sat Jun 6 19:23:56 EDT 2009


On 2009-06-06 18:08, Carl Banks wrote:
> On Jun 6, 3:31 pm, Robert Kern<robert.k... at gmail.com>  wrote:
>> On 2009-06-06 17:09, John Machin wrote:
>>> Robert Kern<robert.kern<at>    gmail.com>    writes:
>>>> You have a very singular matrix (2*a[1] - a[0] == a[2]). You cannot invert it
>>>> numerically and expect sensible results.
>>> Is raising an exception (as documented
>>> (http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.inv....)) not
>>> a "sensible result"?
>> That's not the way I was using the phrase, but you have a point.
>>
>> We depend on the underlying LAPACK routine to tell us if the array is singular
>> or not.
>
> Perhaps the documentation should be updated to say "Raises LinAlgError
> if inv() detects that 'a' a singular matrix".
>
> Anyone with much experience with linear algebra libraries should know
> that these routines are shaky when ill-conditioned, but it could help
> newbies and computer science experts to be explicit about it.

By all means, please do.

http://docs.scipy.org/numpy/Front%20Page/

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the Python-list mailing list