Error in linalg.inv ??
pavlovevidence at gmail.com
Sun Jun 7 01:08:52 CEST 2009
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 - a == a). 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.
More information about the Python-list