thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

Inverse of a singular matrix -Bug (Trac #2192) #5982

Closed numpy-gitbot closed 11 years ago

numpy-gitbot commented 11 years ago

Original ticket http://projects.scipy.org/numpy/ticket/2192 on 2012-07-25 by trac user Amit001, assigned to atmention:pv.

Hi,

Numpy is not handling singular matrices properly.

numpy.version '1.6.1'

for eg. Numpy is giving the inverse of the below singular matrix.

a = array([[ 1, 2, 3], [ 5, 7, 9], [ 6, 9, 12]])

det(a) -5.3290705182007443e-015 rank(a) 2 inv(a) array([[ -5.62949953e+14, -5.62949953e+14, 5.62949953e+14], [ 1.12589991e+15, 1.12589991e+15, -1.12589991e+15], [ -5.62949953e+14, -5.62949953e+14, 5.62949953e+14]])

numpy-gitbot commented 11 years ago

atmention:pv wrote on 2012-08-01

This is a floating point issue, common to all numerical computation libraries. In floating point, it is in general not possible to detect whether a matrix is exactly singular due to rounding error.