Error in linalg.inv ??

Robert Kern robert.kern at
Sun Jun 7 01:23:56 CEST 2009

On 2009-06-06 18:08, Carl Banks wrote:
> On Jun 6, 3:31 pm, Robert Kern<robert.k... at>  wrote:
>> On 2009-06-06 17:09, John Machin wrote:
>>> Robert Kern<robert.kern<at>>    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
>>> ( 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.

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