-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Closed
Description
Hi,
Here is an example of inv that doesn't throw an error when dealing with singular matrix and return wrong results.
import numpy as np
import scipy as si
A=np.array([[1,2,3],[4,5,6],[7,8,9]])
b=np.array([15,15,15])
print np.dot(np.linalg.inv(A),b)
array([-32., 48., -24.] ## wrong result
np.linalg.solve(A,b) # the result of np.dot(np.linalg.inv(A),b) should be same as this.
array([-39., 63., -24.]) # correct result
It is necessary to say that scipy throws an error though.
np.dot(si.linalg.inv(A),b)
My numpy version is '1.9.2' and python 2.7.6.
schneiderfelipe
Metadata
Metadata
Assignees
Labels
No labels