numeric icon indicating copy to clipboard operation
numeric copied to clipboard

Bug in 'numeric.inv()'

Open tomaszsm opened this issue 12 years ago • 4 comments

Computing "numeric.inv([[8,9,8,9], [5,6,5,6], [8,9,8,9], [5,6,5,6]]);" results in an error: "TypeError: Aj is undefined"

tomaszsm avatar Jan 31 '13 20:01 tomaszsm

This matrix is not invertible; it seems to work when the matrix is invertible. Nevertheless, I will change this behavior.

sloisel avatar Jan 31 '13 23:01 sloisel

what about calculating the pseudo inverse?

RONNCC avatar Feb 12 '13 05:02 RONNCC

>>> import numpy.linalg
l
>>> numpy.linalg.pinv([[8,9,8,9], [5,6,5,6], [8,9,8,9], [5,6,5,6]])
array([[ 0.5       , -0.75      ,  0.5       , -0.75      ],
       [-0.41666667,  0.66666667, -0.41666667,  0.66666667],
       [ 0.5       , -0.75      ,  0.5       , -0.75      ],
       [-0.41666667,  0.66666667, -0.41666667,  0.66666667]])
>>> 

RONNCC avatar Feb 12 '13 05:02 RONNCC

Try this: http://www.numericjs.com/workshop.php?link=b923cdeb84e188a11b44e3e82e44897b3b7da1d6640ddb46ab7330a6625f8e19

sloisel avatar Feb 12 '13 23:02 sloisel