numpy/numpy — pull request #2721 by abalkin (2012-11-09 19:30:03+00:00)
Title: Mistake in linalg.eig() documentation

Proposed commit fixes a mistake in the formula currently written as dot(a[i,:], v[i]) = w[i] * v[:,i]. Here is the demonstration that it is incorrect:

>>> a
array([[ 1.0093272 , 0.73994495, 1.50512547],
[ 0.73994495, 1.085796 , 1.33086593],
[ 1.50512547, 1.33086593, 1.39161296]])
>>> w, v = eig(a)
>>> i = 1
>>> w[i] * v[:,i]
array([-0.20045129, 0.2535517 , -0.03350537])

but

>>> dot(a[i,:], v[i])
-0.0096475519217383288

On the other hand,

>>> dot(a[:,:], v[:,i])
array([-0.20045129, 0.2535517 , -0.03350537])

Explicit ':' slicing of a is redundant, but I think it makes documentation clearer by emphasizing the rank of a.